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, public slug)
  • Entries (full name, email, phone, one receipt image in R2)

Rules

  • A campaign accepts entries when startsAt <= now < endsAt. Outside that window, POST returns 422 CAMPAIGN_CLOSED.
  • One request stores one entry. Items on the receipt are not counted separately.
  • Uploading the same receipt again creates another entry. sha256 is stored for staff review and is not unique.

Access

CallerRouteAuth
Public formGET /v1/public/campaigns/{slug}None
Public formPOST /v1/public/campaigns/{slug}/entriesNone (Turnstile at the gateway)
Staff/v1/campaignsDirectory 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.