Skip to content

Enter User

POST /v1/lotteries/entries

Enters a user into a lottery draw. The system automatically assigns the user to the next open draw and generates a quick-pick ticket if no specific number lines are provided.

HeaderRequiredValue
X-API-SecretYesYour secret key
Content-TypeYesapplication/json
FieldTypeRequiredDescription
emailstringYesUser’s email address
lotterySlugstringYesLottery slug (from the list endpoint)
userIdstringNoYour internal user ID for tracking
linesarrayNoSpecific number lines to play. If omitted, a random quick-pick is generated
FieldTypeDescription
mainnumber[]Main numbers (must match the lottery’s configured range)
bonusnumber[]Bonus numbers (if the lottery uses bonus numbers)
Terminal window
# Quick-pick (auto-generated numbers)
curl -X POST https://api.gamifyhost.com/v1/lotteries/entries \
-H "X-API-Secret: sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"lotterySlug": "mega-millions-weekly",
"userId": "user_12345"
}'
Terminal window
curl -X POST https://api.gamifyhost.com/v1/lotteries/entries \
-H "X-API-Secret: sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"lotterySlug": "mega-millions-weekly",
"lines": [
{ "main": [7, 14, 21, 35, 42], "bonus": [3] }
]
}'

Status: 201 Created

{
"status": "success",
"data": {
"id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"ticketRef": "LX-2026-0305-A7F2",
"drawId": "c2d3e4f5-a6b7-8901-cdef-123456789012",
"lotteryId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"email": "user@example.com",
"externalUserId": "user_12345",
"status": "ACTIVE",
"entryMethod": "PARTNER_API",
"lines": [
{ "main": [7, 14, 21, 35, 42], "bonus": [3] }
],
"createdAt": "2026-03-05T14:30:00Z"
}
}
FieldTypeDescription
idstringTicket UUID
ticketRefstringHuman-readable ticket reference (e.g., LX-2026-0305-A7F2)
drawIdstringThe draw this ticket is entered into
lotteryIdstringLottery UUID
emailstringUser’s email
externalUserIdstringYour user ID (if provided)
statusstringTicket status: ACTIVE, DRAWN, WON, LOST, CANCELLED
entryMethodstringAlways PARTNER_API for API entries
linesarrayNumber lines on this ticket
createdAtstringISO 8601 timestamp
CodeMessage
400lottery not found — Invalid slug
400lottery is not active — Lottery is paused, completed, or expired
400no open draw available — No upcoming draw to enter
400max tickets exceeded — User has reached the ticket limit for this draw
400invalid number lines — Provided numbers don’t match the lottery’s configuration