Skip to main content

FX rates API

Last updated: 2026-10-29

Read indicative rates​

GET /merchant/api/v1/fx/rates

Auth: Secret key

The key selects your merchant account and financial realm. The request does not accept a merchant identifier or a realm parameter. The response lists configured settlement markets; it is not an account-level payment availability catalog.

Query parameterTypePresenceMeaning
countryCodestringOptionalISO 3166-1 alpha-2 payment-market country filter
currencyCodestringOptionalPayment-currency filter
paymentMethodenumOptionalSelect pricing for one supported PAYMENT_METHOD_* value, including inherited terms
amountMinorstring (int64)OptionalPositive payment amount in payment-currency minor units; range 1 through 9223372036854775807

Omitting paymentMethod returns each market's general row and its configured method-specific rows. A general row omits paymentMethod. Selecting a method returns its effective pricing even when it inherits the general terms. A price does not establish that payment creation supports that method or direction.

An omitted amountMinor stays absent; the API assumes no reference amount. Rates that need an amount or an individual payment can be unavailable. When currencyCode is omitted, the amount is interpreted independently in each returned market's payment currency. Use the currency filter when requesting a rate for a particular payment.

curl -G "https://merchants-api.tcpay.io/merchant/api/v1/fx/rates" \
-H "Authorization: Bearer sk_test_..." \
--data-urlencode "countryCode=KE" \
--data-urlencode "currencyCode=KES" \
--data-urlencode "amountMinor=100000"

Illustrative response; it does not establish account or market availability:

{
"rates": [
{
"countryCode": "KE",
"currencyCode": "KES",
"currencyMinorUnits": 2,
"settlementCurrencyCode": "USDT",
"settlementCurrencyMinorUnits": 6,
"payIn": {
"available": true,
"rate": "130.25",
"sourceAsOf": "2026-10-28T09:00:00Z",
"validUntil": "2026-10-28T09:01:00Z"
},
"payOut": { "available": false }
}
]
}

Response objects​

rates is always present and is an empty array when there are no matching configured settlement markets. No synthetic 1:1 rate is returned for a FIAT balance. These are the fields of each market row:

FieldJSON typePresenceMeaning
countryCodestringRequiredPayment-market country
currencyCodestringRequiredPayment currency
currencyMinorUnitsintegerRequiredPayment-currency exponent, including zero
settlementCurrencyCodestringRequiredSettlement asset code
settlementCurrencyMinorUnitsintegerRequiredSettlement-asset exponent, from 0 through 18; USDT uses 6
paymentMethodenumOptionalPricing method; absent on the general market row
payInobjectRequiredIndependent inbound direction result
payOutobjectRequiredIndependent outbound direction result

Both direction objects have this shape:

FieldJSON typePresenceMeaning
availablebooleanRequiredWhether an indicative rate is available for this direction
ratestringWhen availableExact decimal payment-currency major units per one settlement-currency major unit
sourceAsOfstring (date-time)Optional when availableTime reported by the rate source; omitted when unknown
validUntilstring (date-time)When availableDeadline after which this indicative rate must not be used

When available is false, rate, sourceAsOf, and validUntil are absent. Do not substitute zero, parity, the other direction's rate, or the response time for a missing value. Keep decimal rates exact; avoid binary floating-point rounding in monetary calculations.

Outcomes​

  • HTTP 400 / INVALID_ARGUMENT: invalid filters, an unsupported method value, or an explicit amount outside the positive int64 range. Correct the request.
  • HTTP 429 / RESOURCE_EXHAUSTED: the FX read exceeded its processing limit. No partial rate list is returned. Narrow country, currency, or method filters before trying again. This response does not create a payment.
  • A missing or unusable rate is normally a direction with available: false; it is not a confirmed zero rate. Unexpected service failures remain errors.

This read creates no payment, reserves no funds, and locks no quote for a future payment. See FX and USDT settlement for reconciliation and Errors for the error envelope.