Skip to content

From test to live

You built against a test shop with a psk_test_ key. A real shop’s key starts psk_live_, and it goes to the same address and the same calls. Nothing is switched from test to live: the shop’s owner makes a new key for their own shop, and you swap one key for the other.

  1. Passkaar switches integrations on for the shop. It is a per-shop service the owner asks Passkaar for, as they asked for their card types.
  2. The owner adds a connection in the Passkaar portal, under Settings → Integrations → Add a connection: a name for your system (it appears in the shop’s History beside everything you do, like Points given by Till system), the things it may do, and optionally a branch, a largest bill and the addresses your servers call from. Connect your store shows the screen.
  3. The portal shows the key once. The owner copies it and gives it to you.

Tell the owner which of these your system needs, because a call outside them is refused with 401:

What it may do, in the portal Lets you call
See your loyalty cards GET /programs, GET /programs/{id}, GET /branches
Sign customers up POST /enrolments, claim links, external_id, POST /cards/link
Look up customers’ cards POST /cards/lookup, GET /cards/{id}, a card’s history
Give stamps, points and top-ups POST /awards
Let customers spend POST /redemptions, holds
Take back what it gave on a refund POST /awards/{reference}/reverse
Read what happened GET /events
Be told the moment things happen /webhook-endpoints
Every guide starts here
export PASSKAAR_API=https://api.passkaar.com/integrations/v1
printf 'Your key: '; read -rs PASSKAAR_KEY; echo; export PASSKAAR_KEY

Paste the live key this time. Then, because a live shop is a different shop:

  • Read its programs again. Program, card, customer and branch ids from the test shop mean nothing in the live one: GET /programs and GET /branches with the live key.
  • Register your webhook endpoint again. Endpoints belong to the key’s connection, so the live connection has none until you add one, with a new secret.
  • Keep the test key for testing. A test shop stays yours; keep building against it, never against a real shop’s customers.
  • Store the live key as a secret on your server only, never in your code repository.

Then make one read to see the key works:

Terminal window
curl -sS "$PASSKAAR_API/programs" -H "Authorization: Bearer $PASSKAAR_KEY" | jq '.data[] | {id, name, type}'
Test shop Live shop
Customers Made up by you; at most 100 The shop’s real customers, up to its plan
Sign-ups At most 20 an hour The shop’s plan, and a limit per hour on each connection
Largest bill Rs 100,000 Rs 50,000 on a new connection, changed by the owner
Rate limit, per key 2 requests a second, bursts of 5 10 requests a second, bursts of 20
Billing Nothing is counted Each new award or spend counts toward the shop’s plan; reads, retries and refunds do not

A bill above the largest bill answers bill_too_large and the owner is told. Every limit answers 429 rate_limited with a Retry-After header, in seconds.

The owner can pause the connection (every call answers 401 until they resume it), stop a key and make a new one, or remove the connection, which stops all its keys for good and sends your endpoint a connection.revoked event. Passkaar can pause a connection too. Whatever happens to your connection, cards already on customers’ phones keep working, and the shop’s counter carries on.

If awards from your connection suddenly jump, the owner is told, and can choose to have the connection pause itself when that happens. Agree with the owner what a normal day looks like.

  • Every write sends the shop’s own reference and an Idempotency-Key, and a timeout is retried with the same key.
  • Orders are recorded when they are paid, and refunds reverse them with their own refund_reference.
  • Spending names the card (serial or card_id) or a store account your connection signed up or linked.
  • Your receiver checks every webhook’s signature on the raw body and answers within 15 seconds.
  • Errors are handled by code, as Handling errors shows, and their request_id is logged.
  • The key is on your server only.