Generating Tickets
You can request this endpoint to generate tickets. You can get instance_variant_id from instance_variants[].id on the events list.
Making the Request
MethodPOST
Endpoint/v2/consumer/event/ticket/
Request body
| Field | Required | Description |
|---|---|---|
| tickets | Yes | Array of ticket requests (1-10 items) |
| tickets[].instance_variant_id | Yes | id from instance_variants |
| tickets[].quantity | Yes | How many tickets to issue (1-10) |
| tickets[].phone_number | Yes | Buyer phone |
| tickets[].txn_id | Yes | Your payment / transaction reference |
| tickets[].email | No | Buyer email |
| tickets[].full_name | No | Buyer name |
Auth Required
Yes
Example Request
Python
python
import requests
url = 'https://tbe.thuprai.com/v2/consumer/event/ticket/'
payload = {
'tickets': [
{
'instance_variant_id': 1521,
'quantity': 2,
'phone_number': '9800000000',
'txn_id': 'TXN-12345',
'email': 'a@b.com',
'full_name': 'Alice',
},
],
}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.post(url, json=payload, headers=headers)
print(response.text)1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Success Response
Code : 200 OK
Content example
json
{
"tickets": [
{
"id": 231,
"code": "e540d940-d531-4644-9cbd-c975edcbfb6d"
},
{
"id": 232,
"code": "89f39fe1-00c3-4061-b7df-0c9210b1595f"
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
- The
codein response can either be UUID or nanoid. - Ticket intefaces generated from this data should include both
idandcode. - The
codeis usually represented as a QR Code. - The
idis usually represented as ticket number, example - #231. This helps identifying the ticket and validating the purchase incase the QR code is unreadable on a print form.
Example Ticket
This is a sample ticket generated by Thuprai's system itself. Consumers are also recommended to include the same details in generated ticket.

Notes
- Up to 10 items per request, each with quantity up to 10.
txn_idis your side's transaction id (payment ref, order id, etc).- Create fails if the variant is invalid/unavailable, the event is sold out, the show has ended, or requested quantity is more than tickets left.
- This endpoint is throttled.