Categories
Design Tickets

Ticket Generator API: How to generate QR Code tickets programmatically

Say your company has an events site. People interested in your events make a booking and purchase event tickets. The event could be a movie, a play, comedy show, tourist attraction, seminar, or even a transport journey.

When a purchase is made online you either share a booking confirmation or an e-ticket probably via email. The guest then needs to print the ticket and show it at the entrance.

Lately, you are feeling the need to improve this ticketing system. First by making the entire process more convenient for your guests. Next, by making the ticketing process more secure. You are worried about unauthorized entries.

Hence, you’re looking for a better ticketing system. So that you can integrate with your existing event registration site or software.

Here is what you need—a ticketing API that creates one-time scannable QR Code-based tickets. You can scan this QR Code on the tickets at the entry using a smartphone app.

Your guests can receive the tickets on their email. And show the ticket on their smartphone at the entrance. Your security personnel can use their smartphone to scan the ticket and validate entry.

No printing, no tedious software development, and no additional hardware required. A simple integration with a secure third-party API.

You can do this using the API provided by the online ticketing tool Ticket Generator. The tickets can be validated using the Ticket Validator apps available on App Store and Google Play.

A. Decide ticket format

Before we go into the steps on how to use the Ticket Generator API, you need to decide how you want the tickets. The tool currently allows three options:

a. Get QR Code and ticket ID only

This option is useful if you already have a ticket design that you use. You simply need to add a layer of security and convert your tickets into QR Code tickets.

If you choose this option, the API will return a unique QR Code (image) and ticket ID. In your own ticketing software, you can place these on your existing ticket design.

The Ticket Validator app can be used to scan the QR Code or check the ticket ID.

b. Get QR Code ticket image

This option is useful when you’re starting from scratch. Ticket Generator has a standard ticket design that you can use.

In this case, you’ll first need to customize the design of the ticket via the tool dashboard. And save it. Then you can use the API to generate tickets with this design in real-time.

With each API call you will get a ticket in PNG format of resolution 2200 x 850 pixels. You can either display the ticket, make it available for download, or email it to the guest.

Each ticket will have a QR Code and ticket ID. These can be used to validate the ticket as usual.

c. Email QR Code ticket directly to recipient

This option is useful when you have the email address of the guest. And want to email the ticket directly to the guest.

In this case also, you’ll first need to design the ticket via the Ticket Generator dashboard. Then use the API to programmatically generate and email the QR Code tickets.

You can validate the emailed tickets as usual.

Depending on your requirements, you should choose a method. Keep reading to now learn how to use the Ticket Generator API.

B. How to use Ticket Generator API to generate QR Code tickets

Given below is a step-by-step guide on how to use the Ticket Generator API:

a. Signup for Ticket Generator account (free)

First you’ll need to create an account with Ticket Generator. The signup is free and no credit card is required. Plus, it probably takes less than a minute.

In fact, the tool gives you 10 ticket credits free to try the product. 10 ticket credits are good for 10 tickets or 10 API requests.

Here is the link to: Signup for Ticket Generator.

b. Create an event

In Ticket Generator, the first step is to create an event. Tickets created via this tool are for a specific event.

To create an event, go to Manage Events from the sidebar navigation and click on Create New Event.

You’ll need to enter event details such as: Event Name, Date & Timings, Activate Tickets (when you would like to allow validation of tickets to start), Timezone, and Venue. All these fields are required.

Ticket Generator API: Create event

Click on Create when all details have been added.

c. Create ticket design

Note that this step is not required if you’re only looking to get QR Code and ticket ID. If so, skip this step.

From the sidebar navigation, go to Create Tickets

In the Select Event option, select the event created in the previous step from the dropdown list. You’ll be taken to the next step to Design and Generate Event Tickets > Generate & Download

In the ticket editor/designer, you’ll see the event details on the display ticket. You now have the option to:

  • Edit background i.e. add background image or color
  • Add logo to provide branding to the ticket
  • Add additional event details such as Event Description and Notes

Design ticket

Note on Variable Information

With Ticket Generator, you also have the option to add unique ticket information or variable information. This means that all information on the tickets will remain constant except QR Code and ticket ID. But you can add information that is unique to each ticket. This could be the name of the guest, booking reference number, seat number, hall number, ticket price, etc.

When creating tickets via the dashboard, you can upload a CSV/Excel with this data. However, in the case of API, you will need to provide this information with the API request.

Once the design is ready, click on Preview to see how the ticket will actually look. If the design is final, click on API from the sidebar navigation.

d. Generate API certificate

Go to the API section from the sidebar navigation.

The next step is to generate the API certificate. The API certificate or key is what you require to authorize an API request.

Ticket Generator API Certificate

Click on Create to generate to create a new API Certificate. You will be required to enter your account password. One the key generates, copy it and keep it handy.

e. Get event ID

Next, you’ll also need the event ID. From the dropdown list, choose the event created in the previous steps. The ID will be displayed. Copy this ID and keep it handy.

Ticket Generator API: Give event ID

f. Go to API documentation

Once you have the API certificate and event ID, click the View Docs button under API Documentation.

You’ll be redirected to the API documentation and playground. You can use this documentation to view and create sample requests.

g. Create a sample request

The first step here is to authorize the playground.

Click on the Authorize button and paste the API certificate/key created in the previous steps. This will authenticate that you have a valid account with Ticket Generator.

Important note: Authorized API requests will use actual ticket credits from your Ticket Generator account.

Next, choose the ticket format or method from the three options:

1. GET/ticket/data/

Use this option if you only need QR Code and ticket ID.

To start, click on TEST.

Ticket Generator API: Get parameters

Enter values in the the following parameters:

  • eventID: Paste the event ID copied in the previous steps
  • width: Enter the size of QR Code image in pixels. Default value is 300 pixels

Click on Execute.

The documentation will share the API request format in Curl, the request URL, return the QR Code image in PNG (base64) format and ticket ID, and the response header.

Get QR Code data response via API

You can use this sample to create actual requests via your own event registration system.

2. POST/ticket/image/

Use this option if you need the tickets in PNG format. The design of the ticket will be the design we created via the Ticket Generator dashboard.

To start, click on TEST.

Request QR Code ticket image

Enter values in the the following parameters:

  • eventID: Paste the event ID copied in the previous steps
  • header_1: This field is for the header of the unique information that’ll go on the ticket. Enter string such as ‘Name’
  • value_1: This field is for the value of the header 1 i.e. the unique information that’ll go on the ticket. Enter string such as ‘Lauren Reyes’
  • header_2, header_3, header_4, header_5: You can add up to 5 headers on the ticket using these parameters
  • value_2, value_3, value_4, value_5: You can add up to 5 values corresponding to headers using these parameters

Click on Execute.

The documentation will share the API request format in Curl, the request URL, return the QR Code image in PNG (2200 x 850 pixels), and the response header.

Post QR Code based ticket response

3. POST/ticket/email/

Use this option if you need to email the tickets directly to the recipient. The design of the ticket will be the design we created via the Ticket Generator dashboard.

To start, click on TEST.

Ticket Generator API: Email

Enter values in the the following parameters:

  • eventID: Paste the event ID copied in the previous steps
  • email: Enter the email address of the ticket recipient
  • subject: Enter the subject of the email that will be sent to the recipient
  • body: Enter body of the email that will be sent to the recipient
  • fromName: Enter sender’s name. This will indicate to the recipient who the email is from
  • fromEmail: Enter sender’s email address. This will indicate to the recipient who the email is from
  • replyTo: Enter reply-to email address. If the recipient replies to the email, who should receive it
  • header_1: This field is for the header of the unique information that’ll go on the ticket. Enter string such as ‘Name’
  • value_1: This field is for the value of the header 1 i.e. the unique information that’ll go on the ticket. Enter string such as ‘Lauren Reyes’
  • header_2, header_3, header_4, header_5: You can add up to 5 headers on the ticket using these parameters
  • value_2, value_3, value_4, value_5: You can add up to 5 values corresponding to headers using these parameters

Click on Execute.

The documentation will share the API request format in Curl, the request URL, return a message that the email is sent, and the response header.

Response of ticket email via API

C. How to validate tickets and manage the event

Once you have generated and distributed the tickets, you need to prepare to manage validation of tickets.

a. Add coordinators

An event ‘coordinator’ is a person authorized to validate tickets at the entry. With Ticket Generator, you can add multiple coordinators to do this.

From the Ticket Generator dashboard, go to Manage Events. In the event row, click on the three dots icon in the More column. Choose Add/Edit Coordinator. Enter the email addresses of the coordinators. Click on Invite.

Add coordinators to the event

The coordinators will receive an email invitation and will be required to set a password.

Note that the administrator of the Ticket Generator account need not add himself/herself. Administrators can validate tickets by default.

b. Download Ticket Validator App

The coordinators should then download the Ticket Validator app from App Store and Google Play.

The coordinators can login via the credentials setup in the previous step. Administrators can login via their Ticket Generator account credentials.

In the app, coordinators can select the required event.

Select event to see analytics

The scanner will activate. You can then scan the QR Code on each ticket. If for some reason, the QR Code is unscannable, the coordinator can enter the ticket ID and validate.

c. Track event attendance

With Ticket Generator, it is also possible to track the event attendance.

In Manage Events, click on the event row. Then click on View Analytics.

In this section, you will be able to see:

  • Percentage of people who attended the event
  • Number of tickets validated per coordinator
  • Attendance on the different time periods (by hours, days) of the event
  • Number of used, new, expired, and invalid tickets
  • Number of duplicate and re-entry allowed tickets

This data will help you understand how well the event performed. And lead you to make better decisions for your next event.

That is all you need to know on how to create QR Code tickets via the Ticket Generator API.

Start now by signing up for a free Ticket Generator account.


Create ticket via API

Ensure secure tickets effortlessly
CTA scanova blog

By Saumya Bhatia

Saumya Bhatia helps event organizers to come up with a secure event ticketing solution. When not writing, she is either reading a book or trekking.

Leave a Reply

Your email address will not be published. Required fields are marked *