Errors and recovery
Expected API errors use this envelope:
{ "error": { "code": "validation_error", "message": "Request body invalid", "details": [{"pointer": "/amount_cents", "message": "Expected an integer"}] }}Branch on error.code, not the human-readable message. details is optional. Proxies and network failures can produce no body or non-JSON responses; handle those without assuming the write failed.
| HTTP / code | Meaning | Action |
|---|---|---|
400 validation_error |
Invalid body/parameter or an unsupported field. | Correct the request; inspect field pointers. |
400 venue_required |
Multi-restaurant account omitted venue. |
Use your order’s assigned restaurant pair. |
401 invalid_client |
Token exchange credentials/account rejected. | Check credentials and account state with Zwipe. |
401 unauthorized |
Missing, expired, or invalid access token. | Renew once; stop if the new token fails. |
403 insufficient_scope |
Missing endpoint permission. | Request the scope; token renewal alone does not help. |
403 venue_not_registered |
Your account cannot use that restaurant. | Confirm restaurant assignment with Zwipe. |
403 chain_only |
A chain-only endpoint called by a non-chain account, or on a card not issued through the chain issue endpoint. | Use the endpoints for your account type. |
403 chain_account |
A chain account called POST /v1/cards. |
Issue with POST /v1/cardholders/{external_id}/card. |
404 not_found |
Unknown, malformed, or another partner’s card or load ID, or a customer with no card. Balance also returns this for a failed card. | Check your saved top-level card_id and partner account. |
405 method_not_allowed / 415 unsupported_media_type |
Wrong method or request content type. | Follow the reference and send JSON. |
409 external_ref_conflict |
Reference reused with a different email, amount, or venue; on chain accounts, a different body or a reference already used by the other operation (see idempotency). | Restore the original request; use a new reference only for a genuinely new purchase. |
409 venue_claimed |
A registering partner cannot claim that restaurant. | Resolve ownership with Zwipe; do not invent new venue IDs. |
409 card_exists |
Chain issue for a customer who already has a card. | Load that card with POST /v1/cards/{card_id}/loads; find it with GET /v1/cardholders/{external_id}/card. |
409 cardholder_email_conflict |
The email, or on a link the customer’s existing card, already belongs to another of your customers. | Resolve the duplicate customer on your side. |
404 no_existing_card |
POST /v1/cardholders/{external_id}/card/link found no card the customer already holds. |
Sell them a card with POST /v1/cardholders/{external_id}/card. |
409 card_not_active |
Load or wallet link on a card that is not issued. |
Wait for issued, or follow recovery if it is in_doubt. |
409 issuance_in_doubt |
No confirmed issuer card ID to read. | Preserve the order and follow recovery. |
429 rate_limited |
Over the request limit. Nothing was carried out. | Wait Retry-After seconds, then retry; see rate limits. |
502 provider_unavailable, provider_error, or provider_timeout |
The upstream operation did not return a usable result. | For reads, retry later; for issuance uncertainty, preserve the original reference and inspect status. |
500 internal_error |
Unexpected server failure. | Retain identifiers and request ID if supplied; investigate before repeating a write. |
error_code inside a successful card response describes issuance; it is not an HTTP error. 200 with status: "failed" still means the issuance failed. 200 with verified: false means an email code was not accepted.
Bounded retries
Section titled “Bounded retries”For reads, a policy such as 2, 4, then 8 seconds with jitter can absorb a temporary outage. This is example client behavior, not a guaranteed service quota. Stop after a bounded number of attempts and show a recoverable message.
Do not automatically resend email codes, change external_ref, or retry an uncertain financial order. The idempotency guide explains how to recover a lost issuance response.
For support, include UTC time, operation path, HTTP status, stable error code, your external_ref, top-level card_id, and X-Request-ID if returned. Exclude client secrets, access tokens, verification codes, wallet/collection URLs, and unnecessary customer data.

