Introduction
Raffle
Standalone Worker for raffle campaigns. Staff create a campaign with an active and inactive time. Each campaign has its own public entry URL. One receipt upload is one entry.
Gateway base: https://api.mayawealth.co.uk/raffle.
OpenAPI: Raffle API reference.
What it owns
- Campaigns (
name,startsAt,endsAt, publicslug) - Entries (full name, email, phone, one receipt image in R2)
Rules
- A campaign accepts entries when
startsAt <= now < endsAt. Outside that window,POSTreturns422CAMPAIGN_CLOSED. - One request stores one entry. Items on the receipt are not counted separately.
- Uploading the same receipt again creates another entry.
sha256is stored for staff review and is not unique.
Access
| Caller | Route | Auth |
|---|---|---|
| Public form | GET /v1/public/campaigns/{slug} | None |
| Public form | POST /v1/public/campaigns/{slug}/entries | None (Turnstile at the gateway) |
| Staff | /v1/campaigns | Directory JWT, service raffle |
The entry body is JSON: fullName, email, phone, and receipt (filename, contentType, base64 content). JPEG, PNG, or WebP, up to 8 MB.
Staff download a receipt at GET /v1/campaigns/{id}/entries/{entryId}/receipt.