Zwipe engineering
Overview
Zwipe Cards API 1.0.0
Section titled “Zwipe Cards API 1.0.0”Cards Gateway. Partners issue prepaid Mastercard cards for their customers and read card balances. The card issuer behind this API can change without changing this contract.
Authentication. Exchange your client_id / client_secret for a Bearer token at
POST /v1/auth/token. Tokens live one hour. Every /v1/* call except the token
endpoint needs Authorization: Bearer <token>.
Money is always integer cents in USD. 2500 means $25.00.
Idempotency. Persist one external_ref per purchase before submitting. On
POST /v1/cards, a replay with the same email, amount, and restaurant returns the existing record; a failed or stale,
unclaimed attempt can be queued again. An uncertain issuer attempt is not reissued.
A different reference is a new financial order: for the same email and restaurant it can
load the existing issuer card. Multiple Zwipe card_id values can therefore read one
underlying card’s balance. Do not add those balances together. Chain accounts: see the
chain issue and load operations, where one reference space covers issues and loads alike.
Integration. Keep credentials on your backend and authorize customer ownership there. The partner guide at https://api.zwipe.co/docs/ includes complete request flows, server clients, frontend/mobile examples, and an offline demo. No published SDK is available. The production URL is not a sandbox: rehearse at https://sandbox.api.zwipe.co with sandbox credentials (test amounts: https://api.zwipe.co/docs/testing/sandbox/).
Webhooks. Zwipe POSTs an Event to the HTTPS URL configured on your partner account
when one of your cards is issued, fails or becomes in_doubt; chain accounts also get
load.* and transaction.created (not yet for cards brought with
POST /v1/cardholders/{external_id}/card/link). Delivery is at least once and unordered: dedupe on the
event id, and read GET /v1/cards/{card_id} or GET /v1/loads/{load_id} for the current
state. Answer 2xx within 10 seconds; anything else is retried with backoff for 3 days.
Verify Zwipe-Signature on every delivery (see the webhooks section).
Rate limit. 100 requests per second per partner across /v1/*; the token endpoint is
counted separately, per calling IP. Over the limit the answer is 429 rate_limited with a
Retry-After header in seconds.
Chain accounts. A chain (one partner for all its stores) issues each customer one card
for the whole chain with POST /v1/cardholders/{external_id}/card, keyed by its own customer
id, then tops it up and pays cashback with POST /v1/cards/{card_id}/loads. Every load is
funded from the chain’s own float at the issuer. Card-level calls use card_id; the email is
sent once, at issue. A chain endpoint called by a non-chain account, or on another of your
cards not issued this way, answers 403 chain_only; a card that is not yours is still 404.
A chain account cannot use POST /v1/cards (403 chain_account).
Errors always have the shape {"error": {"code": "...", "message": "..."}}.
code is stable and safe to branch on; message is for humans and may change.
Authentication
Section titled “Authentication”bearerAuth
Section titled “bearerAuth”Token from POST /v1/auth/token. Valid for one hour.
Security scheme type: http

