Loyalty, codes, and broadcasts
Actor-owned points plus organiser promotion, giveaway, and broadcast operations.
Point spending uses locked balances and cannot make an account negative. Giveaway drawing is a one-time state transition.
| Operation | Access | Purpose |
|---|---|---|
GET /api/loyalty/rewards | Session | Balances, point history, and eligible giveaways by organisation. |
POST /api/loyalty/giveaways/enter | Session | Spend points for one entry within current limits. |
GET /api/loyalty/settings | Organiser | Current point rates and edit authority. |
PATCH /api/loyalty/settings | Organiser | Save nonnegative point rates. |
GET /api/loyalty/codes | Organiser | Promotion codes, usage, and eligible events. |
POST /api/loyalty/codes | Organiser | Create a bounded fixed or percentage code. |
DELETE /api/loyalty/codes | Organiser | Retire a code. |
GET /api/loyalty/giveaways | Organiser | Event giveaway state and winners. |
POST /api/loyalty/giveaways | Organiser | Create a giveaway. |
DELETE /api/loyalty/giveaways | Organiser | Delete an undrawn giveaway. |
POST /api/loyalty/giveaways/draw | Organiser | Draw winners once and report notification outcome separately. |
GET /api/loyalty/broadcasts | Organiser | Audience count and send history. |
POST /api/loyalty/broadcasts | Organiser | Send a bounded event broadcast through the configured provider. |
An unknown actor-visible event returns 404; missing session and membership
return 401 and 403. Mutations require an exact configured Origin.