Issue or load a prepaid card
const url = 'https://api.zwipe.co/v1/cards';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"first_name":"Jane","last_name":"Doe","email":"jane@example.com","phone":"+15551234567","amount_cents":2500,"currency":"USD","external_ref":"ph-order-12345","venue":{"brand_id":123,"restaurant_id":456}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.zwipe.co/v1/cards \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "first_name": "Jane", "last_name": "Doe", "email": "jane@example.com", "phone": "+15551234567", "amount_cents": 2500, "currency": "USD", "external_ref": "ph-order-12345", "venue": { "brand_id": 123, "restaurant_id": 456 } }'Requires cards:issue. Orders a card loaded with amount_cents for the customer.
A new reference for an existing email/restaurant can load its existing issuer card.
Asynchronous: the answer is 202 with status: pending, and the issuer is called in the
background. Poll GET /v1/cards/{card_id} (every 2 seconds is enough) until status
is no longer pending. Issuing usually takes a few seconds and can take up to about
90 when the issuer is slow. A card still pending after that is still being worked on:
keep checking later, and do not treat it as failed.
Final states, read through GET /v1/cards/{card_id}:
issued: the card exists and is active;issuercarries its links.failed: the issuer rejected the order (error_codesays why). Calling this endpoint again with the sameexternal_refand payload orders it again (202).in_doubt: the issuer did not answer in time, took the order without confirming it, or has not activated the card yet, so it may exist. Do not create a replacement order with a new reference. A same-reference replay returns the uncertain record without another issuer attempt. Afteractivation_pendingthe card turnsissuedon its first successful balance read (scopecards:balance); one withoutissuer.card_idanswers409 issuance_in_doubt: contact Zwipe. Afterprovider_unconfirmedthe card staysin_doubtand may hold less thanamount_cents: reconcile with Zwipe. Current balance also reflects other loads and spending, so a difference alone is not a refund decision.
Repeating the call with the same external_ref and the same payload returns 200 with
the card in its current state, or 202 when it orders the card again: after failed, or
when the first order was lost before reaching the issuer. Same external_ref with a
different email, amount, restaurant, or expected issuer card is 409 external_ref_conflict. Names and phone
are not compared or updated by replay. Preserve the original request, including exact
email spelling, and scope the reference uniquely across your whole partner account.
For an exact-card reload, supply expected_issuer_card_id. The issuer must find that
activated card with the same mailbox and restaurant before loading it; it never selects
another card or issues a replacement. A mismatched or unavailable target makes the
asynchronous order failed. Preserve the expectation on every replay, including retries.
A chain account is refused with 403 chain_account; it issues through
POST /v1/cardholders/{external_id}/card.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Cardholder email. One card per email per restaurant, unless that card failed activation.
Cardholder mobile in E.164, e.g. +15551234567. Required by the issuer.
Requested load in integer cents, including a repeat load of an existing issuer card. $1.00 to $1,000.00 during the pilot.
Optional exact issuer card to reload. It must already be successfully issued and activated for this mailbox and restaurant. A missing or mismatched card is refused before issuer side effects; no other card is selected or created. Adding, changing, or removing this field on a replay returns external_ref_conflict.
Your persisted purchase reference, unique across the partner account and all its restaurants. Reuse it with the original request for recovery; a new reference is a new order.
Restaurant the card is sold for. Omit only if your account has a configured home
restaurant; otherwise venue_required is returned. The pair decides which issuer account funds the card and which restaurant is
billed, so it must be the restaurant the customer actually paid. A restaurant belongs
to one partner: one held by another partner is refused, and unless your account
registers its own restaurants, one that is not yet on file is refused too.
object
Example
{ "first_name": "Jane", "last_name": "Doe", "email": "jane@example.com", "phone": "+15551234567", "amount_cents": 2500, "currency": "USD", "external_ref": "ph-order-12345", "venue": { "brand_id": 123, "restaurant_id": 456 }}Responses
Section titled “Responses”Same external_ref and payload seen before; the card in its current state
object
UUID of this Zwipe issuance/load record; on a chain card, of the card itself (its loads are Load records). Use it in status and balance routes; it is not a PAN or the issuer’s card ID.
pending until the issuer has answered. in_doubt: the issuer may hold a card
(see error_code); do not submit a replacement load with a new reference.
A replay with the original reference returns that uncertain record without reissuing.
Why the card is failed (the issuer’s code, provider_unavailable, or for a chain card
float_insufficient) or in_doubt:
provider_timeout (no answer in time, or an error after the order may have been
taken), provider_unconfirmed (the issuer took the order but did not confirm the card
and its full load) or
activation_pending (the card exists but is not active yet). After activation_pending, a
successful GET /v1/cards/{card_id}/balance turns a POST /v1/cards card issued;
Zwipe confirms a chain card itself. After
provider_unconfirmed the card stays in_doubt and may hold less than amount_cents:
reconcile with Zwipe; current balance can also include other loads and spending. Null otherwise.
Stored amount in cents, which can initially reflect the requested load rather than a confirmed live balance; on a chain card, the first load only. Use GET /v1/cards/{card_id}/balance and its as_of timestamp for display.
What the card issuer returned. Provider-specific and best effort: absent fields mean the issuer did not send them, except in webhook events, which always omit the two links. Treat the links as bearer capabilities and do not log them.
object
The issuer’s own card ID, not the UUID used in Zwipe routes. Several issuance/load records may share it.
Hosted page that adds the card to Apple Wallet. Valid for 72 hours after the underlying card’s first issuance; anyone
holding it can add the card and see its full number, expiry and CVV. Show it only to the
cardholder; never store or log it. A repeat order for an email that already has a card at
that restaurant loads that card and returns no link: wallet_url and collect_url are null.
On cards from POST /v1/cards there is no link-refresh endpoint; chain cards use
POST /v1/cards/{card_id}/wallet-links and always have null links here.
Google Wallet is not supported.
Separate issuer-hosted card collection flow, when available. Not a dedicated card-details iframe or wallet-link refresh. Treat it as sensitive access.
Restaurant this card was issued for, and whose issuer account funded it. Equal to the
restaurant on your account when the request omitted venue. Never null for a card from
POST /v1/cards; null for a chain card, except one brought from a restaurant with
POST /v1/cardholders/{external_id}/card/link, which keeps that restaurant.
A restaurant, by its PizzaBox platform ids.
object
Your customer id, on chain cards only.
Example
{ "card_id": "0192f7a4-5c2e-7d3b-9a1f-4e8b2c6d0a11", "status": "issued", "error_code": null, "balance_cents": 2500, "currency": "USD", "external_ref": "ph-order-12345", "created_at": "2026-09-10T12:34:56Z", "venue": { "brand_id": 123, "restaurant_id": 456 }, "issuer": { "card_id": "7793338", "order_id": 4242, "wallet_url": "https://app.pizzabox.ai/akimbo/wallet/add?token=abc", "collect_url": "https://app.akimbocard.com/collect/abc" }}Card ordered; the issuer is being called. Poll GET /v1/cards/{card_id}.
object
UUID of this Zwipe issuance/load record; on a chain card, of the card itself (its loads are Load records). Use it in status and balance routes; it is not a PAN or the issuer’s card ID.
pending until the issuer has answered. in_doubt: the issuer may hold a card
(see error_code); do not submit a replacement load with a new reference.
A replay with the original reference returns that uncertain record without reissuing.
Why the card is failed (the issuer’s code, provider_unavailable, or for a chain card
float_insufficient) or in_doubt:
provider_timeout (no answer in time, or an error after the order may have been
taken), provider_unconfirmed (the issuer took the order but did not confirm the card
and its full load) or
activation_pending (the card exists but is not active yet). After activation_pending, a
successful GET /v1/cards/{card_id}/balance turns a POST /v1/cards card issued;
Zwipe confirms a chain card itself. After
provider_unconfirmed the card stays in_doubt and may hold less than amount_cents:
reconcile with Zwipe; current balance can also include other loads and spending. Null otherwise.
Stored amount in cents, which can initially reflect the requested load rather than a confirmed live balance; on a chain card, the first load only. Use GET /v1/cards/{card_id}/balance and its as_of timestamp for display.
What the card issuer returned. Provider-specific and best effort: absent fields mean the issuer did not send them, except in webhook events, which always omit the two links. Treat the links as bearer capabilities and do not log them.
object
The issuer’s own card ID, not the UUID used in Zwipe routes. Several issuance/load records may share it.
Hosted page that adds the card to Apple Wallet. Valid for 72 hours after the underlying card’s first issuance; anyone
holding it can add the card and see its full number, expiry and CVV. Show it only to the
cardholder; never store or log it. A repeat order for an email that already has a card at
that restaurant loads that card and returns no link: wallet_url and collect_url are null.
On cards from POST /v1/cards there is no link-refresh endpoint; chain cards use
POST /v1/cards/{card_id}/wallet-links and always have null links here.
Google Wallet is not supported.
Separate issuer-hosted card collection flow, when available. Not a dedicated card-details iframe or wallet-link refresh. Treat it as sensitive access.
Restaurant this card was issued for, and whose issuer account funded it. Equal to the
restaurant on your account when the request omitted venue. Never null for a card from
POST /v1/cards; null for a chain card, except one brought from a restaurant with
POST /v1/cardholders/{external_id}/card/link, which keeps that restaurant.
A restaurant, by its PizzaBox platform ids.
object
Your customer id, on chain cards only.
Example
{ "card_id": "0192f7a4-5c2e-7d3b-9a1f-4e8b2c6d0a11", "status": "pending", "error_code": null, "balance_cents": 0, "currency": "USD", "external_ref": "ph-order-12345", "created_at": "2026-09-10T12:34:56Z", "venue": { "brand_id": 123, "restaurant_id": 456 }, "issuer": { "card_id": null, "order_id": null, "wallet_url": null, "collect_url": null }}Request does not match this contract (missing field, wrong type, bad format)
object
object
Stable machine-readable code.
Present on validation_error. One entry per violated field.
object
JSON pointer into the request body, or the parameter name.
Example
{ "error": { "code": "validation_error", "message": "Request body invalid: value at `/email` does not match format: email", "details": [ { "pointer": "/email", "message": "value at `/email` does not match format: email" } ] }}Missing, expired or unknown credentials
object
object
Stable machine-readable code.
Present on validation_error. One entry per violated field.
object
JSON pointer into the request body, or the parameter name.
Example
{ "error": { "code": "unauthorized", "message": "A valid Bearer token is required." }}The token lacks cards:issue, the restaurant in venue is not registered to you and
your account does not register its own restaurants, or this is a chain account
(chain_account).
object
object
Stable machine-readable code.
Present on validation_error. One entry per violated field.
object
JSON pointer into the request body, or the parameter name.
Example
{ "error": { "code": "venue_not_registered", "message": "Restaurant 456 of brand 123 is not registered to you." }}Either external_ref was already used with a different email, amount, restaurant or expected issuer card, or
a partner with venues:register tried a restaurant owned by another partner.
Without that scope, an unavailable restaurant returns 403 venue_not_registered.
object
object
Stable machine-readable code.
Present on validation_error. One entry per violated field.
object
JSON pointer into the request body, or the parameter name.
Example
{ "error": { "code": "external_ref_conflict", "message": "external_ref ph-order-12345 was already used with a different email, amount, restaurant or expected issuer card." }}Over the request limit (see Rate limit above). Wait Retry-After seconds.
object
object
Stable machine-readable code.
Present on validation_error. One entry per violated field.
object
JSON pointer into the request body, or the parameter name.
Example
{ "error": { "code": "rate_limited", "message": "Too many requests. Retry after 1 second." }}Headers
Section titled “Headers”Seconds to wait before the next request.

