Tizondocs
Concepts

Errors

One error shape everywhere, a stable category, and a specific code.

Every error response has the same shape:

{
  "error": {
    "type": "payment_required",
    "code": "insufficient_funds",
    "message": "The wallet is short $4.50 for this purchase.",
    "request_id": "req_4b1c0d8e9f2a3b4c5d6e7f8091a2b3c4",
    "shortfall": { "amount": 450, "currency": "USD" }
  }
}
  • type is a stable category, safe to branch on.
  • code is the specific reason, stable within its type. This is what you handle by name.
  • message is for humans. Do not parse it; it may be reworded at any time.
  • request_id also appears as the Request-Id header. Log it.

Some codes carry extra fields. insufficient_funds carries shortfall — exactly how much more the wallet needs, so you can ask for that amount rather than guessing. Rate-limit errors carry retry_after in seconds, matching the Retry-After header.

Types

typeStatusMeaning
invalid_request_error400The request is malformed or a parameter is unusable.
authentication_error401Missing or unrecognised API key.
payment_required402The wallet cannot cover it. Nothing was charged.
permission_error403The key is valid but not allowed to do this.
not_found404No such resource in this account and mode.
conflict409The request contradicts existing state.
unprocessable422Well-formed, but semantically wrong.
rate_limit_error429Too many requests. Back off by retry_after.
api_error5xxA fault on Tizon's side.
upstream_error5xxA provider failed in a way Tizon could not absorb.

Codes worth handling by name

codeWhenWhat to do
insufficient_fundsA wallet quote exceeds available_to_spendRead shortfall, fund that much, retry with the same Idempotency-Key.
account_overdueAn open debit is past its net termsThe overdraft is frozen. Pay down before buying on credit again. See overdraft.
offer_unavailableThe provider withdrew the offerRefresh the catalog; the offer is still readable for old orders.
missing_destinationA mobile_topup offer quoted without destinationSend the phone number in E.164 form.
invalid_msisdndestination is malformedFix the number; + then country code, no spaces.
idempotency_key_reuse_mismatchA key was reused with a different bodyUse a fresh key per logical operation. See idempotency.
test_mode_onlyA test helper called with a live keySandbox tools never touch live money.
invalid_webhook_urlEndpoint URL is not public HTTPSlocalhost and private ranges are refused. Use a tunnel.
webhook_url_in_useThat URL is already registeredReuse the existing endpoint or delete it first.

Failed orders are not errors

An order that fails fulfillment returns 200 with status: "failed" and a failure_reason — not an HTTP error. The price is already back in the wallet. You are never charged for an eSIM that was not delivered, so treat a failed order as a refund that already happened, not as a debt to chase.

On this page