Skip to main content
A loyalty card shows the customer’s points balance, tier, the other rewards they hold, their customer_id as member ID, and a QR or Code 128 that a POS or kiosk resolves with Masivo. Each customer has at most one card. The customer opens claim_url and adds it to Apple Wallet or Google Wallet with no app install and no login. Dashboard setup (credentials and the loyalty template) is in Wallet pass credentials and Loyalty cards.

Prerequisites

  • SERVER API key and x-account-id
  • An active loyalty template with a main reward
  • Apple and/or Google credentials saved for the platforms you will use
  • A registered customer
All examples use:

1. Issue the card

POST /customers/{id}/loyalty-wallet-passes
Example response:
The call is idempotent. While the card is ISSUED, repeat calls return the same claim_url. After a revoke, the next call creates a new card with a new link. Send claim_url only to that customer (email, SMS, WhatsApp, or an in-app button). It opens that customer’s card. claim_url detects the OS and opens Apple Wallet on iPhone and Google Wallet on Android. Desktop sees both buttons.

2. Read the card

GET /customers/{id}/loyalty-wallet-passes
Returns the same shape as the POST, or 404 when the customer has no card. It never creates one. Use it to decide whether to show an Add to Wallet button. points_balance and tier_id are the values last sent to the phone. For the live balance, read the customer.

3. Use the card at the POS or kiosk

The card QR holds a scan token (msv_lp_...), not the customer_id. It is random, unique per card, and stops working when the card is revoked. Resolve it with Masivo from the POS or kiosk backend, with its SERVER API key.

Identify the customer (earn points)

POST /loyalty-wallet-passes/scan
Returns the same shape as the issue call, with the customer_id. No code is sent. Use it for actions that only add value, like a purchase event. See Send an event.

Confirm the owner (redeem, sign in)

Anyone can photograph a card, so confirm the owner before anything that spends balance or shows account data.
1

Request the code

Call POST /auth/totp with the scanned value as pass_token:
Masivo puts a one-minute code on the customer’s wallet card and does not return it:
While it is valid, the card shows the code in its OTP field (where the card shows ”-” the rest of the time), and the QR itself carries the code. When it expires, Masivo takes it off the card.
2

Get the code

The customer reads the code from the card, or shows the card again and you scan it: a QR of digits only is the code.
3

Verify it

Call GET /auth/totp/verify?code=.... A match returns the customer and their wallet: redeem or start the session.
Apple Wallet usually shows the code within seconds, and the lock screen shows “Tu código es …”. Google Wallet shows it when the customer opens or reopens the card. The push fallback goes to the merchant app through the account Firebase project. It is a transactional message, so it does not need marketing push consent. Its data includes type: "MASIVO_TOTP" and the code, so the app can fill it in.

4. Live updates

Masivo refreshes the card after anything that changes the points balance, another reward balance, or the customer tier:
  • Events that accumulate or redeem points
  • Event reversals and coupon reversals
  • Coupon redeems
  • Tier upgrades and scheduled tier downgrades
Apple Wallet and Google Wallet push the change to the phone. It usually arrives in a few seconds. Points that expire on their own appear on the next refresh. Template edits do not reach cards already on a phone. The customer must remove the card and add it again from claim_url.

5. Revoke

POST /loyalty-wallet-passes/{id}/revoke
The card shows as voided in Apple Wallet and inactive in Google Wallet, and claim_url stops working. Masivo also revokes the card when the customer is deleted or merged into another customer.

Frequently asked questions

No. One card per customer. A second POST returns the existing card.
The template main reward shows next to the tier. Every other reward with a balance in the customer wallet is listed by name, sorted A to Z. Apple Wallet shows the first one next to the customer ID and all of them on the back. Google Wallet shows up to 10 in the card details.
Loyalty cards need a logo or icon on the template. In Demo mode the Gmail on the phone must also be a test account. See Wallet pass credentials.
Wallet updates usually take a few seconds. If the phone is offline, it updates when it reconnects.