Enter User
POST /v1/lotteries/entriesEnters 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.
Authentication
Section titled “Authentication”| Header | Required | Value |
|---|---|---|
X-API-Secret | Yes | Your secret key |
Content-Type | Yes | application/json |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User’s email address |
lotterySlug | string | Yes | Lottery slug (from the list endpoint) |
userId | string | No | Your internal user ID for tracking |
lines | array | No | Specific number lines to play. If omitted, a random quick-pick is generated |
Line Object
Section titled “Line Object”| Field | Type | Description |
|---|---|---|
main | number[] | Main numbers (must match the lottery’s configured range) |
bonus | number[] | Bonus numbers (if the lottery uses bonus numbers) |
Request Examples
Section titled “Request Examples”# 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" }'const response = await fetch( 'https://api.gamifyhost.com/v1/lotteries/entries', { method: 'POST', headers: { 'X-API-Secret': 'sk_live_your_secret_key', 'Content-Type': 'application/json', }, body: JSON.stringify({ email: 'user@example.com', lotterySlug: 'mega-millions-weekly', userId: 'user_12345', }), });
const { data } = await response.json();console.log(`Ticket created: ${data.ticketRef}`);import requests
response = requests.post( "https://api.gamifyhost.com/v1/lotteries/entries", headers={ "X-API-Secret": "sk_live_your_secret_key", "Content-Type": "application/json", }, json={ "email": "user@example.com", "lotterySlug": "mega-millions-weekly", "userId": "user_12345", },)
data = response.json()print(f"Ticket created: {data['data']['ticketRef']}")payload := strings.NewReader(`{ "email": "user@example.com", "lotterySlug": "mega-millions-weekly", "userId": "user_12345"}`)
req, _ := http.NewRequest("POST", "https://api.gamifyhost.com/v1/lotteries/entries", payload)req.Header.Set("X-API-Secret", "sk_live_your_secret_key")req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)if err != nil { log.Fatal(err)}defer resp.Body.Close()
var result map[string]interface{}json.NewDecoder(resp.Body).Decode(&result)fmt.Println(result["data"])$ch = curl_init('https://api.gamifyhost.com/v1/lotteries/entries');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'X-API-Secret: sk_live_your_secret_key', 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'email' => 'user@example.com', 'lotterySlug' => 'mega-millions-weekly', 'userId' => 'user_12345', ]),]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);echo "Ticket created: {$data['data']['ticketRef']}\n";import 'dart:convert';import 'package:http/http.dart' as http;
final response = await http.post( Uri.parse('https://api.gamifyhost.com/v1/lotteries/entries'), headers: { 'X-API-Secret': 'sk_live_your_secret_key', 'Content-Type': 'application/json', }, body: jsonEncode({ 'email': 'user@example.com', 'lotterySlug': 'mega-millions-weekly', 'userId': 'user_12345', }),);
final data = jsonDecode(response.body);print('Ticket created: ${data['data']['ticketRef']}');With Specific Numbers
Section titled “With Specific 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", "lines": [ { "main": [7, 14, 21, 35, 42], "bonus": [3] } ] }'const response = await fetch( 'https://api.gamifyhost.com/v1/lotteries/entries', { method: 'POST', headers: { 'X-API-Secret': 'sk_live_your_secret_key', 'Content-Type': 'application/json', }, body: JSON.stringify({ email: 'user@example.com', lotterySlug: 'mega-millions-weekly', lines: [ { main: [7, 14, 21, 35, 42], bonus: [3] }, ], }), });Response
Section titled “Response”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" }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
id | string | Ticket UUID |
ticketRef | string | Human-readable ticket reference (e.g., LX-2026-0305-A7F2) |
drawId | string | The draw this ticket is entered into |
lotteryId | string | Lottery UUID |
email | string | User’s email |
externalUserId | string | Your user ID (if provided) |
status | string | Ticket status: ACTIVE, DRAWN, WON, LOST, CANCELLED |
entryMethod | string | Always PARTNER_API for API entries |
lines | array | Number lines on this ticket |
createdAt | string | ISO 8601 timestamp |
Errors
Section titled “Errors”| Code | Message |
|---|---|
400 | lottery not found — Invalid slug |
400 | lottery is not active — Lottery is paused, completed, or expired |
400 | no open draw available — No upcoming draw to enter |
400 | max tickets exceeded — User has reached the ticket limit for this draw |
400 | invalid number lines — Provided numbers don’t match the lottery’s configuration |