Bring the card the customer already holds
const url = 'https://api.zwipe.co/v1/cardholders/example/card/link';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"jane@example.com"}'};
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/cardholders/example/card/link \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "jane@example.com" }'Chain accounts only; requires cards:issue. Finds the card the customer already holds at
the restaurant Zwipe set up on your account for this (bought on zwipe.co or in the PizzaPass
app) and makes it the customer’s card, so you don’t sell them a second one. Call it only
after the customer proved the email is theirs, for example with a code sent to it: the card
then answers to you, details included.
200 with the card, issued and with that restaurant as its venue, its balance read
from the issuer (balance_cents; if that read failed, read GET /v1/cards/{card_id}/balance).
Loads, balance, transactions, wallet links and details work on it; its loads are funded by
that restaurant’s issuer account. Its purchases do not send transaction.created webhooks
yet: read them with GET /v1/cards/{card_id}/transactions. A customer who already has a card keeps it:
the same 200 with that card, nothing looked up. 404 no_existing_card when the customer
holds no activated card there, or your account has no such restaurant. 409 cardholder_email_conflict when the email or that card already belongs to another of your
customers.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Your own id for the customer, unique across your account. Letters, digits, _, : and -; no dots.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "email": "jane@example.com"}Responses
Section titled “Responses”The customer’s card
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-4e8b2c6d0a12", "status": "issued", "error_code": null, "balance_cents": 0, "currency": "USD", "external_ref": "zwipe-linked-7793338", "created_at": "2026-12-02T15:05:00Z", "venue": { "brand_id": 19601, "restaurant_id": 18172 }, "cardholder_external_id": "ph-customer-88231", "issuer": { "card_id": "7793338", "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 the endpoint’s scope (insufficient_scope), or this is a chain endpoint and
the account or card is not a chain one (chain_only).
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": "chain_only", "message": "This endpoint is for chain accounts and their cards." }}no_existing_card: the customer holds no card to bring.
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": "no_existing_card", "message": "The customer holds no card to bring with them." }}cardholder_email_conflict: the email or the card belongs to another of your customers.
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": "cardholder_email_conflict", "message": "This email belongs to another of your customers." }}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.
The issuer failed or did not answer in time. Retry reads with bounded backoff. For uncertain writes, preserve the original reference and inspect the saved order before any deliberate retry; never create a new reference to bypass uncertainty.
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.
Examples
Issuer unreachable or timed out
{ "error": { "code": "provider_unavailable", "message": "The card issuer did not respond." }}Issuer answered with an error
{ "error": { "code": "provider_error", "message": "The card issuer rejected the request (code 1203)." }}
