Skip to main content
Start with one tested stamp request and webhook receipt before building a complete POS adapter. This walkthrough models the customer and cashier journey as well as the API calls behind it. It uses the marketplace endpoints because one request can resolve the customer, select the programme, find or create the enrolment, and post loyalty safely.

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

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

Persist the returned organisation ID, currency, timezone, key mode, and card choices. If 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.
A credential belongs to one Perkstar organisation. If the response names a different business from the one your installation expects, stop setup rather than writing to it.

Step 2: map stores and programmes

Use GET /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.
Map this opaque ID from an earlier Perkstar API or Zapier step. It is scoped to the connected business. An unknown ID returns 404 and never creates a replacement customer from the ID alone.
Resolution order is customer_id, card_serial, first-party provider identity, external_ref, email, then phone. The first match wins.

Step 4: add loyalty

Send type: "STAMP" and the number of stamps in delta. Most integrations send 1 after an eligible completed sale or visit.
Two safety keys protect the operation:
  • Idempotency-Key replays the same HTTP result during the request-cache window; and
  • external_transaction_id permanently prevents the same POS sale from earning twice.
Use both and choose a namespace owned by your integration, such as 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.
Loyalty was applied for the first time. Store the returned transaction ID beside the POS order/payment reference.
The permanent external reference already existed. Treat this as a safe replay, not a second award.
Test credentials cannot create a live customer or enrolment. Select an existing testable customer and card, then retry.
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.
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

Reversal writes a compensating transaction linked to the original. Replaying a refund returns the existing reversal. Do not create an unrelated negative award: it loses the original-sale link and weakens reconciliation.

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.
  1. Subscribe to transaction.created, customer.enrolled, reward.redeemed, and tier.changed as relevant.
  2. Verify and persist each event before acknowledging it.
  3. At least daily, compare recent POS references with Perkstar transactions.
  4. Repair missing writes using the same stable IDs.
  5. Alert on a queue that is old, repeatedly failing, or growing unexpectedly.
See the webhook catalogue for exact payloads.

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.