Skip to content

Spending limits ​

Xash can cap what your server tokens may spend, so that a leaked or misbehaving token cannot empty your wallet. There are two limits:

  • Per transaction: the most one purchase may cost.
  • Per day: the most you may spend in one calendar day.

A purchase over a limit is refused with 422 and the code LIMIT_PER_TRANSACTION or LIMIT_DAILY. Nothing is charged and nothing is sent to the network or utility.

Who has limits ​

Not every account has limits. They are set per account by Xash staff.

  • An account that already held a server token when limits were introduced was set to "no limits". Nothing changed for it.
  • Other accounts follow Xash's standard limits. While none are switched on, nothing is limited.

Do not assume either way: read your limits. A figure of null means there is no limit of that kind. To have a limit set, changed or removed, write to [email protected]. You cannot change it through the API.

What is limited ​

Limits apply to requests made with a server token only. Purchases made in the Xash mobile app, or with any other session token, are never limited and do not count toward the day.

With a server token, these spend from the limit:

ProductEndpoint
Direct airtimePOST /api/v1/airtime/direct
Airtime vouchersPOST /api/v1/airtime/voucher/{carrier}/buy
BundlesPOST /api/v1/bundles/buy/{bundle}
Bundle vouchersPOST /api/v1/bundles/voucher/buy/{bundle}
ZESA tokens, prepaid and on accountPOST /api/v1/electricity/buy-tokens
DStv paymentsPOST /api/v1/dstv/purchase
WiFi vouchersPOST /api/v1/wifi/vouchers/buy
Transfers to another accountPOST /api/v1/transfer, POST /api/v1/transfer/confirm/{transfer}

Deposits are not limited: they add money, they do not spend it.

How the limits work ​

Per transactionA purchase of exactly the limit is allowed. One cent more is refused.
Per dayA purchase is refused when today's total plus this purchase would be above the limit.
The dayThe calendar day in Africa/Harare (UTC+2). It resets at midnight there. resets_at in every answer gives the exact time.
CurrencyLimits are set in USD. A purchase from a wallet in another currency is counted separately under ZWG, with its own figures and its own daily total. USD and ZWG spending are never added together.

ZWG in these answers stands for your local-currency wallet, whatever code that wallet uses. If Xash has set no separate ZWG figure, the USD figure applies to the local-currency amount as a plain number.

What counts toward the day ​

  • A purchase counts from the moment its money is held, before the network or utility has answered.
  • If it definitely fails and the money is returned, it stops counting.
  • If its outcome is not known yet (202 OUTCOME_UNKNOWN), it keeps counting until it is settled. Once it is settled as failed, it no longer counts.
  • A transfer counts when it is confirmed.
  • The daily total is kept only while a daily limit is in force. On the day a daily limit is first set, spending from earlier that day is not counted.

Your balance is checked first. A purchase that is above your balance and above a limit is refused for the balance.

Read your limits ​

GET /api/v1/limits

Returns the limits on your account and what is left today. Read-only. It works with a server token or a session token.

bash
curl https://app.xash.co.zw/api/v1/limits \
  -H "Authorization: Bearer YOUR_SERVER_TOKEN"

Response 200: an account with limits ​

json
{
  "success": true,
  "message": "Spending limits for purchases made with a server token.",
  "data": {
    "applies_to": "server_tokens",
    "source": "account",
    "day": "2026-11-19",
    "timezone": "Africa/Harare",
    "resets_at": "2026-11-20T00:00:00+02:00",
    "limits": [
      {
        "currency": "USD",
        "per_transaction": "50.00",
        "per_day": "500.00",
        "used_today": "120.00",
        "remaining_today": "380.00"
      },
      {
        "currency": "ZWG",
        "per_transaction": "50.00",
        "per_day": "15000.00",
        "used_today": "0.00",
        "remaining_today": "15000.00"
      }
    ],
    "enforced_on_this_token": true
  }
}

In this example Xash set a separate daily figure for ZWG but no separate per-transaction figure, so the USD figure of 50.00 applies to both.

Response 200: an account with no limits ​

json
{
  "success": true,
  "message": "Spending limits for purchases made with a server token.",
  "data": {
    "applies_to": "server_tokens",
    "source": "none",
    "day": "2026-11-19",
    "timezone": "Africa/Harare",
    "resets_at": "2026-11-20T00:00:00+02:00",
    "limits": [
      {
        "currency": "USD",
        "per_transaction": null,
        "per_day": null,
        "used_today": null,
        "remaining_today": null
      },
      {
        "currency": "ZWG",
        "per_transaction": null,
        "per_day": null,
        "used_today": null,
        "remaining_today": null
      }
    ],
    "enforced_on_this_token": true
  }
}

Fields ​

FieldDescription
applies_toAlways server_tokens.
sourceWhere the figures come from. See the table below.
dayToday's date in timezone.
timezoneAlways Africa/Harare.
resets_atWhen the day resets: the next midnight in Africa/Harare, as ISO 8601 with the +02:00 offset.
limitsAlways two rows, USD first, then ZWG.
limits[].per_transactionThe most one purchase may cost. null when there is no per-transaction limit.
limits[].per_dayThe most you may spend in a day. null when there is no daily limit.
limits[].used_todayWhat has been counted today. null when there is no daily limit.
limits[].remaining_todayWhat is left today, never below 0.00. null when there is no daily limit.
enforced_on_this_tokentrue when the token you called with is a server token, so its purchases are limited by these figures. false for a session token: the figures still describe your server tokens, but purchases made with this token are not limited.
sourceMeaning
accountXash set limits for your account.
defaultYour account follows Xash's standard limits. If none are switched on, every figure is null and nothing is limited.
noneYour account has no limits.

Amounts are strings with two decimals.

A missing or invalid token answers 401, like every other endpoint.

LIMIT_PER_TRANSACTION ​

The amount of this purchase is above your per-transaction limit.

json
{
  "success": false,
  "error_code": "LIMIT_PER_TRANSACTION",
  "message": "USD 60.00 is above this account's limit of USD 50.00 per transaction for server tokens. Nothing was charged. Use a smaller amount, or ask Xash support to change the limit.",
  "data": {
    "limit": "50.00",
    "limit_currency": "USD",
    "requested": "60.00",
    "used_today": "120.00",
    "remaining_today": "380.00",
    "resets_at": "2026-11-20T00:00:00+02:00"
  }
}

What to do: send an amount of limit or less, or ask Xash to raise the limit. Waiting does not help: this limit does not reset.

LIMIT_DAILY ​

This purchase would take today's total above your daily limit.

json
{
  "success": false,
  "error_code": "LIMIT_DAILY",
  "message": "USD 30.00 would take this account above its daily limit of USD 500.00 for server tokens: USD 480.00 used today, USD 20.00 remaining. Nothing was charged. The day resets at midnight, Africa/Harare time.",
  "data": {
    "limit": "500.00",
    "limit_currency": "USD",
    "requested": "30.00",
    "used_today": "480.00",
    "remaining_today": "20.00",
    "resets_at": "2026-11-20T00:00:00+02:00"
  }
}

What to do: send no more than remaining_today, wait until resets_at, or ask Xash to raise the limit.

The refusal body ​

Both codes answer 422. On every product, with or without a reference, error_code is at the top level of the body and data carries these fields:

FieldDescription
limitThe limit that refused the purchase: the per-transaction figure for LIMIT_PER_TRANSACTION, the daily figure for LIMIT_DAILY.
limit_currencyUSD or ZWG.
requestedThe amount of this purchase.
used_todayWhat has been counted today. null if you have no daily limit.
remaining_todayWhat is left today. null if you have no daily limit.
resets_atWhen the day resets.

As with every answer, branch on error_code and read the figures from data. Do not parse message.

A refused purchase and its reference ​

A limit refusal is a definite failure. No money was held and nothing reached the network or utility. Once the amount fits the limit, it is safe to try again in the ways below.

You sentWhat happens to itTo try again
A reference (airtime, airtime vouchers, bundles, bundle vouchers, ZESA, DStv)The refusal is stored on the reference, with its figures. Repeating the reference returns the same refusal, even after the limit is raised or the day has reset.Send a new reference.
A WiFi client_referenceThe reference is not used up.Send the same client_reference again.
No referenceNothing is recorded.Send the request again.
A transferRefused when you initiate it: no transfer is created. Refused when you confirm it: the pending transfer stays.Initiate again with a smaller amount, or confirm the same transfer once the limit allows it.

With a reference, data also carries the usual reference fields:

json
{
  "success": false,
  "error_code": "LIMIT_PER_TRANSACTION",
  "message": "USD 2.00 is above this account's limit of USD 1.50 per transaction for server tokens. Nothing was charged. Use a smaller amount, or ask Xash support to change the limit.",
  "data": {
    "reference": "order-5005",
    "status": "failed",
    "provider_reference": null,
    "amount": "2.00",
    "currency": "USD",
    "product": "bundle_voucher",
    "recipient": null,
    "transaction_id": "00000000-0000-4000-8000-00000000c005",
    "fulfilment": null,
    "error_code": "LIMIT_PER_TRANSACTION",
    "created_at": "2026-11-19T10:15:00+02:00",
    "limit": "1.50",
    "limit_currency": "USD",
    "requested": "2.00",
    "used_today": null,
    "remaining_today": null,
    "resets_at": "2026-11-20T00:00:00+02:00"
  }
}

GET /api/v1/transactions/status for that reference answers status: failed with the limit code in error_code.

Staying inside a daily limit ​

  • Call GET /api/v1/limits before a large batch and compare remaining_today with what you are about to spend.
  • Treat remaining_today as a guide, not a reservation. Another request of yours can spend it first. The purchase itself decides, and a refusal costs nothing.
  • Purchases whose outcome is not known yet still count. If several are held, remaining_today stays lower until they are settled.
  • Do not retry a refused purchase in a loop. LIMIT_DAILY will not change before resets_at unless an earlier purchase is settled as failed, and LIMIT_PER_TRANSACTION will not change at all.