Order Questions

Overview

There are two types of order questions, default and custom questions, that appear on the checkout screen while one is purchasing the tickets. Eventbrite uses these questions to collect information from the attendees. We can list the default questions and create new custom questions using the Eventbrite API.

Default questions

Eventbrite provides a list of default questions to inquire about the attendee’s basic information, for example, first name, last name, and email address.

The following URL uses the GET method to retrieve the list of default questions for an event:

https://www.eventbriteapi.com/v3/events/{event_id}/canned_questions/

We provide the {event_id} in the URL to retrieve the default questions. It returns a paginated JSON object of questions.

Press + to interact
import requests
import json
url = 'https://www.eventbriteapi.com/v3/events/{{EVENT_ID}}/canned_questions/'
headers = {
'Authorization': 'Bearer {{PRIVATE_TOKEN}}',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers).json()
print(json.dumps(response, indent=4))

Custom questions

Eventbrite provides the facility to create a custom question to ask the attendees for specific information; for example, attendee’s education and medical condition.

Create a custom question

There are different types of custom questions. We must specify one of these question types: checkbox, dropdown, text, radio, or waiver.

The following URL uses the POST method to create the question:

https://www.eventbriteapi.com/v3/events/{event_id}/questions/

We’ll require the {event_id} and {ticket_class_id} to link the ticket class of the event with the question. The {event_id} is provided in the URL and {ticket_class_id} is provided as request parameter.

Request parameters

The input query parameters to create the custom question are as follows:

Object

Type

Category

Description

question.html

string

required

This object is the statement of the question.

required

boolean

required

This object specifies  whether the answer to the question is necessary or not.

type

enum

required

This object is the type of question. The possible values are checkboxdropdowntextradio, or waiver.

respondent

enum

optional

This object specifies who will answer the question: ticket_buyer or attendee.

waiver

string

optional

This object provides the content of the waiver question.

choices

array

required

This object provides a list of answers.

ticket_classes.id

array

required

This object provides one or more ticket_class_id's.

parent_id

string

optional

This object provides the ID of the parent question if the current question is the subquestion.

parent_choice_id

string

optional

This object provides the ID of the parent choice if the current question is the subquestion.

display_answer_on_order

boolean

optional

This object specifies whether to show the answer on the checkout screen or not.

The API call above returns a JSON object with all details of the question. Let’s create a question for an event:

Press + to interact
import requests
import json
url = 'https://www.eventbriteapi.com/v3/events/{{EVENT_ID}}/questions/'
headers = {
'Authorization': 'Bearer {{PRIVATE_TOKEN}}',
'Content-Type': 'application/json'
}
values = json.dumps({
"question": {
"question": {
"html": "Ticketing Terms of Service: I acknowledge that..."
},
"required": True,
"type": "checkbox",
"choices": [{
"answer": {
"html": "yes"
}
}],
"ticket_classes": [
{
"id": "{{TICKET_CLASS_ID}}"
}
]
}
})
response = requests.request("POST", url, headers=headers, data=values).json()
print(json.dumps(response, indent=4))

We can create the question types checkbox, dropdown, and radio in the same way, and in such questions, the attendee has to select the answer from multiple answers. A sample format is given below to add multiple answers:

Press + to interact
{
"question": {
"question": {
"html": "Question statement goes here..."
},
"required": True,
"type": "checkbox",
"choices": [
{
"answer": {
"html": "Choice goes here..."
}
},
{
"answer": {
"html": "Another choice goes here..."
}
}
],
"ticket_classes": [{
"id": "{{TICKET_CLASS_ID}}"
}
]}
}

Retrieve an event’s custom questions

We can retrieve the list of the custom questions of an event using the following URL, which uses the GET method to call the API:

https://www.eventbriteapi.com/v3/events/{event_id}/questions/

It only takes {event_id} as an input parameter and returns a paginated response with a list of custom questions.

Press + to interact
import requests
import json
url = 'https://www.eventbriteapi.com/v3/events/{{EVENT_ID}}/questions/'
headers = {
'Authorization': 'Bearer {{PRIVATE_TOKEN}}'
}
response = requests.request("GET", url, headers=headers).json()
print(json.dumps(response, indent=4))

Delete custom question

We can delete a custom question by using the following URL which uses the DELETE method to call the API:

https://www.eventbriteapi.com/v3/events/{event_id}/questions/{question_id}/

It requires {event_id} and {question_id} to be provided in the URL while calling the API and returns a JSON object with one boolean attribute deleted or an error object.

Press + to interact
import requests
import json
url = 'https://www.eventbriteapi.com/v3/events/{{EVENT_ID}}/questions/{{QUESTION_ID}}/'
headers = {
'Authorization': 'Bearer {{PRIVATE_TOKEN}}'
}
response = requests.request("DELETE", url, headers=headers).json()
print(json.dumps(response, indent=4))