API Reference enterprise+ plan
Read your competitions, orders and headline figures from your own systems with the REST API. It's read-only, and each key works only for your own organisation.
Authentication
Send your API key in the Authorization header with the Bearer scheme:
Authorization: Bearer gw_live_abc123def456...
Keys start with gw_live_. We store only a SHA-256 hash of each key, so the full key is shown once, when you create it. Store it somewhere safe; it can't be shown again.
Keep your keys secret
Never put an API key in client-side code, a public repository or a browser request. Call the API from your server.
What a key can read
Keys created in the dashboard can read competitions, orders and stats (competitions:read, orders:read and stats:read). A key without the scope an endpoint needs gets a 403.
Managing API keys
Open the API Access settings
In your dashboard, go to Settings, open the Security tab and find API Access. The owner and any team member can manage keys.
Create a key
Type a name you'll recognise later (for example "Accounts server"), then click Create Key.
Copy the key
The full key is shown once. Copy it straight away into an environment variable or a secrets manager, then click Done.
Revoke it when you no longer need it
Click Revoke next to the key. A revoked key stops working at once: requests with it get a 401. You can then delete it from the list with the bin icon.
Base URL
https://giveawayz.io/api/v1/
The API also answers on your storefront's address (https://your-subdomain.giveawayz.io/api/v1/). The key decides whose data you get, not the address.
Endpoints
Lists come back newest first, up to 100 items. Use limit (1 to 100) for fewer. Dates are numbers: milliseconds since 1 January 1970 (UTC). Money is in pounds.
GET /competitions
Your competitions, newest first.
| Parameter | Type | Description |
|---|---|---|
limit | number | How many to return, 1 to 100 (default 100) |
Example request:
curl "https://giveawayz.io/api/v1/competitions?limit=10" \
-H "Authorization: Bearer gw_live_abc123def456..."
Example response:
{
"data": [
{
"id": "k57a2d9h3x8w1q0f6m4r2t7b5n9c3e1j",
"title": "Win a PS5 Pro Bundle",
"description": "A PS5 Pro with two controllers and three games.",
"status": "active",
"entryMode": "paid",
"ticketPrice": 2.99,
"maxTickets": 500,
"ticketsSold": 312,
"freeEntries": 4,
"startDate": 1771146000000,
"endDate": 1773619140000,
"drawType": "auto",
"drawDate": 1773619140000,
"prizeValue": 699,
"cashAlternative": 550,
"winnerCount": 1,
"drawnAt": null,
"createdAt": 1770733800000
}
],
"count": 1
}
| Field | Description |
|---|---|
status | draft, upcoming, active, completed or cancelled |
entryMode | paid, or free for a free prize draw |
ticketsSold | Paid tickets sold |
freeEntries | Free entries, online and by post |
drawType | auto (drawn at the close), manual (you run it live after the close), or flash on some older competitions |
prizeValue, cashAlternative | The main prize's, in pounds, or null if not set |
winnerCount | How many people win, across every prize |
drawnAt | When the draw ran, or null |
GET /orders
Your orders, newest first.
| Parameter | Type | Description |
|---|---|---|
limit | number | How many to return, 1 to 100 (default 100) |
Example request:
curl "https://giveawayz.io/api/v1/orders?limit=5" \
-H "Authorization: Bearer gw_live_abc123def456..."
Example response:
{
"data": [
{
"id": "j97c4f1a8e2d6b3k5m0n7p9q2r4s6t8v",
"orderNumber": "ACME-1042",
"customerEmail": "jane@example.com",
"customerName": "Jane Smith",
"status": "paid",
"subtotal": 8.97,
"total": 8.97,
"items": [
{
"competitionId": "k57a2d9h3x8w1q0f6m4r2t7b5n9c3e1j",
"quantity": 3,
"pricePerTicket": 2.99,
"totalPrice": 8.97
}
],
"createdAt": 1772037720000
}
],
"count": 1
}
status is pending, paid, failed, refunded or refund_pending (paid, but being refunded because no tickets could be issued). customerName is null when the buyer didn't give one.
GET /stats
Headline figures for your organisation.
Example request:
curl "https://giveawayz.io/api/v1/stats" \
-H "Authorization: Bearer gw_live_abc123def456..."
Example response:
{
"data": {
"organization": { "name": "Acme Competitions", "slug": "acme" },
"activeCompetitions": 3,
"totalTicketsSold": 6841,
"totalRevenue": 14523.5,
"winnersDrawn": 12
}
}
totalTicketsSold counts paid tickets across every competition. totalRevenue is an estimate: paid tickets at full price, for live and finished competitions, before bundle and discount-code savings. Use /orders for exact amounts.
Errors
Errors come back as JSON with a message:
{ "error": "Invalid or revoked API key" }
| HTTP status | When |
|---|---|
401 | The Authorization header is missing or malformed, or the key is unknown, revoked, or on a plan without API access. |
403 | The key doesn't have the scope this endpoint needs. The response also lists required and granted. |
429 | Too many failed authentication attempts from your IP address. Wait for the Retry-After time. |
500 | Something went wrong on our side. If it keeps happening, contact support@giveawayz.io. |
Limits
After 10 failed authentication attempts in a minute from one IP address, requests get a 429 with Retry-After: 60. There's no other fixed request limit today. Please don't poll more than once a minute; to hear about events as they happen, use webhooks.
Related
- Webhooks: events sent to your server as they happen
- Team Management: who on your team can manage API keys
- Pricing Plans: API access is on the Enterprise plan