Appearance
Webhook payload reference
What a Custom URL webhook endpoint sends, for whoever builds the system that receives it: your own developer, or an agency building something for you, such as a live stream overlay. If someone asks "do you have webhooks?", send them this page.
Setting up the endpoint is on the Webhooks page. The site owner chooses which events it gets, how customers appear and which events are skipped, and gives you the endpoint's signing secret.
Every delivery
Each event arrives as one HTTPS POST with a JSON body:
json
{
"id": "evt_2b7f0c9e41d0a6c3b8e1f2a9",
"event": "INSTANT_WIN_CLAIMED",
"version": 2,
"createdAt": "2026-10-23T19:05:41.000Z",
"site": { "name": "Example Competitions", "url": "https://example.co.uk" },
"data": { }
}| Field | Meaning |
|---|---|
id | The event's ID. The same on every retry of this event, so use it to ignore duplicates. Each endpoint gets its own IDs. |
event | Which event this is. See Events. |
version | The payload format. 2 for everything described here. |
createdAt | When the event happened (ISO 8601, UTC). |
site | The site it came from: its name and address. |
data | The event itself. Its shape depends on event. |
test | true on deliveries the site owner sent with Send test, and missing otherwise. |
And these headers:
| Header | Meaning |
|---|---|
X-Webhook-Event | Same as event in the body. |
X-Webhook-Id | Same as id in the body. |
X-Webhook-Delivery | A new value on every delivery attempt, for your logs. |
X-Webhook-Signature | t=<unix seconds>,v1=<hex>. See Check the signature. |
Reply with any 2xx status within 5 seconds, and do slow work after replying: a site's Custom URL deliveries go out one at a time, so a slow reply holds up the next one. Anything else, or no reply, is retried with increasing gaps, up to 6 attempts over about half an hour. A retry carries the same id.
Check the signature
Every delivery is signed so you can be sure it came from the site and wasn't changed on the way. v1 is the HMAC-SHA256, keyed with the signing secret, of the timestamp, a full stop, and the raw request body exactly as received.
js
import crypto from 'node:crypto'
// rawBody: the request body as a string, before any JSON parsing
export function verifyWebhook(rawBody, signatureHeader, secret) {
const parts = Object.fromEntries(signatureHeader.split(',').map((p) => p.split('=')))
const expected = crypto
.createHmac('sha256', secret)
.update(`${parts.t}.${rawBody}`)
.digest('hex')
const ok = parts.v1?.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected))
// Reject deliveries signed more than 5 minutes ago, so an old one can't be replayed
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300
return ok && fresh
}Verify before you parse, using the raw body: re-serialising parsed JSON changes the bytes and the signature won't match. If the site owner rotates the secret, every delivery fails your check until you switch to the new one.
Customers
Wherever a customer appears, they look like this:
json
{ "name": "Alex J.", "ref": "cus_k3m9x2qa71c0de42" }namefollows the endpoint's name setting: full name, first name and last initial, first name only, ornullwhen the site sends no names.refis an anonymous ID: the same customer always gets the samereffrom this endpoint, so you can spot a repeat winner, but it can't be traced to their account. Instead ofref, an endpoint set to send account IDs hasid, and one set to send no identifier has neither.
Email addresses, phone numbers and postal addresses are never included.
Record IDs
orderId, requestId, membershipId and referralId are anonymous in the same way as ref: stable for your endpoint, different at any other. Order numbers and referral codes are only included when the endpoint sends account IDs, and so are the real record IDs. Times and ticket numbers are real, so they're the same wherever the event is sent.
Events
The site owner picks which of these the endpoint receives.
Instant win claimed
INSTANT_WIN_CLAIMED: a customer won one or more instant prizes. One delivery per checkout, listing every prize they won in it.
json
{
"orderId": "ord_7f2c19a04be3d5e1",
"customer": { "name": "Alex J.", "ref": "cus_k3m9x2qa71c0de42" },
"wins": [
{
"competition": {
"id": "cmp_3k91",
"title": "Win a PlayStation 5",
"url": "https://example.co.uk/competitions/win-a-ps5",
"imageUrl": "https://example.co.uk/img/ps5.webp"
},
"prize": { "title": "£50 Cash", "type": "CASH", "value": 50, "imageUrl": null },
"ticketNumber": 4211,
"wonAt": "2026-10-23T19:04:12.000Z"
}
]
}prize.typeisCASH,SITE_CREDIT,PHYSICALorCOMPETITION_TICKETS.prize.valueis in pounds, ornullwhen the site hasn't set a value for that prize.- The site's filters may have removed some wins (small ones, say) before sending. A checkout with nothing left isn't sent at all.
Order payment completed
ORDER_PAYMENT_COMPLETED: a customer paid for tickets.
json
{
"orderId": "ord_0c4e8b2a9d1f7e36",
"customer": { "name": "Sam S.", "ref": "cus_p0w7d1rt58aa31f0" },
"items": [
{
"competition": { "id": "cmp_3k91", "title": "Win a PlayStation 5", "url": "https://example.co.uk/competitions/win-a-ps5" },
"ticketCount": 10
}
],
"ticketCount": 10,
"total": { "amount": 12.5, "currency": "GBP" },
"paidAt": "2026-10-23T19:05:40.000Z"
}- Ticket numbers aren't included.
orderNumberis only included when the endpoint sends account IDs. totalis the whole order. It's missing when the site doesn't share amounts, and when a competition filter removed some of the order's items, because it would no longer match them.
Competition draw completed
COMPETITION_DRAW_COMPLETED: a competition's winners have been drawn.
json
{
"competition": {
"id": "cmp_3k91",
"title": "Win a PlayStation 5",
"url": "https://example.co.uk/competitions/win-a-ps5",
"imageUrl": "https://example.co.uk/img/ps5.webp"
},
"winners": [
{
"position": 1,
"prize": { "title": "Win a PlayStation 5", "type": "PHYSICAL" },
"ticketNumber": 42,
"customer": { "name": "Priya K.", "ref": "cus_a8e4n6vz09c7e2b1" }
}
],
"drawnAt": "2026-10-23T20:00:03.000Z"
}winners is empty when no tickets were sold. If a draw is redone, a new delivery with a new id lists the final winners.
Competition launched, sold out and ended
COMPETITION_LAUNCHED, COMPETITION_SOLD_OUT and COMPETITION_ENDED each carry a competition object (as above) plus the event's own fields:
| Event | Fields |
|---|---|
COMPETITION_LAUNCHED | startDate, endDate, pricePerTicket, maxTickets, isAppExclusive, requiresAccessCode, launchedAt |
COMPETITION_SOLD_OUT | ticketsSold, maxTickets, soldOutAt |
COMPETITION_ENDED | ticketsSold, maxTickets, endDate, endedAt |
Admin alerts
The site's operational alerts can go to a Custom URL too. Each carries a customer (or two, for referrals) shaped as above, record IDs, and amounts only when the site shares them.
| Event | Fields |
|---|---|
WITHDRAWAL_REQUESTED | requestId, customer, amount, requestedAt |
PRIZE_CHOICE_MADE | competition (id and title only), prize.title, customer, choice (CASH, CREDIT or PRIZE), cashAmount, creditAmount, source, chosenAt |
ORDER_FULFILLMENT_FAILED | orderId, orderNumber (account IDs only, when known), reason, attempts, failedAt |
TICKET_COUNT_MISMATCH | orderId, orderNumber (account IDs only), expectedTickets, actualTickets, stage, detectedAt |
ID_VERIFICATION_SUBMITTED | requestId, customer, imageCount, submittedAt |
REFERRAL_CREATED | referralId, referrer, referee, codeUsed (account IDs only), referredAt |
REFERRAL_QUALIFIED | referralId, referrer, referee, rewardAmount, trigger, qualifiedAt |
WALLET_TOPUP_COMPLETED | orderId, orderNumber (account IDs only), customer, amount, bonusCredited, totalCredited, completedAt |
MEMBERSHIP_STARTED, MEMBERSHIP_RENEWED, MEMBERSHIP_PAYMENT_FAILED, MEMBERSHIP_ENDED | membershipId, customer, membershipName, status, monthlyPrice, currency, occurredAt, plus orderId, orderNumber (account IDs only), amount, currentPeriodEnd, nextRetryAt, graceEndsAt or endedReason where they apply |
MEMBERSHIP_PAYMENT_CHECK_NEEDED | membershipId, customer, membershipName, orderId, orderNumber (account IDs only), amount, heldSince, reason |
Good to know
- Duplicates. A delivery can arrive more than once (a retry after your reply was lost, for example). Keep the
ids you've handled and skip repeats. - Order. Deliveries usually arrive in the order events happen, but that isn't guaranteed. Sort by
createdAt(orwonAt) if order matters. - Speed. An instant win is sent once the checkout's prizes are all settled, normally within seconds of payment.
- Testing. The site owner can send any event's sample from the endpoint's Send test button. Test deliveries have
"test": trueand [TEST] in front of competition names. - New fields. Fields may be added to
dataover time. Ignore ones you don't recognise. Anything that removes or changes a field will come with a newversion.