Skip to content

Create an FX quote

POSThttps://api.gravv.xyz/v1/fx/quote

Returns a foreign exchange rate quote for a given currency pair and amount. The quote includes a quote_id and an expiry time. Use the quote_id when submitting a transfer to lock in the quoted rate.

The Idempotency-Key header is required; requests without it are rejected.

Body Params

  • from_currencystringrequired

    Source currency code (ISO 4217).

  • to_currencystringrequired

    Target currency code (ISO 4217).

  • amountnumberrequired

    Amount in the source currency to convert. Must be greater than zero.

  • directionstringrequired

    Direction of the trade.

    Allowed:BUYSELL

Headers

  • Idempotency-Keystringrequired

    A unique key to prevent duplicate requests. Required on all FX write operations; requests without it are rejected with a 400.

Responses

Language
curl --request POST \
--url 'https://api.gravv.xyz/v1/fx/quote' \
--header 'Api-Key: <Api Key>' \
--header 'Idempotency-Key: order_789_attempt_1' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"from_currency": "USD",
"to_currency": "ZAR",
"amount": 10,
"direction": "BUY"
}'
{
"data": {
"amount": 10,
"direction": "BUY",
"display_rate": 16.283561522388,
"display_rate_label": "1 USD = 16.2836 ZAR",
"expires_at": "2026-07-03T16:30:05.640502651+01:00",
"from_currency": "USD",
"quote_id": "QT-rypoCbnP",
"rate": 16.283561522388,
"to_currency": "ZAR",
"to_currency_amount": 162.83561522388
},
"error": null
}