Skip to content

Find the customer’s card

Every guide starts here
export PASSKAAR_API=https://api.passkaar.com/integrations/v1
printf 'Your key: '; read -rs PASSKAAR_KEY; echo; export PASSKAAR_KEY

Passkaar cards carry a QR code, so the scanner must be a 2D one that reads QR codes from a phone screen. A plain USB scanner types what it reads into the box that has the cursor, like a keyboard, and usually presses Enter. The QR code holds only the card’s serial: letters and numbers, 20 or more of them, no link and no name.

Use one box for everything, remove spaces and dashes, and look at what is left:

What is in the box It is Send as card Add (earn) Redeem (spend)
20 or more letters and numbers A scanned card {"serial": "…"} Yes Yes
9 letters and numbers A typed card ID {"card_id": "GB9-564-1YJ"} Yes Yes
Digits starting 03 or +92 A phone number {"phone": "03001234567"} Yes No
Starts with http The shop’s join QR, or another Nothing. Ask for the card. No No

Redeeming needs the card itself, because a phone number is easy to know. Capital or small letters make no difference.

This does the same in the terminal. Type the card ID you noted, or scan your own card with your scanner:

Terminal window
printf 'Scan the card, or type its card ID: '; read -r CODE
CODE=$(printf '%s' "$CODE" | tr -d ' -')
if [ ${#CODE} -ge 20 ]; then CARD="{\"serial\": \"$CODE\"}"; else CARD="{\"card_id\": \"$CODE\"}"; fi
echo "$CARD" | tee card.json
Terminal window
CARD=$(cat card.json)
curl -sS "$PASSKAAR_API/cards/lookup" \
-H "Authorization: Bearer $PASSKAAR_KEY" \
-H "Content-Type: application/json" \
-d "$CARD" | tee lookup.json | jq .
{
"data": [
{
"id": "7ded17c2-4c34-45ff-925f-548564d12560",
"card_id": "GB9-564-1YJ",
"program": {
"id": "259975f9-719a-48c8-8dc9-eb7128114ebf",
"name": "Bean points",
"type": "points"
},
"customer": {
"id": "edb787ec-7ea5-49b8-9b6b-236e492a2819",
"first_name": "Ayesha",
"phone_masked": "+92 300 •••••••",
"email_masked": null,
"external_id": null
},
"status": "active",
"ended_on": null,
"in_wallet": false,
"wallets": [],
"claimable": true,
"issued_at": "2026-11-25T08:46:21.195Z",
"last_activity_at": "2026-11-25T08:46:21.213Z",
"balance": {
"type": "points",
"points": 50,
"unit_name": "beans",
"next_reward": null,
"expiring": null
}
}
]
}

A lookup takes the card’s name as the whole body. The other calls take it under card.

Show the cashier customer.first_name, program.name and the balance. The phone number is always masked. status must be active. Keep id: bad internet uses it.

program.type says which kind it is, and balance has that kind’s fields:

program.type In balance Show, for example
points points, unit_name, next_reward, expiring 295 beans
stamps stamps, stamps_total, rewards_ready 6 of 10 stamps, 1 reward ready
prepaid rupees Rs 1,250
coupon state, uses_left Can be used only when state is available
membership status, plan, paid_through, sessions_left Active until 31 Dec, or 4 sessions left
tiers (VIP) tier, qualifying, next_tier Gold, Rs 8,000 to Platinum

Ignore fields you do not know. New ones are added without notice.

{"phone": "03001234567"} finds the customer when the card is not at hand:

Terminal window
PHONE=$(cat phone.txt)
curl -sS "$PASSKAAR_API/cards/lookup" \
-H "Authorization: Bearer $PASSKAAR_KEY" \
-H "Content-Type: application/json" \
-d "{\"phone\": \"$PHONE\"}" | jq '.data[] | {card_id, program: .program.name, name: .customer.first_name, balance}'
{
"card_id": null,
"program": "Bean points",
"name": "Ayesha",
"balance": {
"type": "points",
"points": 50,
"unit_name": "beans",
"next_reward": null,
"expiring": null
}
}

card_id is null, because a phone number does not prove the card. data lists every card the customer has in this shop. If there is more than one, let the cashier pick, and add the program’s id when you send the sale: {"phone": "03001234567", "program": "259975f9-…"}.

A card that does not exist, or is another shop’s:

Terminal window
curl -sS "$PASSKAAR_API/cards/lookup" \
-H "Authorization: Bearer $PASSKAAR_KEY" \
-H "Content-Type: application/json" \
-d '{"card_id": "GB9-000-000"}' | jq .
{
"type": "https://passkaar.com/developers/errors/not_found",
"title": "Not found",
"status": 404,
"code": "not_found",
"request_id": "6ad81f0bc3c446b3383119a29cde98e6"
}

Read code, never the words. Every error looks like this one.

Answer Tell the cashier
404 not_found No card found. Scan again, or is it another shop’s card?
400 invalid_request That is not a card. Scan the QR on the customer’s loyalty card.
409 ambiguous Several customers share this number. Ask for the card.
status is not active This card cannot be used. Ask the shop’s owner.
The customer has no card Show them the shop’s join QR code. Finish the sale.
The customer lost or changed phone The shop gives the same card again from the Passkaar app or portal. Your till does nothing for this.

Next: add points, stamps or money.