Convert between currencies

Headers
  • X-Api-Key
    Type: string
    required

    API Key

  • X-Idempotency-Key
    Type: string
    required

    Unique key to prevent duplicate requests

Body·
required
application/json
  • amount
    Type: number
    required

    Amount in source currency to convert

  • sourceCurrency
    Type: stringenum
    required

    Source currency

    values
    • NGN
    • USD
    • EUR
    • GBP
    • USDT
    • USDC
  • targetCurrency
    Type: stringenum
    required

    Target currency

    values
    • NGN
    • USD
    • EUR
    • GBP
    • USDT
    • USDC
  • accountId
    Type: number

    ID of the virtual account to use for NGN conversions. If omitted, the first available NGN account is used.

  • quoteId
    Type: string

    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"
  }
}