Skip to content

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

Method
POST

Endpoint
/v2/consumer/event/ticket/

Request body

FieldRequiredDescription
ticketsYesArray of ticket requests (1-10 items)
tickets[].instance_variant_idYesid from instance_variants
tickets[].quantityYesHow many tickets to issue (1-10)
tickets[].phone_numberYesBuyer phone
tickets[].txn_idYesYour payment / transaction reference
tickets[].emailNoBuyer email
tickets[].full_nameNoBuyer 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)

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"
        }
    ]
}
  • 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

  • Up to 10 items per request, each with quantity up to 10.
  • txn_id is 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.