Skip to content

Link a card made at an outlet to a store account

POST /cards/link

By the card ID printed on the card and the phone or email it was made with. The card is then proved to external_id, which may spend it (POST /redemptions, POST /redemption-holds); an id the customer already held from this connection is replaced and keeps no other proof. A mismatch answers 404, the same as a card that does not exist. Linking again answers the same.

Scope: customers:enrol. The key’s connection must hold it; see the reference’s introduction.

Replace the CAPITALS, and set PASSKAAR_KEY to a key from the portal.

Terminal window
curl -X POST "https://api.passkaar.com/integrations/v1/cards/link" \
-H "Authorization: Bearer $PASSKAAR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"card_id": "CARD_ID",
"phone": "03001234567",
"external_id": "store-customer-1"
}'
Name In Type Required What it is
Idempotency-Key header string Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. reference is what guards a resend after that.

object

Linked.

Field Type Required What it is
card object (CardIds) yes The card’s id and, where shown, its printed card ID.
card.id string (uuid) yes
card.card_id string or null yes The printed card ID, only when the call named the card by serial or card_id, the call made the card (a created sign-up), or this connection’s external_id was linked with the card. Null when the card was found by phone, email or an unproven link.
customer object (CustomerIds) yes This connection’s external_id, if it set one.
customer.id string (uuid) yes
customer.external_id string or null yes

Every error is a Problem Details answer with a stable code.

Status Code
400 invalid_request
401 unauthorized
403 shop_locked
404 not_found
409 request_in_progress
409 external_id_taken
422 idempotency_key_reused
429 rate_limited
500 internal_error
503 unavailable