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.
- Conditional Fields: One of these two amounts is required when requesting a quote
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": "de2f548d-c2e1-4c1a-8e44-b53daa5wr3d9",
"sellCurrency": "GBP",
"buyCurrency": "INR",
"sellAmount": 100,
"buyAmount": 10413.85,
"rate": 104.1385,
"fee": 0,
"createdTime": "2024-11-26T12:29:46.3417836Z",
"quoteExpiry": "2024-11-27T12:33:06.2861357Z",
"valueDate": "2024-11-28"
}
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
(rate validity) indicates when the quote will no longer be valid. In our sandbox, quote expiry time is set up as a default of 24 hours. In PROD the rate validity will be set up in line with your agreed onboarding terms. - Value Date: The
valueDate
specifies when the payment will be settled.