Skip to content

Issue the customer's card with its first load

POST
/v1/cardholders/{external_id}/card
curl --request POST \
--url https://api.zwipe.co/v1/cardholders/example/card \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "first_name": "Jane", "last_name": "Doe", "email": "jane@example.com", "phone": "+15551234567", "amount_cents": 5000, "currency": "USD", "external_ref": "ph-pay-55102", "location_id": "dallas-0042" }'

Chain accounts only; requires cards:issue. One card per customer for your whole account, loaded from your account’s float. Asynchronous like POST /v1/cards: 202 with status: pending, then GET /v1/cards/{card_id} or a card.* webhook, with the same final states (issued, failed, in_doubt).

external_ref works as on POST /v1/cards: the same reference with the same customer id, email and amount returns the card (200), or orders it again after failed (202); names, phone and location_id are not compared. The same reference with another customer id, email or amount, or one already used by a load, is 409 external_ref_conflict. References are unique across your account, issues and loads alike.

A customer whose card is pending, issued or in_doubt already has one: another issue, including a replay of a failed reference, is 409 card_exists; top it up with POST /v1/cards/{card_id}/loads. A failed card does not count. An email that already belongs to another of your customers is 409 cardholder_email_conflict: one issuer card never serves two customers.

A chain card’s issuer.wallet_url and issuer.collect_url are always null: the card number is reachable only through POST /v1/cards/{card_id}/wallet-links. Zwipe confirms a card’s activation itself, so a chain card never waits for a balance read to turn issued. A chain card left in_doubt is reconciled by Zwipe and ends issued or failed, with its card.* event; until then the customer cannot get a second card.

external_id
required
string
>= 1 characters <= 128 characters /^[A-Za-z0-9_:-]+$/

Your own id for the customer, unique across your account. Letters, digits, _, : and -; no dots.

Media typeapplication/json
object
first_name
required
string
>= 1 characters <= 100 characters
last_name
required
string
>= 1 characters <= 100 characters
email
required
string format: email
<= 254 characters
phone
required

Mobile in E.164, e.g. +15551234567. Required by the issuer.

string
/^\+[1-9][0-9]{6,14}$/
amount_cents
required

First load in integer cents. $1.00 to $1,000.00 during the pilot.

integer
>= 100 <= 100000
currency
required
string
Allowed values: USD
external_ref
required

Your persisted reference for this payment or payout, unique across your account (issues and loads alike). Reuse it with the original body for recovery; a new reference is a new order.

string
>= 1 characters <= 128 characters /^[A-Za-z0-9._:-]+$/
location_id

Your own id for the store, for reporting. Free text; it does not change which float pays.

string
>= 1 characters <= 64 characters

Example

{
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"phone": "+15551234567",
"amount_cents": 5000,
"currency": "USD",
"external_ref": "ph-pay-55102",
"location_id": "dallas-0042"
}

Same external_ref and body seen before; the card in its current state

Media typeapplication/json
object
card_id
required

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.

string format: uuid
status
required

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.

string
Allowed values: pending issued failed in_doubt
error_code
required

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.

string | null
balance_cents
required

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.

integer
currency
required
string
Allowed values: USD
external_ref
required
string
created_at
required
string format: date-time
issuer
required

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
card_id

The issuer’s own card ID, not the UUID used in Zwipe routes. Several issuance/load records may share it.

string | null
order_id
integer | null
wallet_url

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.

string | null
collect_url

Separate issuer-hosted card collection flow, when available. Not a dedicated card-details iframe or wallet-link refresh. Treat it as sensitive access.

string | null
venue
required

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.

One of:

A restaurant, by its PizzaBox platform ids.

object
brand_id
required
integer
>= 1
restaurant_id
required
integer
>= 1
cardholder_external_id

Your customer id, on chain cards only.

string | null

Example

{
"card_id": "0192f7a4-5c2e-7d3b-9a1f-4e8b2c6d0a11",
"status": "issued",
"error_code": null,
"balance_cents": 5000,
"currency": "USD",
"external_ref": "ph-pay-55102",
"created_at": "2026-11-02T15:05:00Z",
"venue": null,
"cardholder_external_id": "ph-customer-88231",
"issuer": {
"card_id": "7801234",
"order_id": 4317,
"wallet_url": null,
"collect_url": null
}
}

Card ordered; the issuer is being called. Poll GET /v1/cards/{card_id}.

Media typeapplication/json
object
card_id
required

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.

string format: uuid
status
required

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.

string
Allowed values: pending issued failed in_doubt
error_code
required

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.

string | null
balance_cents
required

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.

integer
currency
required
string
Allowed values: USD
external_ref
required
string
created_at
required
string format: date-time
issuer
required

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
card_id

The issuer’s own card ID, not the UUID used in Zwipe routes. Several issuance/load records may share it.

string | null
order_id
integer | null
wallet_url

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.

string | null
collect_url

Separate issuer-hosted card collection flow, when available. Not a dedicated card-details iframe or wallet-link refresh. Treat it as sensitive access.

string | null
venue
required

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.

One of:

A restaurant, by its PizzaBox platform ids.

object
brand_id
required
integer
>= 1
restaurant_id
required
integer
>= 1
cardholder_external_id

Your customer id, on chain cards only.

string | null

Example

{
"card_id": "0192f7a4-5c2e-7d3b-9a1f-4e8b2c6d0a11",
"status": "pending",
"error_code": null,
"balance_cents": 0,
"currency": "USD",
"external_ref": "ph-pay-55102",
"created_at": "2026-11-02T15:05:00Z",
"venue": null,
"cardholder_external_id": "ph-customer-88231",
"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)

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable code.

string
Allowed values: validation_error invalid_client unauthorized insufficient_scope not_found method_not_allowed unsupported_media_type external_ref_conflict card_exists card_not_active cardholder_email_conflict no_existing_card chain_only chain_account venue_claimed venue_not_registered venue_required provider_error provider_unavailable provider_timeout issuance_in_doubt restart_unavailable rate_limited internal_error
message
required
string
details

Present on validation_error. One entry per violated field.

Array<object>
object
pointer
required

JSON pointer into the request body, or the parameter name.

string
message
required
string

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

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable code.

string
Allowed values: validation_error invalid_client unauthorized insufficient_scope not_found method_not_allowed unsupported_media_type external_ref_conflict card_exists card_not_active cardholder_email_conflict no_existing_card chain_only chain_account venue_claimed venue_not_registered venue_required provider_error provider_unavailable provider_timeout issuance_in_doubt restart_unavailable rate_limited internal_error
message
required
string
details

Present on validation_error. One entry per violated field.

Array<object>
object
pointer
required

JSON pointer into the request body, or the parameter name.

string
message
required
string

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).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable code.

string
Allowed values: validation_error invalid_client unauthorized insufficient_scope not_found method_not_allowed unsupported_media_type external_ref_conflict card_exists card_not_active cardholder_email_conflict no_existing_card chain_only chain_account venue_claimed venue_not_registered venue_required provider_error provider_unavailable provider_timeout issuance_in_doubt restart_unavailable rate_limited internal_error
message
required
string
details

Present on validation_error. One entry per violated field.

Array<object>
object
pointer
required

JSON pointer into the request body, or the parameter name.

string
message
required
string

Example

{
"error": {
"code": "chain_only",
"message": "This endpoint is for chain accounts and their cards."
}
}

card_exists: the customer already has a card. cardholder_email_conflict: the email belongs to another of your customers. external_ref_conflict: the reference was used with another customer id, email or amount.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable code.

string
Allowed values: validation_error invalid_client unauthorized insufficient_scope not_found method_not_allowed unsupported_media_type external_ref_conflict card_exists card_not_active cardholder_email_conflict no_existing_card chain_only chain_account venue_claimed venue_not_registered venue_required provider_error provider_unavailable provider_timeout issuance_in_doubt restart_unavailable rate_limited internal_error
message
required
string
details

Present on validation_error. One entry per violated field.

Array<object>
object
pointer
required

JSON pointer into the request body, or the parameter name.

string
message
required
string

Example

{
"error": {
"code": "card_exists",
"message": "Customer ph-customer-88231 already has card 0192f7a4-5c2e-7d3b-9a1f-4e8b2c6d0a11."
}
}

Over the request limit (see Rate limit above). Wait Retry-After seconds.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable code.

string
Allowed values: validation_error invalid_client unauthorized insufficient_scope not_found method_not_allowed unsupported_media_type external_ref_conflict card_exists card_not_active cardholder_email_conflict no_existing_card chain_only chain_account venue_claimed venue_not_registered venue_required provider_error provider_unavailable provider_timeout issuance_in_doubt restart_unavailable rate_limited internal_error
message
required
string
details

Present on validation_error. One entry per violated field.

Array<object>
object
pointer
required

JSON pointer into the request body, or the parameter name.

string
message
required
string

Example

{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after 1 second."
}
}
Retry-After
integer
>= 1

Seconds to wait before the next request.