FX Rates
CAPAY exposes two kinds of rate:
| Endpoint | Purpose | |
|---|---|---|
| Indicative rate | GET /rates/daily | A reference rate for display and estimation |
| Firm quotation | POST /payments/quotation | A 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"eCurrencyCode=AUD" \
-H "Authorization: Bearer <token>"
Query parameters
| Parameter | Required | Description |
|---|---|---|
baseCurrencyCode | Yes | Base / buy currency (ISO 4217) |
quoteCurrencyCode | Yes | Quote / sell currency (ISO 4217) |
Response
| Field | Description |
|---|---|
currencyPair | e.g. USDAUD |
baseCurrencyCode / quoteCurrencyCode | The pair queried |
exchangeRate | Indicative rate |
targetDate | Date 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
| Field | Required | Description |
|---|---|---|
baseCurrencyCode | Yes | Buy currency (ISO 4217) |
quoteCurrencyCode | Yes | Sell currency (ISO 4217) |
date | Yes | Settlement date (YYYY-MM-DD) |
fixedSide | No | Which side amount fixes: buy or sell |
amount | No | Amount on the fixed side |
clientId | No | Client the quotation belongs to |
Response
| Field | Description |
|---|---|
quotationId | Pass this to POST /payments for an FX payment |
currencyPair | e.g. USDAUD |
exchangeRate | The locked rate |
targetDate | Settlement date |
expiryTime | When the quotation expires |
tip
If a quotation expires before you create the payment, request a new one—an
expired quotationId cannot be used.