☰ Menu · Testing
Getting started

Testing

Build with a test key, then check the scenarios below before the first real shift.

Test keys (sk_test_) work against real data of the venue they belong to; there is no separate sandbox database. Ask us for a sandbox venue with a cashback program and a stamps program if you want to test without touching a real account. Everything a test key creates has livemode: false.

Before going live

  • Scan the card of a real phone from both Apple Wallet and Google Wallet with your scanner. Check that GET /v1/members/{scanned value} finds the member.
  • Apply a check below the program's minimum amount: it should earn nothing and not fail.
  • Redeem more than the balance: you should get 402 insufficient_balance and show the guest the available amount.
  • Send the same check twice (same external_id): the second answer must be 200 and the balance must not change.
  • Void a check and confirm the balance returns.
  • Kill the network in the middle of a call, retry, and confirm nothing is applied twice.
  • If you use webhooks, verify the signature with the secret and reject requests older than 5 minutes.

Test cards

Enrol yourself with POST /v1/members and open wallet.apple_url or wallet.google_url on your phone to get a real card. Its barcode is what the venue's guests will show your scanner.

Questions about an integration: api@loyaltyfy.io. We answer within one business day.