Embedded Loyalty
Embedded Loyalty is the connection that puts the loyalty program in front of the Customer. Point balance, tier, challenge progress, available games, redeemable rewards and assigned vouchers are read from Loyal Guru and rendered in your web, app or kiosk — and the actions the Customer takes there, such as playing a game or redeeming a reward, are sent back through the same connection. It runs on the same API as the checkout: same keys, same headers, same versioning.
This guide starts with the decision that shapes the project — build the screens yourself or embed the ready-made ones — and then covers what you can show, how to render Instant Win results, and the two mechanics that need a flow of their own:
| Section | What it covers |
|---|---|
| Challenges | Reading challenge progress for a Customer and rendering it, including the progress bar and the states behind it. |
| Games | Listing the games available to a Customer, executing a play, and handling the prize the play returns. |
| Instant Win | Showing available Instant Win campaigns and the win / No Prize result returned by carts, triggers and custom events. |
| WL App SDK | Embedding the ready-made loyalty screens instead of building them: SDK reference, web and React Native integration, authentication, and the events and errors the container emits. |
Everything shown here is state produced elsewhere: the Customer and catalogue records loaded through Data, and the points, tiers and vouchers the program generates from them.
Two ways to do it
| Loyalty API | Embedded white-label screens | |
|---|---|---|
| What you build | Your own screens, calling our endpoints | A container that loads our screens |
| Where it renders | Your existing UI, natively | A WebView or iframe inside your app |
| Design control | Full | Limited to brand styling |
| Time to launch | Longer — you build every screen | Shorter — screens come ready |
| Fits when | You have design requirements the pre-built screens cannot meet | You want a loyalty section live without a frontend project |
Both options can coexist: some brands embed the ready-made screens for the loyalty section and call the API directly for the points balance shown in the header.
What you can show
| Data | Endpoints |
|---|---|
| Point balance and expiry | GET /customers/{value}/points, GET /customers/{value}/points_expiring |
| Tier | GET /customers/{id}/tiers |
| Challenge progress | GET /customers/{value}/challenges, GET /customers/{value}/challenges/{id} |
| Available games and plays | GET /games, POST /games/{id}/play |
| Available Instant Wins | GET /instant_wins, GET /instant_wins/{id} |
| Reward catalog and redemption | GET /rewards, POST /rewards/{id}/redeem |
| Assigned vouchers and benefits | GET /customers/{id}/vouchers |
Instant Win
Instant Win does not need a play step. The draw runs automatically when the configured event reaches the Streaming API (POST /carts/realtime, POST /trigger, or POST /custom_events), and the result comes back as an instant_win effect in the same response — for a win and for No Prize. The prize (points, Reward, or game participation) is delivered asynchronously after the response.
| Integration step | What to do |
|---|---|
| Show available Instant Wins | Call GET /instant_wins (or GET /instant_wins/{id} for one campaign) with customer_id or customer_code to render the campaigns available to the Customer, including their targeted Instant Wins and remaining_participations. See Instant Win endpoints. |
| Send the event | Send the cart, trigger, or custom event as usual. For a Targeted Instant Win, include the Customer's Voucher code or ["all"] in coupons_desired; otherwise only massive and loyalty promotions are evaluated. |
| Read the result | Find the effect with type: "instant_win" in effects. If it includes prize_name / prize_rule_id, the Customer won that prize; without prize data, the draw returned No Prize; no effect means the Customer did not take part. Do not rely on winned_prize_index alone. Instant Win has no victory/defeat messages, so the app builds the text from the prize data. See How to know if the customer won an Instant Win. |
| Show the prize | Points appear in the wallet, Rewards in the Customer's rewards, and game participations in the Games experience once the asynchronous delivery completes. |