Blog / Guides
How live pass updates work
Add points at the till and, moments later, the customer’s pass shows the new balance. Here’s what happens in between, what Apple Wallet and Google Wallet each do with the update, and which parts you control.
Blog / Guides
Add points at the till and, moments later, the customer’s pass shows the new balance. Here’s what happens in between, what Apple Wallet and Google Wallet each do with the update, and which parts you control.
A wallet pass looks like a plastic card, but it behaves more like a small document that Stow Cards can replace. An Apple Wallet pass carries the address of the Stow Cards update service and a private token, so the iPhone knows where to ask for a newer version and Stow Cards knows the request is genuine. A Google Wallet card lives on Google’s servers, where Stow Cards can edit it. Everything below builds on those two facts.
Anything that changes what the pass shows:
Tiers follow the balance. When an adjustment carries a member past a tier’s target, the tier changes in the same step, and the tier-upgrade message goes out instead of the usual one.
Stow Cards writes the new balance in a single database operation. If two staff members add points to the same customer at the same moment, both count, and a balance never drops below zero.
Requests from the scanner app and the API can carry an idempotency key, so a request that is sent again after a dropped connection doesn’t add the points twice.
Before it changes a balance, Stow Cards also notes that the pass needs updating. If the update can’t reach the pass service, a background job tries again, waiting a little longer each time, so a short outage doesn’t leave a customer looking at an old number.
The pass service builds a fresh Apple Wallet pass from the member’s current values and your program’s design. It keeps the same private token, so phones that already hold the pass accept the new version, and it stamps the pass with a new update marker.
This is also where your message is attached. Apple Wallet raises a lock-screen alert only when a field’s value changes, so Stow Cards puts your text, exactly as you wrote it, in a “Latest update” field on the back of the pass. Write “Thanks for visiting! 290 points” and that is what the customer sees; to show the new balance, put {after} in the template.
You change the number once. The pass, the push and the message follow from it.
When a customer adds the pass on an iPhone, the phone registers with Stow Cards for updates. That registration is how the console knows the pass is installed, and it gives Stow Cards a push address for that device.
After a rebuild, Stow Cards sends an empty notification through Apple’s push service to every device registered for the pass. It carries no balance and no personal details; it only tells Wallet to check in. Wallet then asks Stow Cards which of its passes have changed, downloads the new version, swaps it in and shows your message on the lock screen.
If a customer deletes the pass, the phone unregisters and the pushes stop. A customer can also turn off notifications for your pass in Wallet. The pass still updates; they just don’t see the message.
Google Wallet works the other way round. Because the card lives on Google’s servers, Stow Cards edits it directly with the new balance and your message, and Google syncs the card to the customer’s phone.
Google tells Stow Cards when a customer saves the card or removes it, so only saved cards are updated. A customer who chose Apple Wallet, or never tapped the Google Wallet button, doesn’t cause a wasted call or an update entry in the console for a card that isn’t there.
Each member’s page in the console has an activity timeline with a line for every step: the pass updated, the push delivered to each iPhone, the Google Wallet card updated, and each device that installed the pass. You can export the timeline as a CSV file.
If you connect through the API, the points call reports how many iPhones accepted the update push, and the pass.updated webhook fires after each pass update. The developer docs cover both.
Staff change the balance once. Stow Cards rebuilds the pass, nudges every iPhone that holds it, edits the Google Wallet card, and tries again if something is briefly down. Your customer sees the new balance, and your message, on a phone they already carry.
Related
Live updates, lock-screen messages, the till scanner, NFC tap-to-redeem and the console, in one place.
See the featuresA shop owner’s guide: what customers see, why no app is needed, and five steps from design to the till.
Read the guide