Convert between currencies
Headers
- Type: stringX
- Api - Key requiredAPI Key
- Type: stringX
- Idempotency - Key requiredUnique key to prevent duplicate requests
Body·
required
application/json
- Type: numberamountrequired
Amount in source currency to convert
- Type: stringenumsource
Currency requiredSource currency
values- N
G N - U
S D - E
U R - G
B P - U
S D T - U
S D C
- Type: stringenumtarget
Currency requiredTarget currency
values- N
G N - U
S D - E
U R - G
B P - U
S D T - U
S D C
- Type: numberaccount
Id ID of the virtual account to use for NGN conversions. If omitted, the first available NGN account is used.
- Type: stringquote
Id UUID of an existing quote to execute with its locked-in rate
Responses
- application/json
- application/json
- application/json
- 409
Duplicate request (idempotency conflict)
- 429
Rate limit exceeded
Request Example for post/v1/conversions
curl https://api.esca.finance/v1/conversions \
--request POST \
--header 'X-Api-Key: ' \
--header 'X-Idempotency-Key: ' \
--header 'Content-Type: application/json' \
--data '{
"amount": 500000,
"sourceCurrency": "NGN",
"targetCurrency": "USD",
"quoteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"accountId": 1
}'
{
"status": true,
"message": "Conversion Successful",
"data": {
"conversionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"sourceCurrency": "NGN",
"targetCurrency": "USD",
"sourceAmount": 500000,
"targetAmount": 312.5,
"appliedRate": 1600,
"status": "COMPLETED",
"quoteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}