Skip to main content

Balances API

Last updated: 2026-10-28

Balance operations use a secret key (sk_*). Every *Minor value is a signed int64 encoded as a JSON string. Use minorUnit to convert it for display.

List balances​

GET /merchant/api/v2/balances

Auth: Secret key

The response contains authorityState and a balances array. Each array entry is one balance, identified by its asset currency, country, scope, and optional payment currency. FIAT and USDT balances can appear in the same response.

curl "https://merchants-api.tcpay.io/merchant/api/v2/balances" \
-H "Authorization: Bearer sk_test_..."

Example response:

{
"balances": [
{
"currencyCode": "XOF",
"countryCode": "CI",
"scopeType": "MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY",
"minorUnit": 0,
"updatedAt": "2026-09-25T10:00:00Z",
"availableMinor": "125000",
"pendingMinor": "18000",
"pendingInMinor": "15000",
"pendingOutMinor": "3000",
"holdMinor": "2000",
"currentMinor": "145000",
"payoutAvailableMinor": "100000",
"payoutControlsRevision": 7,
"version": 42,
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}
],
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}

All fields shown on a returned balance item are present even when their value is zero or an empty string. balances is always present and is an empty array when the merchant has no positions; the top-level authorityState is always present.

Authority state​

The response-level authorityState describes account history completeness. For current funds, check the authorityState on the exact balance row you use. FIAT rows repeat the response-level state. A USDT source-market row has its own confirmation state and can be AUTHORITATIVE while the response-level history state is UNAVAILABLE. An authoritative row does not make the account's history complete or establish that a payment method is available.

  • MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE: the returned balance information is confirmed for this account.
  • MERCHANT_BALANCE_AUTHORITY_STATE_UNAVAILABLE: confirmed balance information is not yet available for this account. This state does not by itself disable payment processing; the payout response decides acceptance.
  • MERCHANT_BALANCE_AUTHORITY_STATE_BACKFILLING: balance information is being prepared and is not yet confirmed.
  • MERCHANT_BALANCE_AUTHORITY_STATE_CATCHING_UP: recent changes are being included; the information is not yet confirmed.

Treat MERCHANT_BALANCE_AUTHORITY_STATE_UNSPECIFIED and any unknown future value as non-authoritative. Do not infer authority from non-zero balances or from a successful HTTP response.

For a non-authoritative balance row, skip its funding comparison. For a non-authoritative history response, do not assume its movements are complete. Continue handling the payout API response: it decides acceptance and can return the account-level refusal.

Balance identity and country scope​

Use currencyCode, countryCode, scopeType, and paymentCurrencyCode when present to identify a balance. currencyCode is the balance asset. The optional paymentCurrencyCode distinguishes the payment currency of a USDT source market; it is absent for FIAT rows. Do not combine rows because they share USDT or treat a displayed asset total as pooled spending funds.

  • MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY: countryCode is an ISO 3166-1 alpha-2 code. Match both currency and the payment market country.
  • MERCHANT_BALANCE_SCOPE_TYPE_GLOBAL: countryCode is empty. Use this scope only when the API explicitly returns it.
  • MERCHANT_BALANCE_SCOPE_TYPE_LEGACY_UNSCOPED: countryCode is empty. Keep this balance separate; never guess a country from the currency.

Treat MERCHANT_BALANCE_SCOPE_TYPE_UNSPECIFIED, an invalid country/currency, or duplicate entries with the same full identity as unusable for a funding comparison. Check the response with support rather than guessing which entry to use. Shared currencies can have multiple country-scoped rows: for example, XOF in CI and XOF in SN are distinct balances.

For example, CD / USD settled in USDT and CD / CDF settled in USDT remain different balances even though their asset, country, and scope match. Match the fourth dimension instead of treating them as duplicates.

A USDT position with an independently confirmed row can look like this:

{
"balances": [
{
"currencyCode": "USDT",
"paymentCurrencyCode": "KES",
"countryCode": "KE",
"scopeType": "MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY",
"minorUnit": 6,
"updatedAt": "2026-10-28T09:00:00Z",
"availableMinor": "10000000",
"pendingMinor": "0",
"pendingInMinor": "0",
"pendingOutMinor": "0",
"holdMinor": "0",
"currentMinor": "10000000",
"payoutAvailableMinor": "9000000",
"payoutControlsRevision": 7,
"version": 1,
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}
],
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_UNAVAILABLE"
}

All amounts in this row are USDT minor units. This example does not activate a settlement market or guarantee payout acceptance.

Position fields​

Response fieldJSON typeDetailed meaning
balances[].currencyCodestringBalance asset code; use the full identity described above
balances[].paymentCurrencyCodestring, optionalSource payment currency for a USDT balance; absent for FIAT
balances[].countryCodestringCountry for a country-specific balance; empty for global or historically unassigned balances
balances[].scopeTypeenum stringBalance scope: country, global, or historically unassigned; see the values above
balances[].minorUnitintegerCurrency exponent for every *Minor field; divide by 10^minorUnit only for display
balances[].updatedAtstring (date-time)Timestamp of this position revision
balances[].availableMinorstring (int64)Value in the available bucket; preserve negative values if returned
balances[].pendingMinorstring (int64)pendingInMinor + pendingOutMinor
balances[].pendingInMinorstring (int64)Value currently pending inbound
balances[].pendingOutMinorstring (int64)Value currently pending outbound
balances[].holdMinorstring (int64)Value currently in the hold bucket
balances[].currentMinorstring (int64)availableMinor + pendingMinor + holdMinor
balances[].payoutAvailableMinorstring (int64)Current amount for an advisory funding check; compare the payout plus any applicable merchant payout fee
balances[].payoutControlsRevisioninteger (int32)Revision of the effective payout controls; 0 means default controls
balances[].versioninteger (int32)Revision of this position only
balances[].authorityStateenum stringConfirmation state of this position; a USDT row can differ from the response-level history state

version and payoutControlsRevision change independently. A controls-only change can change payoutAvailableMinor without changing the position version; do not use either field as a timestamp or calculate it client-side. These revision fields are not a complete change detector for payout availability.

Use payoutAvailableMinor, not availableMinor or currentMinor, for an advisory comparison of the full debit, including the applicable payout fee, expressed in the balance asset and its minorUnit. A payment-currency amount cannot be compared directly with a USDT position. Neither an indicative FX rate nor gross convertedAmount establishes the fee-inclusive debit. If the full debit is unknown, skip the amount comparison and handle the payout response. A read does not reserve funds; use a fresh read for a new decision and handle the payout response even when the comparison passes.

Get balance history​

GET /merchant/api/v2/balances/history

Auth: Secret key

curl -G "https://merchants-api.tcpay.io/merchant/api/v2/balances/history" \
-H "Authorization: Bearer sk_test_..." \
--data-urlencode "currencyCode=XOF" \
--data-urlencode "countryCode=CI" \
--data-urlencode "scopeType=MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY" \
--data-urlencode "limit=50" \
--data-urlencode "offset=0"
Query parameterTypePresenceMeaning
limitintegerOptionalPage size; defaults to 50 and is capped at 200
offsetintegerOptionalZero-based result offset from 0 through 2147483647; larger values return HTTP 400
currencyCodestringOptionalFilter by the balance asset currency
paymentCurrencyCodestringOptionalFilter by source payment currency; for FIAT this equals its balance currency
countryCodestringOptionalFilter by market country
scopeTypeenum stringOptionalFilter by balance scope: country, global, or historically unassigned; omitted/unspecified means all scopes
sourceTypeenum stringOptionalFilter by a returned category: payment, adjustment, hold, settlement, settlement_reversal, or other
sourceIdstring (UUID)Optional, deprecatedPayment-only correlation filter; requires sourceType=payment, and other combinations return HTTP 400

Filters are combined. sourceType is case-insensitive, but values outside the six published categories return HTTP 400. Use currencyCode, countryCode, scopeType, and paymentCurrencyCode when present to reconcile one balance. Omitting payment currency includes all matching source markets. Results are ordered newest first by createdAt. Rows with the same timestamp have a stable order, but the API does not define a public field for reproducing that order. Preserve the returned order; use id for identity and deduplication.

The response always includes authorityState, movements, and page. movements is an empty array when there are no matches; page.limit, page.offset, and page.totalPages remain present even when they are zero. Apply the same authority rules as the balance snapshot.

Each returned movement has the following stable fields:

FieldJSON typeMeaning
idstringOpaque public movement identifier
operationIdstringDeprecated opaque grouping handle; use it only to group movements returned by this API
currencyCodestringAsset currency for every amount in this movement
paymentCurrencyCodestring, optionalSource-market payment currency; absent for FIAT
countryCodestringCountry for country scope; empty for global or legacy-unscoped scope
scopeTypeenum stringSame balance-scope values as the balance response
minorUnitintegerCurrency exponent for amountMinor and balance values
bucketstringChanged bucket: available, pending_in, pending_out, or hold
directionstringCREDIT or DEBIT
amountMinorstring (int64)Positive movement magnitude in minor units
balanceBeforeMinorstring (int64), nullableRecorded bucket value before the movement when available
balanceAfterMinorstring (int64), nullableRecorded bucket value after the movement when available
sourceTypeenum stringCategory: payment, adjustment, hold, settlement, settlement_reversal, or other
sourceIdstringDeprecated verified public payment ID for payment; otherwise empty
sourceReferencestringMerchant-owned payment reference preserved exactly for payment; otherwise empty
descriptionstringDescription for display; use sourceType for program logic
createdAtstring (date-time)Time the movement was recorded; an earlier settlement transfer can have a different date

For a USDT balance belonging to a KES payment market, filter both dimensions:

curl -G "https://merchants-api.tcpay.io/merchant/api/v2/balances/history" \
-H "Authorization: Bearer sk_test_..." \
--data-urlencode "currencyCode=USDT" \
--data-urlencode "paymentCurrencyCode=KES" \
--data-urlencode "countryCode=KE" \
--data-urlencode "scopeType=MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY"

An illustrative movement in that source market can look like this. Its amounts are in USDT minor units, not KES; the movement amount need not equal the gross converted payment amount because fees are separate:

{
"movements": [
{
"id": "movement-example-usdt-1",
"operationId": "group-example-usdt-1",
"currencyCode": "USDT",
"paymentCurrencyCode": "KES",
"countryCode": "KE",
"scopeType": "MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY",
"minorUnit": 6,
"bucket": "available",
"direction": "CREDIT",
"amountMinor": "9800000",
"balanceBeforeMinor": "0",
"balanceAfterMinor": "9800000",
"sourceType": "payment",
"sourceId": "00000000-0000-4000-8000-000000000002",
"sourceReference": "PI-USDT-1001",
"description": "Payment balance movement",
"createdAt": "2026-10-28T09:00:00Z"
}
],
"page": { "limit": 50, "offset": 0, "totalPages": 1 },
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}

balanceBeforeMinor and balanceAfterMinor can be omitted or null. When present, they describe the balance around that individual movement. Adjacent rows for the same balance and bucket do not guarantee a continuous running balance. A gap alone does not prove a missing payment or a duplicate charge. Use the current confirmed balance snapshot for the current position and reconcile individual payments through status reads and verified webhooks.

For settlement, an available-balance DEBIT records a transfer paid to you; a CREDIT records funding received from you. settlement_reversal reverses the recorded entry with the opposite direction. It does not represent a new external transfer or a refund. These movements have empty sourceId and sourceReference values.

Example history response:

{
"movements": [
{
"id": "movement-example-1",
"operationId": "group-example-1",
"currencyCode": "XOF",
"countryCode": "CI",
"scopeType": "MERCHANT_BALANCE_SCOPE_TYPE_COUNTRY",
"minorUnit": 0,
"bucket": "available",
"direction": "DEBIT",
"amountMinor": "2500",
"balanceBeforeMinor": "127500",
"balanceAfterMinor": "125000",
"sourceType": "payment",
"sourceId": "00000000-0000-4000-8000-000000000001",
"sourceReference": "PO-3002",
"description": "Payment balance movement",
"createdAt": "2026-09-25T10:00:00Z"
}
],
"page": { "limit": 50, "offset": 0, "totalPages": 1 },
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}

History pagination​

offset counts movements, not pages. Start at 0 and use the returned effective page.limit for the next offset. With limit: 50 and totalPages: 3, request offsets 0, 50, and 100. A requested limit above 200 is capped to 200; use that returned value when advancing.

An empty result still includes the effective limit and the requested offset. For an initial request with no matching movements, the response can be:

{
"movements": [],
"page": { "limit": 50, "offset": 0, "totalPages": 0 },
"authorityState": "MERCHANT_BALANCE_AUTHORITY_STATE_AUTHORITATIVE"
}

totalPages describes the total matching result, not pages remaining after the current offset. New movements can shift later pages. Deduplicate by id and recheck a range when completeness matters; separate reads are not one frozen snapshot.

Invalid history filters​

An unsupported sourceType or scopeType, an offset above 2147483647, or an invalid sourceId combination returns HTTP 400 / INVALID_ARGUMENT. For example, sourceType=settlement&sourceId=<payment_id> is invalid: sourceId is a payment-only filter and requires sourceType=payment plus a valid payment UUID. Correct the request before retrying. See Validation errors.

Related guide: Balances.