Update Quote API Documentation
The Update Quote API allows users to modify an existing currency exchange quote. This is useful when users need to adjust transaction details such as payment channel, source amount, and target currency before finalizing the exchange.
Endpoint
PUT https://{{baseURL}}/v1/quote/{{quote_id}}
Path Parameter
Parameter | Type | Description | Required |
---|---|---|---|
quote_id | String | Unique identifier of the quote to be updated | β Yes |
Headers
Header | Description | Required | Example Value |
---|---|---|---|
x-api-key | API key for authentication | β Yes | API_KEY |
Content-Type | Specifies JSON format for the body | β Yes | application/json |
Request Body
The request body should contain the updated details for the quote.
Example Request
{
"paymentChannel": "WECHAT",
"source": {
"amount": 0,
"country": "",
"currency": ""
},
"target": {
"amount": 0,
"country": "",
"currency": ""
}
}
**Request Parameters Explanation **
Field | Type | Description | Required |
---|---|---|---|
paymentChannel | String | Payment method for the transaction | β Yes |
source.amount | Number | Updated amount in the source currency | β Yes |
source.country | String | Source country code (ISO 3166-1 alpha-2) | β Yes |
source.currency | String | Source currency code (ISO 4217) | β Yes |
target.amount | Number | Updated amount in the target currency | β Yes |
target.country | String | Target country code | β Yes |
target.currency | String | Target currency code | β Yes |
Example cURL Request
curl --location --request PUT 'https://{{baseURL}}/v1/quote/{{quote_id}}' \
--header 'x-api-key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"paymentChannel": "WECHAT",
"source": {
"amount": 10000,
"country": "NG",
"currency": "NGN"
},
"target": {
"amount": 45.5,
"country": "US",
"currency": "USD"
}
}'
Success Response (200 OK)
If the request is successful, the API returns the following JSON response:
response.json
{
"message": "quote successfully updated",
"status": "success",
"data": {
"id": "90b8cb00-5fc2-4a01-87fc-558f4bd53231",
"source": {
"currency": "NGN",
"country": "NG",
"amount": 10000.00
},
"target": {
"currency": "USD",
"country": "US",
"amount": 45.50
},
"rate": 220.00,
"fee": {
"amount": 15.00
},
"rules": [
{
"category": "LIMIT",
"appliedCurrency": "USD",
"appliedCountry": "US",
"transaction": {
"minimum": 5.00,
"maximum": 50000.00
},
"invoice": 50000.00
}
],
"summary": {
"total": 10015.00
}
}
}
Error Handling
Status Code | Meaning | Example Response |
---|---|---|
400 | Bad Request | { "message": "Invalid parameters" } |
401 | Unauthorized | { "message": "Invalid API key" } |
422 | Unprocessable Entity | { "message": "Invalid currency code" } |
500 | Internal Server Error | { "message": "An internal error occurred" } |
Key Takeaways
- β The user modifies an existing quote by updating the amount, source, and target details.
- β The response returns the updated exchange rate, transaction fee, and total payable amount.
- β A transaction limit rule ensures transactions remain within 5 USD β 50,000 USD.
Best Practices
- β
Ensure the
quote_id
is retrieved from the Create Quote API before making the update request. - β Validate that the updated source and target currency codes are correct.
- β Implement error handling for common status codes such as: