Skip to main content

FX Rates

CAPAY exposes two kinds of rate:

EndpointPurpose
Indicative rateGET /rates/dailyA reference rate for display and estimation
Firm quotationPOST /payments/quotationA locked, tradeable rate you attach to an FX payment

Use the indicative rate to show an approximate conversion; use a quotation when you are ready to commit to an FX payment.

Indicative daily rate

GET /rates/daily returns the current reference rate for a currency pair. Both currency codes are required.

curl "https://api.sandbox.capay.com.au/rates/daily?baseCurrencyCode=USD&quoteCurrencyCode=AUD" \
-H "Authorization: Bearer <token>"

Query parameters

ParameterRequiredDescription
baseCurrencyCodeYesBase / buy currency (ISO 4217)
quoteCurrencyCodeYesQuote / sell currency (ISO 4217)

Response

FieldDescription
currencyPaire.g. USDAUD
baseCurrencyCode / quoteCurrencyCodeThe pair queried
exchangeRateIndicative rate
targetDateDate the rate applies to
note

Daily rates are indicative only. The actual rate applied to a payment is locked at quotation time.

Firm quotation

To lock a rate for an FX payment, create a quotation. The response includes a quotationId you pass to POST /payments, and an expiryTime after which the quote is no longer valid.

curl -X POST "https://api.sandbox.capay.com.au/payments/quotation" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"baseCurrencyCode": "USD",
"quoteCurrencyCode": "AUD",
"fixedSide": "buy",
"amount": 1000,
"date": "2024-08-05"
}'

Request fields

FieldRequiredDescription
baseCurrencyCodeYesBuy currency (ISO 4217)
quoteCurrencyCodeYesSell currency (ISO 4217)
dateYesSettlement date (YYYY-MM-DD)
fixedSideNoWhich side amount fixes: buy or sell
amountNoAmount on the fixed side
clientIdNoClient the quotation belongs to

Response

FieldDescription
quotationIdPass this to POST /payments for an FX payment
currencyPaire.g. USDAUD
exchangeRateThe locked rate
targetDateSettlement date
expiryTimeWhen the quotation expires
tip

If a quotation expires before you create the payment, request a new one—an expired quotationId cannot be used.