Skip to main content

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:

SectionWhat it covers
ChallengesReading challenge progress for a Customer and rendering it, including the progress bar and the states behind it.
GamesListing the games available to a Customer, executing a play, and handling the prize the play returns.
Instant WinShowing available Instant Win campaigns and the win / No Prize result returned by carts, triggers and custom events.
WL App SDKEmbedding 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 APIEmbedded white-label screens
What you buildYour own screens, calling our endpointsA container that loads our screens
Where it rendersYour existing UI, nativelyA WebView or iframe inside your app
Design controlFullLimited to brand styling
Time to launchLonger — you build every screenShorter — screens come ready
Fits whenYou have design requirements the pre-built screens cannot meetYou 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​

DataEndpoints
Point balance and expiryGET /customers/{value}/points, GET /customers/{value}/points_expiring
TierGET /customers/{id}/tiers
Challenge progressGET /customers/{value}/challenges, GET /customers/{value}/challenges/{id}
Available games and playsGET /games, POST /games/{id}/play
Available Instant WinsGET /instant_wins, GET /instant_wins/{id}
Reward catalog and redemptionGET /rewards, POST /rewards/{id}/redeem
Assigned vouchers and benefitsGET /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 stepWhat to do
Show available Instant WinsCall 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 eventSend 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 resultFind 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 prizePoints appear in the wallet, Rewards in the Customer's rewards, and game participations in the Games experience once the asynchronous delivery completes.