Skip to content

Idempotency and retries

external_ref is the idempotency key in the JSON body of POST /v1/cards. There is no separate Idempotency-Key header. It is unique within your partner account, across all restaurants. Chain accounts: see below.

Use a stable identifier such as checkout:store-456:order-1001. Allowed characters are letters, digits, ., _, :, and -, up to 128 characters. Persist the reference and original request before the first call.

Repeated request Result
New reference 202; a new Zwipe record is queued.
Same reference, email, amount, and restaurant Usually 200, the existing record in its current state.
Same reference on a failed record 202; that record is queued for another attempt. Retry deliberately after reviewing the cause.
Same reference on an old pending job that never started May requeue the lost job and return 202.
Same reference on an in_doubt record Existing uncertain record, without another issuer attempt.
Same reference, different email, amount, or restaurant 409 external_ref_conflict.

Names and phone are not part of replay comparison and are not updated by a replay. Email is compared as submitted: keep using the exact normalized value you saved with the order.

  • Lost response for order 1001: reuse order-1001 and its original payload.
  • A separately paid second purchase: use its own reference, such as order-1002.
  • A new reference order-1001-retry to work around a timeout: a new financial order, not a retry.

At the same restaurant, a new reference for an email with an existing active card can load that issuer card again. You receive a new top-level Zwipe card_id; both records can point to the same issuer.card_id and balance. Do not add these balances together.

  1. Retain the original reference, email, amount, and restaurant.
  2. If you saved card_id, retrieve its status.
  3. If no ID was received, replay the exact issuance request to recover the record. Be aware that this retries a record already marked failed.
  4. Stop automatic issuance retries at in_doubt; follow recovery.

There is no lookup endpoint by reference and no card list. Your external_ref → card_id mapping is essential. A closed screen or an HTTP timeout does not prove that no money moved.

One reference space covers issues (POST /v1/cardholders/{external_id}/card) and loads (POST /v1/cards/{card_id}/loads): a reference used by one cannot be used by the other.

Repeated request Result
Issue: same reference, customer id, email and amount 200 with the card, or 202 ordering it again after failed.
Load: same reference, card, amount and reason 200 with the load, or 202 sending it again after failed.
Same reference with another body, or already used by the other operation 409 external_ref_conflict.
A new issue for a customer who already has a card 409 card_exists; load the existing card instead.

Never send a replacement with a new reference for an in_doubt card or load: Zwipe reconciles it and the final webhook follows. Find a lost card_id with GET /v1/cardholders/{external_id}/card.