API reference
Version 1.0.0 of the integration API. Every page here is generated from the API’s contract, the OpenAPI document integrations-v1.json, so it cannot drift from what the API does.
Base URL: https://api.passkaar.com/integrations/v1
A shop’s own systems — its online store, its outlets’ POS — read the shop’s cards, sign customers up and give or spend loyalty value. Cards are made and edited in the Passkaar portal; an integration only uses them.
Every credential belongs to one connection of one shop. Send it as Authorization: Bearer psk_live_… (or psk_test_… on a test shop). A key works only under /integrations/v1. Every failed check of the key, its connection, the shop or the scope answers the same 401.
Errors are RFC 9457 Problem Details (application/problem+json) with a stable code. Branch on code; treat a code you do not know by its HTTP status, because new codes are an additive change.
Within v1 changes are additive only: new fields, new codes, new events. Ignore what you do not know. Lists take an opaque cursor and a limit of at most 100.
Money in a request is whole rupees. Events are Standard Webhooks, signed, ids and facts only.
Keys and scopes
Section titled “Keys and scopes”A key is made in the Passkaar portal, under Settings → Integrations, by the shop’s owner or an admin, once Passkaar has switched integrations on for the shop. Each key belongs to one connection (your store, or one till system), and the connection holds scopes that say what its keys may do: programs:read, customers:enrol, cards:read, awards:write, awards:reverse, redemptions:write, events:read and webhooks:manage, chosen by the shop, and customers:opening-balance, which only Passkaar switches on. Each operation names the scope it needs.
Keep keys on your server. Never put one in a web page, a mobile app or a public repository: anyone holding it can give and spend on the shop’s cards.
A test shop’s keys start psk_test_ and act only on that test shop’s cards, with lower rate limits. A live shop’s keys start psk_live_.
Retrying safely
Section titled “Retrying safely”Every write takes an Idempotency-Key header: send a fresh UUID with each new request, and the same one when you retry it. A retry within 24 hours answers the first result instead of doing it twice. Awards, redemptions and holds also take your own reference (an order or bill number), which guards a resend for ever.
The interactive reference
Section titled “The interactive reference”The same contract is also shown as one searchable page, with request and answer examples in several languages: the interactive reference. It has no Send request button: a secret key belongs on a server, never in a browser.
Programs
Section titled “Programs”The shop’s cards and branches.
- The shop’s live cards —
GET /programs - A card’s type, rules, rewards and join form —
GET /programs/{id} - The shop’s branches —
GET /branches
Customers
Section titled “Customers”Signing customers up and linking them.
- Sign a customer up —
POST /enrolments - A fresh claim link for a card never in a wallet —
POST /cards/{id}/claim-link - Attach or change the integration’s customer id —
PUT /customers/{id}/external-id - Link a card made at an outlet to a store account —
POST /cards/link
A customer’s card and its history.
- Find a card by serial, card ID, phone, email or external id —
POST /cards/lookup - A card’s balance, rewards, tier, dates, status and whether it is in a wallet —
GET /cards/{id} - A card’s history —
GET /cards/{id}/transactions
Card actions
Section titled “Card actions”Giving, spending, reversing and holding value.
- Give value for a sale —
POST /awards - Refund or void an award, in full or in part —
POST /awards/{reference}/reverse - Spend value now —
POST /redemptions - Reserve value against an online order —
POST /redemption-holds - Spend what a hold reserved —
POST /redemption-holds/{id}/confirm - Free what a hold reserved —
POST /redemption-holds/{id}/release
Events
Section titled “Events”Webhooks and the event feed.
- The event feed —
GET /events - This connection’s webhook endpoints —
GET /webhook-endpoints - Add a webhook endpoint —
POST /webhook-endpoints - A webhook endpoint —
GET /webhook-endpoints/{id} - Change, switch off or switch back on a webhook endpoint —
PATCH /webhook-endpoints/{id} - Remove a webhook endpoint —
DELETE /webhook-endpoints/{id} - Send a webhook.test event to the endpoint —
POST /webhook-endpoints/{id}/test - Roll the endpoint’s signing secret —
POST /webhook-endpoints/{id}/roll-secret
Contract
Section titled “Contract”This document.
- This contract —
GET /openapi.json