Skip to main content
Webhooks notify your server when loyalty activity changes. Use them for fast updates, then run periodic reconciliation so one delayed delivery cannot leave systems permanently out of sync.

Create an endpoint

Create webhook configuration with a narrowly scoped live key or in the dashboard. The plaintext signing secret is returned once.
Store the returned secret in the receiving service’s secret manager before the response is discarded. Common event names include:
  • customer.enrolled, customer.unenrolled, customer.anonymized
  • transaction.created, reward.redeemed, coupon.redeemed, tier.changed
  • membership.purchased, membership.renewed, membership.cancelled
  • booking.created, booking.attended, booking.no_show, booking.cancelled
  • webhook.test

Verify before parsing

Perkstar sends a Stripe-style signature:
The signed value is <timestamp>.<raw request body>. Verify the raw bytes and a five-minute timestamp tolerance before trusting or parsing the JSON.
Reading JSON first and serialising it again changes the signed bytes. Capture the raw body before any framework body parser runs.

Processing rules

  1. Verify the signature and timestamp.
  2. Deduplicate by event ID in your database.
  3. Persist or enqueue the event before returning 2xx.
  4. Process asynchronously when work could exceed a few seconds.
  5. Make handlers safe when events arrive twice or out of order.
  6. Branch test traffic using testMode: true.
Return a non-2xx status only when a retry may help. Validation failures should be recorded for operator review rather than retried forever.

Reconciliation

At least daily, compare the external system with recent Perkstar transactions or customers. Webhooks provide speed, while reconciliation catches exhausted retries, downtime, and deployment mistakes.