API reference › Balance

GET/balance

Account prepaid balance (a test key: the account's test wallet)

wallet says which: live — the real prepaid balance (a live key); test — the account's test wallet (a test key; play money set with POST /test/wallet, credit = its test deferred payment). balance is money and never negative. totalAvailable = balance + bonusBalance − pendingDebt − open deferred-payment debt (may be negative). canCreateShipment is false while pendingDebt exceeds the balance, or while the account is blocked for overdue deferred-payment debt (bookings then answer 402 CREDIT_OVERDUE_BLOCKED). It does not look at a price: a booking still needs the balance to cover it (or, with deferred payment switched on, room left in the limit). Deferred-payment debt left open after IDS switched deferred payment off does not block bookings by itself and does not make canCreateShipment false, unless it is overdue past the block day of an account with overdue blocking switched on (then canCreateShipment is false and bookings answer 402 CREDIT_OVERDUE_BLOCKED, with deferred payment on or off): a booking the balance covers goes through, a refused one (402 PAYMENT_REQUIRED) asks in shortfall for the price plus the part of that debt not on hold, because money that arrives pays the debt first. credit is null for an account without deferred payment (and no debt left from it); otherwise { enabled, limit, debt (rounded up to the cent), available (credit left, 0 while switched off), total (balance − debt − pendingDebt, a minus rounded away from zero), overdue ({ amount, oldestDueDate, blockStartsOn } or null; blockStartsOn is null when blockEnabled is false), blockEnabled (whether overdue debt blocks this account's bookings at all — IDS sets it per account, off unless agreed), blocked, currency }. Money that arrives for the account (a card top-up, a bank transfer IDS records, a refund) pays the open debts first, earliest due date first; late payment penalties, if the account has them, only after every other amount owed. debt includes them.

Key scope
balance:read
Idempotency-Key
Not used
URL
https://ids.express/api/v1/balance

Call it

curl -s "https://ids.express/api/v1/balance" \
  -H "Authorization: Bearer $IDS_KEY"

Answers

200 Balance

Headers: X-Request-Id

application/json — Balance

  • walletstringrequired

    one of: live · test

    TST: live — the account's real prepaid balance (a live key); test — the account's test wallet, play money of its test keys, never the real balance.

  • balancenumberrequired
  • balanceMinorintegerrequired

    The amount beside it in minor units (cents).

  • bonusBalancenumberrequired
  • bonusBalanceMinorintegerrequired

    The amount beside it in minor units (cents).

  • pendingDebtnumberrequired
  • pendingDebtMinorintegerrequired

    The amount beside it in minor units (cents).

  • currencystringrequired
  • totalAvailablenumberrequired
  • totalAvailableMinorintegerrequired

    The amount beside it in minor units (cents).

  • canCreateShipmentbooleanrequired
  • creditobjectrequirednullable
  • enabledbooleanrequired
  • limitnumberrequired
  • limitMinorintegerrequired

    The amount beside it in minor units (cents).

  • debtnumberrequired
  • debtMinorintegerrequired

    The amount beside it in minor units (cents).

  • availablenumberrequired
  • availableMinorintegerrequired

    The amount beside it in minor units (cents).

  • totalnumberrequired
  • totalMinorintegerrequired

    The amount beside it in minor units (cents).

  • overdueobjectrequirednullable
  • amountnumberrequired
  • amountMinorintegerrequired

    The amount beside it in minor units (cents).

  • oldestDueDatestringrequired
  • blockStartsOnstringrequirednullable
  • blockEnabledbooleanrequired
  • blockedbooleanrequired
  • currencystringrequired
401 AUTHENTICATION_FAILED — missing, malformed, invalid, revoked or expired key

Headers: X-Request-Id

Codes: AUTHENTICATION_FAILED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

403 API_ACCESS_DISABLED / API_ACCOUNT_DISABLED / API_KEY_IP_NOT_ALLOWED / API_TERMS_NOT_ACCEPTED / FORBIDDEN_SCOPE / API_OWNER_NOT_BILLABLE; a platform's key: PLATFORM_SUSPENDED (a quote, booking or test operation of a suspended platform) / PLATFORM_TARIFF_MISSING (a quote or booking before IDS set its tariff)

Headers: X-Request-Id

Codes: API_ACCESS_DISABLEDAPI_ACCOUNT_DISABLEDAPI_KEY_IP_NOT_ALLOWEDAPI_TERMS_NOT_ACCEPTEDFORBIDDEN_SCOPEAPI_OWNER_NOT_BILLABLEPLATFORM_SUSPENDEDPLATFORM_TARIFF_MISSING

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

404 NOT_FOUND — not visible to this key (other account or other environment)

Headers: X-Request-Id

Codes: NOT_FOUND

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

429 RATE_LIMITED — per-key or per-IP limit exceeded; wait Retry-After seconds

Headers: X-Request-IdRetry-After

Codes: RATE_LIMITED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

500 INTERNAL_ERROR

Headers: X-Request-Id

Codes: INTERNAL_ERROR

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

503 API_DISABLED (API switched off); CARRIER_NOT_CONFIGURED / CURRENCY_RATE_MISSING where a carrier or FX rate is used

Headers: X-Request-Id

Codes: API_DISABLEDCARRIER_NOT_CONFIGUREDCURRENCY_RATE_MISSING

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

Error codes of this operation

The codes the answers of this operation name. Always read error.retryable of the answer itself — «varies» means it differs per answer. The gates of every keyed request (401, 403, 429, 503) and the whole catalog: errors.

  • AUTHENTICATION_FAILEDHTTP 401retryable: no

    Missing, malformed, invalid, revoked or expired key; an environment tag that does not match. (An account switched off answers 403 API_ACCOUNT_DISABLED since SEC.)

  • API_ACCESS_DISABLEDHTTP 403retryable: no

    API access is switched off for this account.

  • API_ACCOUNT_DISABLEDHTTP 403retryable: no

    The IDS account of this key is switched off, not approved or closed (for an employee's key: its franchise owner's account) — the key stops with it; contact IDS.

  • API_KEY_IP_NOT_ALLOWEDHTTP 403retryable: no

    IDS keeps a list of IP addresses for this key and the request came from another one — send it from a listed address, or ask IDS to change the list.

  • API_TERMS_NOT_ACCEPTEDHTTP 403retryable: no

    The IDS account of this key has not accepted the API Terms of Use (/legal/api-terms) — its holder accepts them in the IDS cabinet (Integrations / API), or IDS records a signed agreement (for an employee's key: its franchise owner's account). Retrying does not help until then.

  • FORBIDDEN_SCOPEHTTP 403retryable: no

    The key lacks the scope of this operation (x-scope).

  • API_OWNER_NOT_BILLABLEHTTP 403retryable: no

    The account cannot be billed through the API (no pricing tier, or an admin account).

  • PLATFORM_SUSPENDEDHTTP 403retryable: no

    The platform of this key is suspended by IDS: quotes, bookings and test operations are refused until IDS resumes it; reads, the tracking refresh, a cancellation and a complaint still work. A retry of a booking finished before the suspension replays its answer.

  • PLATFORM_TARIFF_MISSINGHTTP 403retryable: no

    The platform has no tariff yet — IDS sets it; no quote or booking until then.

  • NOT_FOUNDHTTP 404retryable: no

    Unknown path, or an object this key may not see (another account, the other environment).

  • RATE_LIMITEDHTTP 429retryable: yes

    A limit per minute — the key's requests, its quotes, its platform's keys together, or the client IP (limitScope) — wait Retry-After seconds (retryAfterSec, limit).

  • INTERNAL_ERRORHTTP 500retryable: no

    Unexpected — for a booking, check GET /shipments before using a new key; quote the requestId.

  • API_DISABLEDHTTP 503retryable: no

    IDS switched the whole API off (/ping and /openapi.json keep answering).

  • CARRIER_NOT_CONFIGUREDHTTP 503retryable: no

    The carrier credentials of this environment are missing.

  • CURRENCY_RATE_MISSINGHTTP 503retryable: no

    IDS has no exchange rate for the balance currency.