API reference › Test mode

POST/test/wallet

Test keys: set, top up or configure the account's test wallet (play money; never the real balance)

balance sets the play money to exactly that and clears the test debt (a reset); topUp adds money, which pays the test debt first; creditLimit switches the test deferred payment on (> 0) or off (0) — a booking may then go into a test debt up to it, and past it answers 402 CREDIT_LIMIT_EXCEEDED; overdueBlocked true makes bookings answer 402 CREDIT_OVERDUE_BLOCKED. Without a test deferred payment a booking the wallet cannot pay answers 402 PAYMENT_REQUIRED. A new wallet holds 0. The wallet is the account's (an employee's key: the franchise owner's) and is shared by all its test keys; it is in the account's balance currency, the one bookings charge (another currency: 400). Answers the wallet as GET /balance does.

Key scope
shipments:write
Idempotency-Key
Not used
URL
https://ids.express/api/v1/test/wallet

Request body

Unknown fields are rejected (400 VALIDATION_FAILED, details[].path names the field).

application/json — TestWalletRequest

  • balancenumber≥ 0≤ 1000000

    Set the test balance to exactly this and clear the test debt (a reset).

  • topUpnumber> 0≤ 1000000

    Add play money; it pays the test debt first.

  • creditLimitnumber≥ 0≤ 1000000

    Test deferred payment: bookings may go into a test debt up to this (0 = off).

  • overdueBlockedboolean

    Simulate «blocked for overdue debt»: bookings answer 402 CREDIT_OVERDUE_BLOCKED.

  • currencystringpattern ^[A-Za-z]{3}$

    The wallet's currency; default the account's balance currency (the one bookings charge).

Call it

curl -s -X POST "https://ids.express/api/v1/test/wallet" \
  -H "Authorization: Bearer $IDS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "balance": 0
}'

Answers

200 The test wallet (wallet «test»)

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
400 VALIDATION_FAILED — a field (details[0].path): nothing to change, balance and topUp together, an amount out of range or with more than whole cents, a currency other than the account's

Headers: X-Request-Id

Codes: VALIDATION_FAILED

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

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 TEST_MODE_ONLY (a live key) / API_ACCESS_DISABLED / FORBIDDEN_SCOPE / API_OWNER_NOT_BILLABLE

Headers: X-Request-Id

Codes: TEST_MODE_ONLYAPI_ACCESS_DISABLEDFORBIDDEN_SCOPEAPI_OWNER_NOT_BILLABLE

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.

  • VALIDATION_FAILEDHTTP 400retryable: nodetails: ValidationIssuesdetails: ServiceRefusal

    The request is invalid: a field (details[].path), an unknown field, a missing Idempotency-Key, a body that is not JSON, an address the label cannot print. Fix it; repeating it unchanged fails again.

  • 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.)

  • TEST_MODE_ONLYHTTP 403retryable: no

    An operation of the test mode (/test/…) with a live key — test keys (ids_test_…) only.

  • API_ACCESS_DISABLEDHTTP 403retryable: no

    API access is switched off for this account.

  • 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).

  • 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.