Point of sale (POS)
Passkaar runs loyalty cards for shops in Pakistan. The customer keeps the card on their phone, in Apple Wallet or Google Wallet. Your till finds the card, adds what the bill earned, takes off what the customer redeems, and takes it back on a refund. Passkaar applies the shop’s rules, keeps the balance and updates the card on the phone.
These six pages are the whole job for a till. You do not need the other guides. Read them in order; the commands follow one customer, Ayesha, from her first scan to a refund.
The four calls
Section titled “The four calls”| At the counter | Your server calls | Page |
|---|---|---|
| The cashier scans the card | POST /cards/lookup |
Find the customer’s card |
| The sale is paid | POST /awards |
Add points, stamps or money |
| The customer uses their balance | POST /redemptions |
Redeem |
| A bill is returned or voided | POST /awards/{reference}/reverse |
Refunds and mistakes |
Every call is JSON over HTTPS and is answered straight away, so the cashier sees the result. The last page, bad internet and going live, makes them safe to retry.
| You need | You can skip |
|---|---|
| A key, kept on your server | Webhooks and events. Each call’s own answer tells the till all it needs. |
| A scanner that reads QR codes, or a box to type the card ID | Holds. They are for online checkouts, where the money comes later. |
| Your own invoice number on every call | Claim links and sign-up (optional). Customers join from the shop’s own QR code. |
| Amounts in whole rupees | The store plugins. They are for WooCommerce and Shopify. |
| A saved queue, so a sale made without internet is sent later on | The TypeScript library. Any language that can send an HTTPS request will do. |
What your cashier sees
Section titled “What your cashier sees”-
The cashier starts a bill and asks for the loyalty card. The customer opens it on their phone, and the cashier scans its QR code or types the card ID printed under it.
-
The till shows the name and balance: Ayesha, 295 beans. (This shop calls its points beans.)
-
The bill is Rs 1,200 and Ayesha wants to use 100 beans. The cashier presses Redeem. The till takes Rs 100 off, and Ayesha pays Rs 1,100.
-
The till records the sale and prints what it earned:
INV-1042 Rs 1,200Loyalty discount (100 beans) -Rs 100Paid Rs 1,100Earned 110 beans. Balance 305 beans. -
The card on Ayesha’s phone changes by itself.
-
If she brings something back, the cashier opens invoice
INV-1042and refunds it as usual. The till takes back what that part earned.
No card, or no internet? The sale goes on as normal. Loyalty must never stop a sale.
Get a key
Section titled “Get a key”To build, write to support@passkaar.com with your company’s name,
and say it is for a POS and which kinds of card the shop uses. You get a test shop and its
psk_test_ key. Nothing in it is real or billed.
To go live, the shop needs Passkaar’s Growth or Chain plan, with integrations switched on by
Passkaar; there is no charge per call. Its owner makes the key in the Passkaar portal, under Settings →
Integrations → Add a connection, and gives it to you. It starts psk_live_. Tell them to fill it
in like this:
| In the portal | For a till |
|---|---|
| Name | Your POS’s name. The shop’s History shows it beside everything the till does. |
| What it may do: tick these | See your loyalty cards (programs:read) |
Look up customers’ cards (cards:read) |
|
Give stamps, points and top-ups (awards:write) |
|
Let customers spend (redemptions:write) |
|
Take back what it gave on a refund (awards:reverse) |
|
| Where | The branch, if this key is for one branch. Otherwise Any branch, and online. |
| Largest bill | Above the shop’s biggest real bill. A bigger one is refused. A new connection starts at Rs 50,000. |
| Points and VIP cards earn on | The full bill, or the bill before tax. The second works only if you send the tax. |
| Only from these addresses | Your server’s fixed internet address, if it has one. Otherwise leave it empty. |
Leave the other ticks off. A call the key is not ticked for answers 401.
The key stays on your server
Section titled “The key stays on your server”The till’s screen talks to your server, and your server talks to Passkaar. Never put the key in the till’s browser, in an app on a tablet or phone, or in a program installed on each counter. Anyone who has it can add and redeem on the shop’s cards. If your POS has no server, put a small one of your own in between.
One key per till or branch
Section titled “One key per till or branch”A shop can have several connections, and a connection can have several keys. Give each branch’s server, or each till’s, its own key, so one can be stopped without stopping the rest. How you number invoices decides how to split them:
| Your invoice numbers | Ask the owner for |
|---|---|
| Never repeat anywhere in the shop | One connection for the POS, with a key for each branch (Add a key), and send branch with each sale. Any branch can refund any branch’s sale. |
| Start again in each branch, or on each till | The same, and add the branch or till code: send GUL-1042 and DHA-1042, not 1042 twice. |
| Start again, and you cannot change the number | One connection per branch. A sale can then be refunded only through the connection that recorded it. |
Try it
Section titled “Try it”You need curl and jq (brew install jq on a Mac, sudo apt install jq
on Ubuntu). Every page’s commands run as written against a test shop, in the same folder, in order.
export PASSKAAR_API=https://api.passkaar.com/integrations/v1printf 'Your key: '; read -rs PASSKAAR_KEY; echo; export PASSKAAR_KEYThe shop’s cards. The API calls a card’s design and rules a program; each customer has their own card on it:
curl -sS "$PASSKAAR_API/programs" \ -H "Authorization: Bearer $PASSKAAR_KEY" | tee programs.json | jq .{ "data": [ { "id": "259975f9-719a-48c8-8dc9-eb7128114ebf", "name": "Bean points", "type": "points", "accepting_sign_ups": true, "join_url": "https://passkaar.com/j/test-overnight-walk-2026-11-22-beans-mwr3ag67", "ends_on": null, "updated_at": "2026-11-22T00:19:20.330Z" } ], "next_cursor": null}join_url is how customers get the card. The shop prints it as a QR code, and you may print the same
QR on the receipt or show it on the customer’s display. That is all the sign-up a till needs.
The rules say how the card earns and what can be redeemed. Read them when your POS starts and once a day, and keep them:
PROGRAM=$(jq -r '.data[0].id' programs.json)curl -sS "$PASSKAAR_API/programs/$PROGRAM" \ -H "Authorization: Bearer $PASSKAAR_KEY" | jq .rules{ "type": "points", "unit_name": "beans", "earn": { "points": 1, "per_rupees": 10, "min_bill": null }, "daily_cap": null, "spend": { "mode": "cash", "rupees_per_point": 1, "min_points": 10 }}1 bean for every Rs 10 of the bill, and each bean takes Rs 1 off, 10 beans at a time or more. unit_name is
the shop’s word for its points: use it on your screens.
A test customer
Section titled “A test customer”Open the join_url on your own phone, fill in the form and add the card. That gives you a card to
scan with your real scanner. To go on without a phone, make a customer with one call. A test key may
do this; your till will not need it:
PHONE=0300$(date +%s | tail -c 8)curl -sS "$PASSKAAR_API/enrolments" \ -H "Authorization: Bearer $PASSKAAR_KEY" \ -H "Content-Type: application/json" \ -d "{\"program\": \"$PROGRAM\", \"answers\": {\"first_name\": \"Ayesha\", \"phone\": \"$PHONE\"}}" \ | tee enrolment.json | jq .cardecho "$PHONE" > phone.txt{ "id": "7ded17c2-4c34-45ff-925f-548564d12560", "card_id": "GB9-564-1YJ", "in_wallet": false, "claimable": true}card_id is the card ID printed under the QR code. Note it down for the next page.
Next: find the customer’s card.