Skip to main content
A conversion quote gives you a guaranteed exchange rate for a set amount. The quote_id returned is valid until expires_at. Pass it to POST /api/v1/conversions to execute the conversion at the locked rate. If you execute a conversion without a quote, the rate applied is the market rate at execution time.

Request

POST /api/v1/conversions/quotes
Authentication: API key or JWT (Authorization: Bearer <token>)
from_currency
string
required
The currency to convert from. Example: USD.
to_currency
string
required
The currency to convert to. Example: NGN.
amount
number
required
The amount in from_currency to convert.

Response

quote_id
string
The locked quote ID. Pass this to POST /api/v1/conversions to use the rate.
from_currency
string
Source currency.
to_currency
string
Destination currency.
from_amount
string
The input amount in from_currency.
to_amount
string
The amount you will receive in to_currency at this rate.
exchange_rate
string
The locked rate: units of to_currency per one unit of from_currency.
expires_at
string
ISO 8601 timestamp. The quote is valid until this time. Request a new quote after expiry.
{
  "quote_id": "cvq_01j9kxp4q8m2r3t5v6w7y8z9",
  "from_currency": "USD",
  "to_currency": "NGN",
  "from_amount": "1000.00",
  "to_amount": "1560500.00",
  "exchange_rate": "1560.50",
  "expires_at": "2024-01-15T10:15:00Z"
}

Error codes

StatusDescription
400 Bad RequestUnsupported currency pair or invalid amount
422 Unprocessable EntityValidation error on one or more fields

Example

curl -X POST https://api.syncgrampay.com/api/v1/conversions/quotes \
  -H "Authorization: Bearer sk_live_01j..." \
  -H "Content-Type: application/json" \
  -d '{
    "from_currency": "USD",
    "to_currency": "NGN",
    "amount": 1000
  }'
Quotes expire. If you do not execute the conversion before expires_at, request a new quote. Passing an expired quote_id to the execute endpoint will result in an error.