For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fortune Wheels & Lotteries

Spins and prize draws: members buying a spin, campaigns awarding spins that still need drawing, pay-to-enter prize draws from the catalogue, detecting a win, and fulfilling prizes.

A fortune wheel is a reward whose outcome is drawn: the member gets a spin, Open Loyalty draws a result by probability, and a win issues units, a coupon or a prize. The same mechanism powers lotteries — "scan a code for a chance to win", "spend 100 points to enter the draw for a bag".

For the basic flow — a member buying and spinning a wheel — follow the User Guide's fortune wheel implementation checklist (buy → draw → fetch the result). This page adds the patterns around it: spins awarded by campaigns, pay-to-enter prize draws, detecting a win and fulfilling prizes. See also How probability works.

Who does what

Area
Responsibility

Admin Panel

Wheels with prizes and probabilities, costs, limits; campaigns that give spins; prize rewards and their stock

Integration layer

Buys spins and entries, finds undrawn spins, draws them, interprets the result

Website / app

The wheel or draw animation and the win or "try again" screens

Fulfilment / CRM

Ships physical prizes; tells winners

Design decisions

Decision
Options
Recommendation

How members get spins

Buy with units, or awarded by campaigns

Both work with the same wheel. Awarded spins need an extra step: they're issued undrawn and must be drawn.

When to draw an awarded spin

Immediately in the integration, or when the member opens the wheel

When the member opens it, if the animation is part of the fun; immediately (server-side) if the member never sees a wheel.

Units won at random

Fixed amounts, or a wheel with several amounts

A wheel with amounts and probabilities — the campaign effect gives a spin instead of units.

Catalogue prizes as draws

Direct purchase, or "enter the draw"

For scarce prizes, a pay-to-enter wheel per prize: each entry costs units, a win issues the prize reward. Link the prize to its wheel with a label (e.g. draw_reward_id) so the catalogue can show the prize and buy the entry.

Limits

None, per member, per period, prize stock

Set reward limits on high-value prizes — a spin can't win a prize that's out of stock or over its limit.

1

Configure (Admin Panel)

Create the wheel with its prizes and probabilities, and the prize rewards themselves (with stock). For awarded spins, add a campaign or challenge effect that gives the wheel. Keep wheels out of the regular catalogue with type[notIn]=fortune_wheel where needed.

2

Buy a spin or an entry

POST /api/{storeCode}/reward/{reward}/buy with the member's customerId, quantity = 1. Units are spent and an issued reward (issuedRewardId) is returned, not yet drawn.

3

Find awarded spins

Spins given by campaigns appear as undrawn redemptions: GET /api/{storeCode}/redemption?customerData:loyaltyCardNumber={id}&rewardType=fortune_wheel&fortuneWheelStatus:drawnAt[notHasValue]&_orderBy[redemptionDate]=asc.

4

Draw — once

POST /api/{storeCode}/redemption/{issuedRewardId}/draw. Each issued spin can be drawn only once. On 409 or 503, retry the same issuedRewardId with backoff — never buy a new spin to replace it.

5

Read the result

The response's fortuneWheelStatus.effects[] lists what was given. A win is an effect with status.code = "success" — don't decide by the rule name. A won prize is issued like any reward: physical prizes as pending redemptions for fulfilment, vouchers with the next code.

6

Fulfil prizes

Ship physical prizes as in Rewards & coupons — from the CustomerBoughtReward webhook, or in batches with a rewardFulfillment export — and update their status.

Sequence diagram

Spin awarded by a campaign: member activity triggers a campaign effect that gives an undrawn spin; when the member opens their spins, the integration layer lists undrawn fortune wheel redemptions; when the member spins, it draws one and reads effects status codes — a win is an effect with status code success, not the rule name. Prize draw from the catalogue: the member enters the draw; the integration layer buys the lottery reward with customerId and quantity 1, units are spent, and the returned issued reward is drawn; a win issues the prize, physical as pending for fulfilment or a voucher with the next code. On 409 or 503 the draw is retried with the same issuedRewardId, never by buying a new entry.
Awarded spins and catalogue prize draws

Go-live checklist

Admin Panel

Integration layer

Website / app

Validation

Key endpoints

Webhooks: CustomerBoughtReward, CampaignEffectWasApplied

Last updated

Was this helpful?