Skip to content
On this page

Generating Tickets

You can request this endpoint to generate tickets for a particular event. You can use the token verification endpoint or contact us to find out which events are enabled for your consumer account.

Making the Request

Method
POST

Endpoint
/v2/consumer/event/ticket/

Request Parameters

ParamValue
event_idThe id of the event the tickets should be generated for.
quantityThe number of tickets to be generated.

Auth Required
Yes

Example Request

Python

python
import requests

url = 'https://tbe.thuprai.com/v2/consumer/event/ticket/'
payload = {'event_id': 513, 'quantity': 2}
headers = { 'Authorization': 'Bearer <your-auth-token>'}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
1
2
3
4
5
6
7

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
  • The code in response can either be UUID or nanoid.
  • Ticket intefaces generated from this data should include both id and code.
  • The code is usually represented as a QR Code.
  • The id is 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.

Sample Ticket

Notes

  • A single request to this endpoint can handle only one event since event_id takes in the id of only one event.
  • This endpoint is throttled.