post https://api.sandbox.payments.stonex.com/api/v/quote
The Quote API allows you to request quotes for foreign exchange (FX) trades. By providing the buy and sell currency codes, you can obtain a quote that includes the rate, expiry time, and value date for the payment.
Request
To request a quote, specify the buy and sell currency codes and either the buy amount or the sell amount. You cannot provide both amounts in the same request.
Request Body:
- Required Fields:
sellCurrency
: The ISO currency code of the currency you are selling.buyCurrency
: The ISO currency code of the currency you are buying.
- Optional Fields:
sellAmount
: The amount of the sell currency you are trading.buyAmount
: The amount of the buy currency you want to receive.
{
"sellCurrency": "USD",
"buyCurrency": "KES",
"sellAmount": 100
}
{
"sellCurrency": "USD",
"buyCurrency": "KES",
"buyAmount": 10000
}
Response
Upon a successful request, the API will return a quoteId
along with details of the rate, fee, and other relevant information.
{
"quoteId": "9e2fd202-7cb1-45de-b65a-68c1e217487e",
"sellCurrency": "USD",
"buyCurrency": "KES",
"sellAmount": 100,
"buyAmount": 12710.44,
"rate": 127.1044,
"fee": 0,
"createdTime": "2024-09-11T13:16:50.0509192Z",
"quoteExpiry": "2024-09-11T13:20:11.0004256Z",
"valueDate": "2024-09-13"
}
Fields:
quoteId
: A unique identifier for the quote.sellCurrency
: The currency being sold.buyCurrency
: The currency being bought.sellAmount
: The amount of the sell currency.buyAmount
: The amount of the buy currency.rate
: The exchange rate for the trade.fee
: Any applicable fee for the trade.createdTime
: The timestamp when the quote was created.quoteExpiry
: The time until the quote is valid.valueDate
: The date when the payment will be settled.
Usage:
- Prepare Request: Include the
buyCurrency
andsellCurrency
codes, and provide eitherbuyAmount
orsellAmount
in the request body. - Request Quote: Send a POST request to the endpoint to obtain a
quoteId
. - Book Trade: Use the
quoteId
provided in the response to book the trade. Ensure that the trade is completed before thequoteExpiry
time.
Notes:
- Currency Codes: Ensure currency codes are in ISO 4217 format (e.g., USD, EUR, KES).
- Amounts: You can provide only one of
buyAmount
orsellAmount
in the request. - Quote Expiry: The
quoteExpiry
indicates when the quote will no longer be valid. - Value Date: The
valueDate
specifies when the payment will be settled.