1. Connect
Confirm the business and choose the exact card and location.
2. Transact
Scan or match the customer, then accrue loyalty with durable IDs.
3. Recover
Reverse refunds, retry timeouts, and reconcile missed events.
Choose the installation model
- One business
- Marketplace app
- Development
Create a dedicated API key in that business’s dashboard. This is the
simplest model for an in-house connector, one Odoo database, or one POS
merchant.Grant
MARKETPLACE, plus LOCATIONS_READ when the integration maps stores.
Add separate read scopes only for reconciliation jobs that need them.The till journey
Step 1: confirm the installation
default_card_id is null, the business has more than one active
card. Ask the operator to map each till programme or location to a specific
card_id; never select the first result silently.
Step 2: map stores and programmes
UseGET /locations with LOCATIONS_READ to resolve Perkstar location IDs.
Store a mapping instead of comparing display names.
Step 3: identify the customer
Perkstar resolves identifiers in a fixed priority. Send only identifiers that belong to the same person.- Perkstar Customer ID
- Wallet scan
- POS customer ID
- Email or phone
404 and never
creates a replacement customer from the ID alone.customer_id, card_serial, first-party provider
identity, external_ref, email, then phone. The first match wins.
Step 4: add loyalty
- Stamp card
- Points from spend
- Manual adjustment
Send
type: "STAMP" and the number of stamps in delta. Most integrations
send 1 after an eligible completed sale or visit.Idempotency-Keyreplays the same HTTP result during the request-cache window; andexternal_transaction_idpermanently prevents the same POS sale from earning twice.
odoo:<company>:order:<id>. Provider-managed prefixes such as sq_payment_
are reserved and return 400 reserved_external_transaction_id. A timeout does
not prove the write failed.
Step 5: update the till
Use the returned customer, enrolment, balance, and transaction to show a short, stable result without making another request.201 Created
201 Created
Loyalty was applied for the first time. Store the returned transaction ID
beside the POS order/payment reference.
200 Existing transaction
200 Existing transaction
The permanent external reference already existed. Treat this as a safe
replay, not a second award.
404 Not found in test mode
404 Not found in test mode
Test credentials cannot create a live customer or enrolment. Select an
existing testable customer and card, then retry.
409 or 422 conflict
409 or 422 conflict
The supplied identity or external transaction conflicts with an existing
record or environment. Stop and surface a staff-review state; do not invent
another identifier.
429 or 5xx
429 or 5xx
Honour
Retry-After for 429. Retry transient failures with backoff and
the same idempotency and external transaction IDs.Step 6: reverse a refund or void
Step 7: work through outages
An offline queue should retain the original merchant, card, location, customer identifier, transaction reference, idempotency key, amount, and occurrence time. Encrypt local data, bound retention, and make failed entries visible to staff.Step 8: reconcile
Webhooks provide fast updates; scheduled reads prove eventual consistency.- Subscribe to
transaction.created,customer.enrolled,reward.redeemed, andtier.changedas relevant. - Verify and persist each event before acknowledging it.
- At least daily, compare recent POS references with Perkstar transactions.
- Repair missing writes using the same stable IDs.
- Alert on a queue that is old, repeatedly failing, or growing unexpectedly.
Go-live proof
- Installation identifies the expected organisation.
- Every store and loyalty programme is mapped explicitly.
- Old and current wallet barcode formats resolve unchanged.
- Replaying a sale never awards twice.
- A timeout followed by retry converges on one transaction.
- Full refund creates one linked reversal.
- Test traffic cannot change a live customer balance.
- Offline work survives restart and has a visible failure state.
- Webhook signatures and event deduplication are tested.
- Reconciliation finds and repairs a deliberately skipped event.

