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.
What the shop does
Section titled “What the shop does”- 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.
- 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.
- 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 |
What you change
Section titled “What you change”export PASSKAAR_API=https://api.passkaar.com/integrations/v1printf 'Your key: '; read -rs PASSKAAR_KEY; echo; export PASSKAAR_KEYPaste 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 /programsandGET /brancheswith 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:
curl -sS "$PASSKAAR_API/programs" -H "Authorization: Bearer $PASSKAAR_KEY" | jq '.data[] | {id, name, type}'What is different on a live shop
Section titled “What is different on a live shop”| 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.
What the shop can do to your connection
Section titled “What the shop can do to your connection”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.
Before the first real customer
Section titled “Before the first real customer”- Every write sends the shop’s own
referenceand anIdempotency-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 (
serialorcard_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 theirrequest_idis logged. - The key is on your server only.