Ticket Tailor API
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Whether it’s your first event ever, or your biggest event yet, Ticket Tailor makes it simple to sell tickets online.
Getting started
Conventions
- The production API is found at:
https://api.tickettailor.com
. - All API requests are made via HTTPS. Only
TLSv1.2
and higher are supported. - All data in a response is JSON.
- Clients should include the header -
Accept: application/json
in their requests. - Currencies are represented by their [ISO 4217] Currency code (https://www.xe.com/iso4217.php).
- Currency values are always in cents (or equivalent), with no decimals.
Sign up
If you haven't already, create a Ticket Tailor account. When prompted, fill out details to create a box office. Api keys are associated to the box office, meaning an api key can only access data from the box office that issued it.
Authentication
# We only added a colon at the end of the API key
# because we do not need to add a password.
curl -X GET https://api.tickettailor.com/v1/orders \
-H 'Accept: application/json' \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
<?php
// Example using Guzzle
$headers = [
'Accept' => 'application/json',
];
// The second item of the array for the auth option
// is empty because we do not need to add a password.
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
try {
$response = $client->request(
'GET','https://api.tickettailor.com/v1/orders',
[
'headers' => $headers,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// Handle exception or api errors.
print_r($e->getMessage());
}
<?php
// Example using cURL
// We only added a colon at the end of the API key
// because we do not need to add a password.
$curlHandler = curl_init();
curl_setopt($curlHandler, CURLOPT_URL, 'https://api.tickettailor.com/v1/orders');
curl_setopt($curlHandler, CURLOPT_USERPWD, 'sk_1000_1000_VGlja2V0VGFpbG9y:');
$result = curl_exec($curlHandler);
curl_close($curlHandler);
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
# The third parameter is an empty string because we do not need to add a password.
resource = RestClient::Resource.new('https://api.tickettailor.com/v1/orders', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' ) response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
# The second parameter in the auth option is an empty string because we do not need to add a password.
response = requests.get('https://my.website.com/rest/path', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
The Ticket Tailor API uses API keys to authenticate requests. You can manage your API keys in your box office settings. Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username. You do not need to provide a password.
Pagination
Endpoints which enumerate objects support cursor-based (eg. or_1234
) pagination via the starting_after
and ending_before
parameters. Both parameters take an existing value and return objects in reverse chronological order. If both parameters are provided, only ending_before
is used.
Request Arguments | |
---|---|
ending_before optional |
Returns objects listed before the named object |
starting_after optional |
Returns objects listed after the named object |
limit optional |
Limits the number of results per-page.Maximum: 100 |
Errors
status: integer
error_code: string
message: string
The Ticket Tailor API returns conventional HTTP response codes to indicate the success or failure of an API request. For errors, the response will include additional information about what went wrong, encoded in the response as JSON.
Status | Error code | Message |
---|---|---|
400 | Bad Request | The request was invalid, often due to a missing a required parameter. |
401 | Unauthorized | Your request was not authenticated correctly. |
403 | Forbidden | You do not have permission to perform the request. |
404 | Not Found | The requested resource does not exist. |
422 | Validation error | A validation error occurred. |
429 | Too Many Requests | Too many requests hit the API too quickly. |
50X | Internal Server Error | An error occurred on Ticket Tailor's end with our API. |
Rate limiting
You can make up to 2000 requests per hour to each API. To see your current rate limit status, check the HTTP headers returned by any API request. If you’re running into this error frequently, or think you need a higher rate limit, drop us a line at hi@tickettailor.com.
Header | Name |
---|---|
X-Rate-Limit-Limit | The maximum number of requests that the consumer is permitted to make per hour. |
X-Rate-Limit-Remaining | The number of requests remaining in the current rate limit window. |
X-Rate-Limit-Reset | The number of seconds left in the current period. |
Retry-After | The number of seconds to wait until the rate limit window resets. This is only sent when the rate limit is reached. |
Order
List all orders
Code samples
# You can also use wget
curl -X GET /v1/orders \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/orders', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/orders', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/orders', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/orders
Returns a list of orders belonging to box office
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
created_at | query | integer | false | Unix timestamp filter that returns items with matched created_at value. |
created_at.gt | query | integer | false | Unix timestamp filter that returns items with created_at greater than given value. |
created_at.gte | query | integer | false | Unix timestamp filter that returns items with created_at greater than or equal given value. |
created_at.lt | query | integer | false | Unix timestamp filter that returns items with created_at less than given value. |
created_at.lte | query | integer | false | Unix timestamp filter that returns items with created_at less than or equal given value. |
starting_after | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch next page of results, use the last object id from the current result list, e.g. starting_after=or_223. |
ending_before | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch previous page of results, use the first object id from the current result list, e.g. ending_before=or_123. |
limit | query | string | false | The number of items to retrieve |
name | query | string | false | The first, last or full name of the buyer |
query | string | false | The email of the buyer | |
txn_id | query | string | false | The transaction id |
barcode | query | string | false | The ticket barcode |
event_id | query | string | false | The event id |
event_series_id | query | string | false | The event series id |
status | query | string | false | The order status |
referral_tag | query | string | false | The tag that tracks where sales originated |
Example responses
200 Response
{
"data": [
{
"object": "order",
"id": "or_737352",
"buyer_details": {
"address": {
"address_1": "The Queen's Walk",
"address_2": "Bishop's",
"address_3": "London",
"postal_code": "SE1 7PB"
},
"custom_questions": [],
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"name": "John Doe",
"phone": "07123456789"
},
"created_at": 1587042691,
"currency": {
"base_multiplier": 100,
"code": "gbp"
},
"event_summary": {
"id": "ev_40980",
"end_date": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Hackney Downs 2020 Tulip Festival",
"start_date": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 6:00 PM",
"iso": "2020-05-01T18:00:00+01:00",
"time": "18:00",
"timezone": "+01:00",
"unix": 1588352400
}
},
"issued_tickets": [
{
"object": "issued_ticket",
"id": "it_50198",
"barcode": "al4R5",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50198/42bf63ef2a055b91a62f",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50198/42bf63ef2a055b91a62f"
},
{
"object": "issued_ticket",
"id": "it_50199",
"barcode": "dx2Fv",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50199/633d33a7ff6eba30a565",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50199/633d33a7ff6eba30a565"
}
],
"line_items": [
{
"object": "line_item",
"id": "li_1505167",
"booking_fee": 0,
"description": "Free ticket",
"type": "ticket",
"total": 0,
"value": 0,
"quantity": 2
}
],
"payment_method": {
"external_id": "seller222@example.com",
"id": "pm_6691",
"instructions": null,
"name": null,
"type": "paypal"
},
"referral_tag": "website",
"refund_amount": 0,
"status": "completed",
"status_message": null,
"subtotal": 0,
"tax": 0,
"total": 0,
"txn_id": "ABCD1234"
}
],
"links": {
"next": "/v1/orders?starting_after=or_120",
"previous": "/v1/orders?ending_before=or_100"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [Order] | none |
»» object | string | none |
»» id | string | A unique identifier for the order |
»» buyer_details | object | Information buyer provided in the checkout |
»»» address | object | Information about buyer address |
»»»» address_1 | string¦null | First line of address |
»»»» address_2 | string¦null | Second line of address |
»»»» address_3 | string¦null | Third line of address |
»»»» postal_code | string¦null | Postal code, zip code or postcode |
»»» custom_questions | [object] | Buyer provided answers to custom questions in checkout |
»»»» question | string | none |
»»»» answer | string¦null | none |
string | Buyer email address | |
»»» first_name | string | Buyer first name |
»»» last_name | string | Buyer last name |
»»» name | string | Buyer full name |
»»» phone | string¦null | Buyer phone number |
»» created_at | integer | Order creation timestamp |
»» currency | object | Information about order currency |
»»» code | string | Currency used for purchase |
»»» base_multiplier | integer | Base multiplier for conversions |
»» event_summary | object | Short event summary this order was made for |
»»» id | string | ID of the event order belongs to |
»»» name | string | Name of the event |
»»» start_date | object | The start date for the event in various formats |
»»»» date | string | ISO-8601 date for the start of the event |
»»»» formatted | string | A formatted date string for the start of the event |
»»»» iso | string | ISO-8601 date and time for the start of the event |
»»»» time | string | Time for the start of the event |
»»»» timezone | string | Timezone offset for the start of the event |
»»»» unix | integer | Unix timestamp for the start of the event |
»»» end_date | object | The end date for the event in various formats |
»»»» date | string | ISO-8601 date for the end of the event |
»»»» formatted | string | A formatted date string for the end of the event |
»»»» iso | string | ISO-8601 date and time for the end of the event |
»»»» time | string | Time for the end of the event |
»»»» timezone | string | Timezone offset for the end of the event |
»»»» unix | integer | Unix timestamp for the end of the event |
»» issued_tickets | [IssuedTicket]¦null | Issued tickets for order |
»»» object | string | none |
»»» id | string | A unique identifier for the issued ticket |
»»» barcode | string | Barcode text value |
»»» barcode_url | string | URL to barcode image |
»»» checked_in | string | Returns whether or not issued ticket is checked in |
»»» created_at | integer | Timestamp when issued ticket was created |
»»» custom_questions | [any] | Buyer provided answers to custom questions in checkout |
»»»» question | string | none |
»»»» answer | string¦null | none |
»»» description | string | none |
string | The order email address | |
»»» event_id | string | ID of the event issued ticket belongs to |
»»» reference | string¦null | An external reference for imported tickets (via the API or Dashboard) |
»»» full_name | string¦null | Full name of attendee |
»»» first_name | string¦null | First name of attendee |
»»» last_name | string¦null | Last name of attendee |
»»» reservation | string¦null | Reservation from seating chart where applicable |
»»» status | string | none |
»»» source | string¦null | none |
»»» ticket_type_id | string | ID of the ticket type |
»»» updated_at | integer | Timestamp when issued ticket was last updated |
»»» voided_at | integer¦null | Timestamp when issued ticket was voided |
»»» order_id | string | A unique identifier for the order |
»»» qr_code_url | string | URL to QR code image |
»» line_items | [object] | none |
»»» object | string | none |
»»» id | string | A unique identifier for the basket item |
»»» booking_fee | integer | Optional booking fee which is charged per ticket type to the customer and the funds are paid to you. We would recommend charging no more than 10% of the ticket price. |
»»» description | string | Basket item description |
»»» type | string | ticket is a purchased ticket, transaction_charge is a transaction fee to orders. This is charged once per order as opposed to ticket booking fees which are charged once per ticket. void means ticket was voided after the purchase, tax is sales tax eg. VAT, gift_card is discount or voucher applied and donation is for donating value |
»»» total | integer | Total amount including tax for line item |
»»» value | integer | Amount without tax |
»»» quantity | integer | Amount of line item objects |
»» payment_method | PaymentMethod | none |
»»» external_id | string¦null | A unique identifier for the payment method |
»»» id | string¦null | A unique identifier for internal payment methods |
»»» type | string | The type of payment method |
»»» name | string¦null | Name of the payment method |
»»» instructions | string¦null | Instructions for the customer on how to pay. Used for offline payments. |
»» refund_amount | integer | none |
»» referral_tag | string¦null | A unique tag to track where sales originated |
»» status | string | Possible states of the order |
»» status_message | string¦null | Message associated with status. |
»» subtotal | integer | Sum without tax |
»» tax | integer | Tax sum |
»» total | integer | Total value of order |
»» total_paid | integer | Total amount paid for this order including tax |
»» txn_id | string¦null | A unique identifier for the transaction |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Enumerated Values
Property | Value |
---|---|
code | gbp |
code | usd |
code | eur |
code | sgd |
code | aud |
code | brl |
code | cad |
code | czk |
code | dkk |
code | hkd |
code | huf |
code | ils |
code | jpy |
code | myr |
code | mxn |
code | nok |
code | nzd |
code | php |
code | pln |
code | rub |
code | sek |
code | chf |
code | twd |
code | thb |
code | try |
checked_in | true |
checked_in | false |
status | valid |
status | void |
source | api |
source | dashboard_import |
type | ticket |
type | transaction_charge |
type | void |
type | tax |
type | gift_card |
type | donation |
type | stripe |
type | paypal |
type | offline |
type | operator |
type | no_cost |
status | completed |
status | pending |
status | cancelled |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Retrieve an order
Code samples
# You can also use wget
curl -X GET /v1/orders/{order_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/orders/{order_id}', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/orders/{order_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/orders/{order_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/orders/{order_id}
Returns an order belonging to the box office
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
order_id | path | string | true | The unique identifier for the order |
Example responses
200 Response
{
"object": "order",
"id": "or_737352",
"buyer_details": {
"address": {
"address_1": "The Queen's Walk",
"address_2": "Bishop's",
"address_3": "London",
"postal_code": "SE1 7PB"
},
"custom_questions": [],
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"name": "John Doe",
"phone": "07123456789"
},
"created_at": 1587042691,
"currency": {
"base_multiplier": 100,
"code": "gbp"
},
"event_summary": {
"id": "ev_40980",
"end_date": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Hackney Downs 2020 Tulip Festival",
"start_date": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 6:00 PM",
"iso": "2020-05-01T18:00:00+01:00",
"time": "18:00",
"timezone": "+01:00",
"unix": 1588352400
}
},
"issued_tickets": [
{
"object": "issued_ticket",
"id": "it_50198",
"barcode": "al4R5",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50198/42bf63ef2a055b91a62f",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50198/42bf63ef2a055b91a62f"
},
{
"object": "issued_ticket",
"id": "it_50199",
"barcode": "dx2Fv",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50199/633d33a7ff6eba30a565",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50199/633d33a7ff6eba30a565"
}
],
"line_items": [
{
"object": "line_item",
"id": "li_1505167",
"booking_fee": 0,
"description": "Free ticket",
"type": "ticket",
"total": 0,
"value": 0,
"quantity": 2
}
],
"payment_method": {
"external_id": "seller222@example.com",
"id": "pm_6691",
"instructions": null,
"name": null,
"type": "paypal"
},
"referral_tag": "website",
"refund_amount": 0,
"status": "completed",
"status_message": null,
"subtotal": 0,
"tax": 0,
"total": 0,
"txn_id": "ABCD1234"
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the order |
» buyer_details | object | Information buyer provided in the checkout |
»» address | object | Information about buyer address |
»»» address_1 | string¦null | First line of address |
»»» address_2 | string¦null | Second line of address |
»»» address_3 | string¦null | Third line of address |
»»» postal_code | string¦null | Postal code, zip code or postcode |
»» custom_questions | [object] | Buyer provided answers to custom questions in checkout |
»»» question | string | none |
»»» answer | string¦null | none |
string | Buyer email address | |
»» first_name | string | Buyer first name |
»» last_name | string | Buyer last name |
»» name | string | Buyer full name |
»» phone | string¦null | Buyer phone number |
» created_at | integer | Order creation timestamp |
» currency | object | Information about order currency |
»» code | string | Currency used for purchase |
»» base_multiplier | integer | Base multiplier for conversions |
» event_summary | object | Short event summary this order was made for |
»» id | string | ID of the event order belongs to |
»» name | string | Name of the event |
»» start_date | object | The start date for the event in various formats |
»»» date | string | ISO-8601 date for the start of the event |
»»» formatted | string | A formatted date string for the start of the event |
»»» iso | string | ISO-8601 date and time for the start of the event |
»»» time | string | Time for the start of the event |
»»» timezone | string | Timezone offset for the start of the event |
»»» unix | integer | Unix timestamp for the start of the event |
»» end_date | object | The end date for the event in various formats |
»»» date | string | ISO-8601 date for the end of the event |
»»» formatted | string | A formatted date string for the end of the event |
»»» iso | string | ISO-8601 date and time for the end of the event |
»»» time | string | Time for the end of the event |
»»» timezone | string | Timezone offset for the end of the event |
»»» unix | integer | Unix timestamp for the end of the event |
» issued_tickets | [IssuedTicket]¦null | Issued tickets for order |
»» object | string | none |
»» id | string | A unique identifier for the issued ticket |
»» barcode | string | Barcode text value |
»» barcode_url | string | URL to barcode image |
»» checked_in | string | Returns whether or not issued ticket is checked in |
»» created_at | integer | Timestamp when issued ticket was created |
»» custom_questions | [any] | Buyer provided answers to custom questions in checkout |
»»» question | string | none |
»»» answer | string¦null | none |
»» description | string | none |
string | The order email address | |
»» event_id | string | ID of the event issued ticket belongs to |
»» reference | string¦null | An external reference for imported tickets (via the API or Dashboard) |
»» full_name | string¦null | Full name of attendee |
»» first_name | string¦null | First name of attendee |
»» last_name | string¦null | Last name of attendee |
»» reservation | string¦null | Reservation from seating chart where applicable |
»» status | string | none |
»» source | string¦null | none |
»» ticket_type_id | string | ID of the ticket type |
»» updated_at | integer | Timestamp when issued ticket was last updated |
»» voided_at | integer¦null | Timestamp when issued ticket was voided |
»» order_id | string | A unique identifier for the order |
»» qr_code_url | string | URL to QR code image |
» line_items | [object] | none |
»» object | string | none |
»» id | string | A unique identifier for the basket item |
»» booking_fee | integer | Optional booking fee which is charged per ticket type to the customer and the funds are paid to you. We would recommend charging no more than 10% of the ticket price. |
»» description | string | Basket item description |
»» type | string | ticket is a purchased ticket, transaction_charge is a transaction fee to orders. This is charged once per order as opposed to ticket booking fees which are charged once per ticket. void means ticket was voided after the purchase, tax is sales tax eg. VAT, gift_card is discount or voucher applied and donation is for donating value |
»» total | integer | Total amount including tax for line item |
»» value | integer | Amount without tax |
»» quantity | integer | Amount of line item objects |
» payment_method | PaymentMethod | none |
»» external_id | string¦null | A unique identifier for the payment method |
»» id | string¦null | A unique identifier for internal payment methods |
»» type | string | The type of payment method |
»» name | string¦null | Name of the payment method |
»» instructions | string¦null | Instructions for the customer on how to pay. Used for offline payments. |
» refund_amount | integer | none |
» referral_tag | string¦null | A unique tag to track where sales originated |
» status | string | Possible states of the order |
» status_message | string¦null | Message associated with status. |
» subtotal | integer | Sum without tax |
» tax | integer | Tax sum |
» total | integer | Total value of order |
» total_paid | integer | Total amount paid for this order including tax |
» txn_id | string¦null | A unique identifier for the transaction |
Enumerated Values
Property | Value |
---|---|
code | gbp |
code | usd |
code | eur |
code | sgd |
code | aud |
code | brl |
code | cad |
code | czk |
code | dkk |
code | hkd |
code | huf |
code | ils |
code | jpy |
code | myr |
code | mxn |
code | nok |
code | nzd |
code | php |
code | pln |
code | rub |
code | sek |
code | chf |
code | twd |
code | thb |
code | try |
checked_in | true |
checked_in | false |
status | valid |
status | void |
source | api |
source | dashboard_import |
type | ticket |
type | transaction_charge |
type | void |
type | tax |
type | gift_card |
type | donation |
type | stripe |
type | paypal |
type | offline |
type | operator |
type | no_cost |
status | completed |
status | pending |
status | cancelled |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Event
List all events
Code samples
# You can also use wget
curl -X GET /v1/events \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/events', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/events', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/events', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/events
Returns a list of events belonging to the box office
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
start_at | query | integer | false | Unix timestamp filter that returns items with matched start_at value. |
start_at.gt | query | integer | false | Unix timestamp filter that returns items with start_at greater than given value. |
start_at.gte | query | integer | false | Unix timestamp filter that returns items with start_at greater than or equal given value. |
start_at.lt | query | integer | false | Unix timestamp filter that returns items with start_at less than given value. |
start_at.lte | query | integer | false | Unix timestamp filter that returns items with start_at less than or equal given value. |
end_at | query | integer | false | Unix timestamp filter that returns items with matched end_at value. |
end_at.gt | query | integer | false | Unix timestamp filter that returns items with end_at greater than given value. |
end_at.gte | query | integer | false | Unix timestamp filter that returns items with end_at greater than or equal given value. |
end_at.lt | query | integer | false | Unix timestamp filter that returns items with end_at less than given value. |
end_at.lte | query | integer | false | Unix timestamp filter that returns items with end_at less than or equal given value. |
starting_after | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch next page of results, use the last object id from the current result list, e.g. starting_after=or_223. |
ending_before | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch previous page of results, use the first object id from the current result list, e.g. ending_before=or_123. |
limit | query | string | false | The number of items to retrieve |
status | query | string | false | A comma separated list of event series status. (e.g. draft,published) |
Example responses
200 Response
{
"data": [
{
"object": "event",
"id": "ev_1",
"access_code": null,
"call_to_action": "Buy tickets / Join the guestlist",
"created_at": 1583771084,
"currency": "gbp",
"description": null,
"end": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"hidden": "false",
"images": {
"header": "https://d37ecpm5it19bz.cloudfront.net/c_crop,dpr_1.0,h_1921,q_100,w_1922,x_479,y_0/c_scale,g_center,h_326,q_85,w_1024/v1/stitching/userfiles/acfi9eknr1vur6wguu5s.jpg",
"thumbnail": "https://d37ecpm5it19bz.cloudfront.net/c_crop,dpr_1.0,h_1921,q_100,w_1922,x_479,y_0/c_scale,h_108,q_85,w_108/v1/stitching/userfiles/acfi9eknr1vur6wguu5s.jpg"
},
"name": "Hackney Downs 2020 Tulip Festival",
"online_event": "false",
"payment_methods": [
{
"external_id": null,
"id": "pm_6687",
"instructions": "Pay when you arrive to festival",
"name": "Pay on the door",
"type": "offline"
},
{
"external_id": "seller222@example.com",
"id": "pm_6691",
"instructions": null,
"name": null,
"type": "paypal"
}
],
"private": "false",
"start": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 6:00 PM",
"iso": "2020-05-01T18:00:00+01:00",
"time": "18:00",
"timezone": "+01:00",
"unix": 1588352400
},
"status": "published",
"ticket_groups": [
{
"id": "tg_21099",
"max_per_order": null,
"name": "April 20th",
"sort_order": 50050,
"ticket_ids": [
"tt_230625",
"tt_230626"
]
},
{
"id": "tg_21100",
"max_per_order": null,
"name": "April 21st",
"sort_order": 50100,
"ticket_ids": [
"tt_230631",
"tt_230632"
]
}
],
"ticket_types": [
{
"object": "ticket_type",
"id": "tt_230625",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21099",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.20 Adult (13-61) - Presale",
"price": 800,
"status": "hidden",
"sort_order": 50050,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 5000,
"quantity_total": 15000
},
{
"object": "ticket_type",
"id": "tt_230626",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21099",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.20 Senior (62+) - Presale",
"price": 600,
"status": "on_sale",
"sort_order": 50051,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 2000,
"quantity_total": 12000
},
{
"object": "ticket_type",
"id": "tt_230631",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21100",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.21 Adult (13-61) - Presale",
"price": 800,
"status": "on_sale",
"sort_order": 50100,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 4000,
"quantity_total": 14000
},
{
"object": "ticket_type",
"id": "tt_230632",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21100",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.21 Senior (62+) - Presale",
"price": 600,
"status": "on_sale",
"sort_order": 50101,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 1000,
"quantity_total": 11000
}
],
"tickets_available": "true",
"timezone": "Europe/London",
"total_holds": 0,
"total_issued_tickets": 2,
"total_orders": 1,
"unavailable": "false",
"unavailable_status": null,
"url": "https://www.tickettailor.com/events/flowerfestival/40980",
"venue": {
"name": null,
"postal_code": null
}
}
],
"links": {
"next": "/v1/events?starting_after=ev_123",
"previous": "/v1/events?ending_before=ev_100"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [Event] | none |
»» object | string | none |
»» id | string | A unique identifier for the event |
»» access_code | string¦null | Code to access a protected event |
»» call_to_action | string | Call to action text used on the event page |
»» created_at | integer | none |
»» currency | string | Information about the currency the event is configured to use |
»» description | string¦null | Description of the event |
»» end | object | none |
»»» date | string | ISO-8601 date for the end of the event |
»»» formatted | string | A formatted date string for the end of the event |
»»» iso | string | ISO-8601 date and time for the end of the event |
»»» time | string | Time of the end of the event |
»»» timezone | string | Timezone offset for the end of the event |
»»» unix | integer | Unix timestamp for for the end of the event |
»» event_series_id | string | Recurring events are grouped by an event_series_id |
»» hidden | string | True, if event is set to hidden |
»» images | object | Images that have been uploaded to this event |
»»» header | string | Image URL of the header image used on your event page |
»»» thumbnail | string | Image URL of the thumbnail used on your event page |
»» name | string | Name of the event |
»» online_event | string | Returns whether or not the event is online |
»» payment_methods | [any] | none |
»»» external_id | string | A unique identifier for the payment method |
»»» id | string | A unique identifier for internal payment methods |
»»» type | string | The type of payment method |
»»» name | string | Name of the payment method |
»»» instructions | string | Instructions for the customer on how to pay. Used for offline payments. |
»» private | string | Returns whether or not the event is private |
»» start | object | none |
»»» date | string | ISO-8601 date for the start of the event |
»»» formatted | string | A formatted date string for the start of the event |
»»» iso | string | ISO-8601 date and time for the start of the event |
»»» time | string | Time of the start of the event |
»»» timezone | string | Timezone offset for the start of the event |
»»» unix | integer | Unix timestamp for the start of the event |
»» status | string | Status of the event |
»» ticket_groups | [any] | none |
»»» id | string | A unique ticket group identifier |
»»» max_per_order | integer | Maximum number of ticket types that this group can sell |
»»» name | string | Name of the ticket types group |
»»» sort_order | integer | Sort index of the group in the UI |
»»» ticket_ids | [any] | Unique identifiers of ticket type ids that belong to this group |
»»»» id | string | none |
»» ticket_types | [TicketType]¦null | none |
»»» object | string | none |
»»» id | string | A unique identifier for the ticket type |
»»» access_code | string¦null | Code to access a hidden ticket |
»»» booking_fee | integer | Optional booking fee which is charged per ticket type to the customer and the funds are paid to you. We would recommend charging no more than 10% of the ticket price. |
»»» description | string¦null | Description of the ticket type |
»»» group_id | string¦null | ID of the group this ticket type belongs to |
»»» max_per_order | integer | Maximum number of ticket types you can select per order |
»»» min_per_order | integer | Minimum number of ticket types you can select per order |
»»» name | string | Name of the ticket type |
»»» price | integer | Cost of the ticket type |
»»» status | string | Status of the ticket type |
»»» sort_order | integer | Sort index of ticket type in the UI |
»»» type | string | none |
»»» quantity | integer | Number available for purchase |
»»» quantity_held | integer | Number held |
»»» quantity_issued | integer | Number issued |
»»» quantity_total | integer | Total number including issued and still available |
»» tickets_available | string¦null | Are there any ticket types available? |
»» timezone | string | TZ format timezone string |
»» total_holds | integer | Total number of holds |
»» total_issued_tickets | integer | Total number of issued tickets |
»» total_orders | integer | Total number of orders |
»» unavailable | string | True, if event is set to unavailable |
»» unavailable_status | string¦null | optional custom status message when event is set to be unavailable |
»» url | string | Event page URL |
»» venue | object | none |
»»» name | string | Name of the venue |
»»» postal_code | string | Postal code of the venue |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Enumerated Values
Property | Value |
---|---|
currency | gbp |
currency | usd |
currency | eur |
currency | sgd |
currency | aud |
currency | brl |
currency | cad |
currency | czk |
currency | dkk |
currency | hkd |
currency | huf |
currency | ils |
currency | jpy |
currency | myr |
currency | mxn |
currency | nok |
currency | nzd |
currency | php |
currency | pln |
currency | rub |
currency | sek |
currency | chf |
currency | twd |
currency | thb |
currency | try |
hidden | true |
hidden | false |
online_event | true |
online_event | false |
type | stripe |
type | paypal |
type | offline |
private | true |
private | false |
status | draft |
status | published |
status | sales_closed |
status | on_sale |
status | sold_out |
status | unavailable |
status | hidden |
status | admin_only |
status | locked |
type | paid |
type | free |
tickets_available | true |
tickets_available | false |
unavailable | true |
unavailable | false |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Retrieve an event
Code samples
# You can also use wget
curl -X GET /v1/events/{event_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/events/{event_id}', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/events/{event_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/events/{event_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/events/{event_id}
Returns an event belonging to the box office
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
event_id | path | string | true | The unique identifier for the event |
Example responses
200 Response
{
"object": "event",
"id": "ev_1",
"access_code": null,
"call_to_action": "Buy tickets / Join the guestlist",
"created_at": 1583771084,
"currency": "gbp",
"description": null,
"end": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"hidden": "false",
"images": {
"header": "https://d37ecpm5it19bz.cloudfront.net/c_crop,dpr_1.0,h_1921,q_100,w_1922,x_479,y_0/c_scale,g_center,h_326,q_85,w_1024/v1/stitching/userfiles/acfi9eknr1vur6wguu5s.jpg",
"thumbnail": "https://d37ecpm5it19bz.cloudfront.net/c_crop,dpr_1.0,h_1921,q_100,w_1922,x_479,y_0/c_scale,h_108,q_85,w_108/v1/stitching/userfiles/acfi9eknr1vur6wguu5s.jpg"
},
"name": "Hackney Downs 2020 Tulip Festival",
"online_event": "false",
"payment_methods": [
{
"external_id": null,
"id": "pm_6687",
"instructions": "Pay when you arrive to festival",
"name": "Pay on the door",
"type": "offline"
},
{
"external_id": "seller222@example.com",
"id": "pm_6691",
"instructions": null,
"name": null,
"type": "paypal"
}
],
"private": "false",
"start": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 6:00 PM",
"iso": "2020-05-01T18:00:00+01:00",
"time": "18:00",
"timezone": "+01:00",
"unix": 1588352400
},
"status": "published",
"ticket_groups": [
{
"id": "tg_21099",
"max_per_order": null,
"name": "April 20th",
"sort_order": 50050,
"ticket_ids": [
"tt_230625",
"tt_230626"
]
},
{
"id": "tg_21100",
"max_per_order": null,
"name": "April 21st",
"sort_order": 50100,
"ticket_ids": [
"tt_230631",
"tt_230632"
]
}
],
"ticket_types": [
{
"object": "ticket_type",
"id": "tt_230625",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21099",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.20 Adult (13-61) - Presale",
"price": 800,
"status": "hidden",
"sort_order": 50050,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 5000,
"quantity_total": 15000
},
{
"object": "ticket_type",
"id": "tt_230626",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21099",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.20 Senior (62+) - Presale",
"price": 600,
"status": "on_sale",
"sort_order": 50051,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 2000,
"quantity_total": 12000
},
{
"object": "ticket_type",
"id": "tt_230631",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21100",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.21 Adult (13-61) - Presale",
"price": 800,
"status": "on_sale",
"sort_order": 50100,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 4000,
"quantity_total": 14000
},
{
"object": "ticket_type",
"id": "tt_230632",
"access_code": null,
"booking_fee": 0,
"description": null,
"group_id": "tg_21100",
"max_per_order": 100,
"min_per_order": 1,
"name": "4.21 Senior (62+) - Presale",
"price": 600,
"status": "on_sale",
"sort_order": 50101,
"type": "paid",
"quantity": 10000,
"quantity_held": 0,
"quantity_issued": 1000,
"quantity_total": 11000
}
],
"tickets_available": "true",
"timezone": "Europe/London",
"total_holds": 0,
"total_issued_tickets": 2,
"total_orders": 1,
"unavailable": "false",
"unavailable_status": null,
"url": "https://www.tickettailor.com/events/flowerfestival/40980",
"venue": {
"name": null,
"postal_code": null
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the event |
» access_code | string¦null | Code to access a protected event |
» call_to_action | string | Call to action text used on the event page |
» created_at | integer | none |
» currency | string | Information about the currency the event is configured to use |
» description | string¦null | Description of the event |
» end | object | none |
»» date | string | ISO-8601 date for the end of the event |
»» formatted | string | A formatted date string for the end of the event |
»» iso | string | ISO-8601 date and time for the end of the event |
»» time | string | Time of the end of the event |
»» timezone | string | Timezone offset for the end of the event |
»» unix | integer | Unix timestamp for for the end of the event |
» event_series_id | string | Recurring events are grouped by an event_series_id |
» hidden | string | True, if event is set to hidden |
» images | object | Images that have been uploaded to this event |
»» header | string | Image URL of the header image used on your event page |
»» thumbnail | string | Image URL of the thumbnail used on your event page |
» name | string | Name of the event |
» online_event | string | Returns whether or not the event is online |
» payment_methods | [any] | none |
»» external_id | string | A unique identifier for the payment method |
»» id | string | A unique identifier for internal payment methods |
»» type | string | The type of payment method |
»» name | string | Name of the payment method |
»» instructions | string | Instructions for the customer on how to pay. Used for offline payments. |
» private | string | Returns whether or not the event is private |
» start | object | none |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time of the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» status | string | Status of the event |
» ticket_groups | [any] | none |
»» id | string | A unique ticket group identifier |
»» max_per_order | integer | Maximum number of ticket types that this group can sell |
»» name | string | Name of the ticket types group |
»» sort_order | integer | Sort index of the group in the UI |
»» ticket_ids | [any] | Unique identifiers of ticket type ids that belong to this group |
»»» id | string | none |
» ticket_types | [TicketType]¦null | none |
»» object | string | none |
»» id | string | A unique identifier for the ticket type |
»» access_code | string¦null | Code to access a hidden ticket |
»» booking_fee | integer | Optional booking fee which is charged per ticket type to the customer and the funds are paid to you. We would recommend charging no more than 10% of the ticket price. |
»» description | string¦null | Description of the ticket type |
»» group_id | string¦null | ID of the group this ticket type belongs to |
»» max_per_order | integer | Maximum number of ticket types you can select per order |
»» min_per_order | integer | Minimum number of ticket types you can select per order |
»» name | string | Name of the ticket type |
»» price | integer | Cost of the ticket type |
»» status | string | Status of the ticket type |
»» sort_order | integer | Sort index of ticket type in the UI |
»» type | string | none |
»» quantity | integer | Number available for purchase |
»» quantity_held | integer | Number held |
»» quantity_issued | integer | Number issued |
»» quantity_total | integer | Total number including issued and still available |
» tickets_available | string¦null | Are there any ticket types available? |
» timezone | string | TZ format timezone string |
» total_holds | integer | Total number of holds |
» total_issued_tickets | integer | Total number of issued tickets |
» total_orders | integer | Total number of orders |
» unavailable | string | True, if event is set to unavailable |
» unavailable_status | string¦null | optional custom status message when event is set to be unavailable |
» url | string | Event page URL |
» venue | object | none |
»» name | string | Name of the venue |
»» postal_code | string | Postal code of the venue |
Enumerated Values
Property | Value |
---|---|
currency | gbp |
currency | usd |
currency | eur |
currency | sgd |
currency | aud |
currency | brl |
currency | cad |
currency | czk |
currency | dkk |
currency | hkd |
currency | huf |
currency | ils |
currency | jpy |
currency | myr |
currency | mxn |
currency | nok |
currency | nzd |
currency | php |
currency | pln |
currency | rub |
currency | sek |
currency | chf |
currency | twd |
currency | thb |
currency | try |
hidden | true |
hidden | false |
online_event | true |
online_event | false |
type | stripe |
type | paypal |
type | offline |
private | true |
private | false |
status | draft |
status | published |
status | sales_closed |
status | on_sale |
status | sold_out |
status | unavailable |
status | hidden |
status | admin_only |
status | locked |
type | paid |
type | free |
tickets_available | true |
tickets_available | false |
unavailable | true |
unavailable | false |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Issued ticket
List all issued tickets
Code samples
# You can also use wget
curl -X GET /v1/issued_tickets \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/issued_tickets', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/issued_tickets', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/issued_tickets', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/issued_tickets
Returns all issued tickets
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
event_id | query | integer | false | The numeric ID of the event to filter issued tickets for |
order_id | query | integer | false | The numeric ID of the order to filter issued tickets for |
barcode | query | string | false | The barcode of the issued ticket (event_id must also be specified) |
name | query | string | false | The name of the person attending an event |
query | string | false | The email of the person attending an event | |
status | query | string | false | The status of the issued ticket |
created_at | query | integer | false | Unix timestamp filter that returns items with matched created_at value. |
created_at.gt | query | integer | false | Unix timestamp filter that returns items with created_at greater than given value. |
created_at.gte | query | integer | false | Unix timestamp filter that returns items with created_at greater than or equal given value. |
created_at.lt | query | integer | false | Unix timestamp filter that returns items with created_at less than given value. |
created_at.lte | query | integer | false | Unix timestamp filter that returns items with created_at less than or equal given value. |
starting_after | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch next page of results, use the last object id from the current result list, e.g. starting_after=or_223. |
ending_before | query | string | false | A paginator cursor value of object id (e.g. "or_123") that defines place in the list. To fetch previous page of results, use the first object id from the current result list, e.g. ending_before=or_123. |
limit | query | string | false | The number of items to retrieve |
Enumerated Values
Parameter | Value |
---|---|
status | valid |
status | voided |
Example responses
200 Response
{
"data": [
{
"object": "issued_ticket",
"id": "it_50198",
"barcode": "al4R5",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50198/42bf63ef2a055b91a62f",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50198/42bf63ef2a055b91a62f"
}
],
"links": {
"next": "/v1/events/{event_id}/issued_tickets?starting_after=it_120",
"previous": "/v1/events/{event_id}/issued_tickets?ending_before=it_100"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [IssuedTicket] | none |
»» object | string | none |
»» id | string | A unique identifier for the issued ticket |
»» barcode | string | Barcode text value |
»» barcode_url | string | URL to barcode image |
»» checked_in | string | Returns whether or not issued ticket is checked in |
»» created_at | integer | Timestamp when issued ticket was created |
»» custom_questions | [any] | Buyer provided answers to custom questions in checkout |
»»» question | string | none |
»»» answer | string¦null | none |
»» description | string | none |
string | The order email address | |
»» event_id | string | ID of the event issued ticket belongs to |
»» reference | string¦null | An external reference for imported tickets (via the API or Dashboard) |
»» full_name | string¦null | Full name of attendee |
»» first_name | string¦null | First name of attendee |
»» last_name | string¦null | Last name of attendee |
»» reservation | string¦null | Reservation from seating chart where applicable |
»» status | string | none |
»» source | string¦null | none |
»» ticket_type_id | string | ID of the ticket type |
»» updated_at | integer | Timestamp when issued ticket was last updated |
»» voided_at | integer¦null | Timestamp when issued ticket was voided |
»» order_id | string | A unique identifier for the order |
»» qr_code_url | string | URL to QR code image |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Enumerated Values
Property | Value |
---|---|
checked_in | true |
checked_in | false |
status | valid |
status | void |
source | api |
source | dashboard_import |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Issue a ticket
Code samples
# You can also use wget
curl -X POST /v1/issued_tickets \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/issued_tickets', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/issued_tickets', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/issued_tickets', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/issued_tickets
Creates a new ticket for an event, without an associated order, from the available inventory of the specified event/ticket type. This will NOT send an email to the recipient with the issued ticket details. The request will fail if no tickets are available to fulfil the request, or the ticket type is a 'seated' type (uses a seating chart).
Body parameter
event_id: ev_1
ticket_type_id: tt_230656
email: john@example.com
full_name: John Doe
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» event_id | body | string | true | Event identifier |
» ticket_type_id | body | string | true | ID of the ticket type |
» full_name | body | string | true | The full name of the person attending the event |
body | string | false | The email of the person attending the event | |
» barcode | body | string | false | The barcode (ticket code) of the issued ticket (if empty, a barcode will be generated). |
» reference | body | string | false | An external reference for this issued ticket (e.g order number in external system) |
Example responses
201 Response
{
"data": [
{
"object": "issued_ticket",
"id": "it_50198",
"barcode": "al4R5",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50198/42bf63ef2a055b91a62f",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50198/42bf63ef2a055b91a62f"
}
]
}
Response Schema
Status Code 201
Name | Type | Description |
---|---|---|
» data | [IssuedTicket] | none |
»» object | string | none |
»» id | string | A unique identifier for the issued ticket |
»» barcode | string | Barcode text value |
»» barcode_url | string | URL to barcode image |
»» checked_in | string | Returns whether or not issued ticket is checked in |
»» created_at | integer | Timestamp when issued ticket was created |
»» custom_questions | [any] | Buyer provided answers to custom questions in checkout |
»»» question | string | none |
»»» answer | string¦null | none |
»» description | string | none |
string | The order email address | |
»» event_id | string | ID of the event issued ticket belongs to |
»» reference | string¦null | An external reference for imported tickets (via the API or Dashboard) |
»» full_name | string¦null | Full name of attendee |
»» first_name | string¦null | First name of attendee |
»» last_name | string¦null | Last name of attendee |
»» reservation | string¦null | Reservation from seating chart where applicable |
»» status | string | none |
»» source | string¦null | none |
»» ticket_type_id | string | ID of the ticket type |
»» updated_at | integer | Timestamp when issued ticket was last updated |
»» voided_at | integer¦null | Timestamp when issued ticket was voided |
»» order_id | string | A unique identifier for the order |
»» qr_code_url | string | URL to QR code image |
Enumerated Values
Property | Value |
---|---|
checked_in | true |
checked_in | false |
status | valid |
status | void |
source | api |
source | dashboard_import |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Retrieve an issued ticket
Code samples
# You can also use wget
curl -X GET /v1/issued_tickets/{issued_ticket_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/issued_tickets/{issued_ticket_id}', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/issued_tickets/{issued_ticket_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/issued_tickets/{issued_ticket_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/issued_tickets/{issued_ticket_id}
Returns an issued ticket
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
issued_ticket_id | path | string | true | The unique identifier for the issued ticket |
Example responses
200 Response
{
"object": "issued_ticket",
"id": "it_50198",
"barcode": "al4R5",
"barcode_url": "https://www.tickettailor.com/userfiles/cache/barcode/qr/attendee/50198/42bf63ef2a055b91a62f",
"checked_in": "false",
"created_at": 1587042697,
"custom_questions": [],
"description": "Free ticket",
"email": "john@example.com",
"event_id": "ev_40980",
"reference": "my reference code",
"full_name": null,
"first_name": null,
"last_name": null,
"status": "valid",
"source": "api",
"ticket_type_id": "tt_230656",
"updated_at": 1587042697,
"voided_at": null,
"order_id": "or_737352",
"qr_code_url": "https://www.tickettailor.com/userfiles/cache/barcode/st/attendee/50198/42bf63ef2a055b91a62f"
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the issued ticket |
» barcode | string | Barcode text value |
» barcode_url | string | URL to barcode image |
» checked_in | string | Returns whether or not issued ticket is checked in |
» created_at | integer | Timestamp when issued ticket was created |
» custom_questions | [any] | Buyer provided answers to custom questions in checkout |
»» question | string | none |
»» answer | string¦null | none |
» description | string | none |
string | The order email address | |
» event_id | string | ID of the event issued ticket belongs to |
» reference | string¦null | An external reference for imported tickets (via the API or Dashboard) |
» full_name | string¦null | Full name of attendee |
» first_name | string¦null | First name of attendee |
» last_name | string¦null | Last name of attendee |
» reservation | string¦null | Reservation from seating chart where applicable |
» status | string | none |
» source | string¦null | none |
» ticket_type_id | string | ID of the ticket type |
» updated_at | integer | Timestamp when issued ticket was last updated |
» voided_at | integer¦null | Timestamp when issued ticket was voided |
» order_id | string | A unique identifier for the order |
» qr_code_url | string | URL to QR code image |
Enumerated Values
Property | Value |
---|---|
checked_in | true |
checked_in | false |
status | valid |
status | void |
source | api |
source | dashboard_import |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Void an issued ticket
Code samples
# You can also use wget
curl -X POST /v1/issued_tickets/{issued_ticket_id}/void \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/issued_tickets/{issued_ticket_id}/void', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/issued_tickets/{issued_ticket_id}/void', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/issued_tickets/{issued_ticket_id}/void', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/issued_tickets/{issued_ticket_id}/void
Mark an issued ticket as voided. This action is irreversible. This will only mark the ticket as voided (no longer valid) and will not cancel an entire order or issue a refund. Learn more about voiding an issued ticket.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
issued_ticket_id | path | string | true | The unique identifier for the issued ticket |
Example responses
200 Response
{
"id": "it_123",
"object": "issued_ticket",
"voided": true
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» id | string | ID of the voided ticket |
» object | string | none |
» voided | string | Voiding operation successful or not |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Ping
Ping server
Code samples
# You can also use wget
curl -X GET /v1/ping \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/ping', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/ping', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/ping', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/ping
Checks if server is responsive
Example responses
200 Response
{
"version": "pong"
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» version | string | none |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Discount code
Get list of discounts
Code samples
# You can also use wget
curl -X GET /v1/discounts \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/discounts', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/discounts', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/discounts', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/discounts
Returns the paginated list of links for the discounts, filtered by code and limit
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | query | string | false | The number of items to retrieve |
code | query | string | false | A string representing the discount code filter |
Example responses
200 Response
{
"data": [
{
"object": "discount",
"id": "di_123",
"code": "discount_test123",
"max_redemptions": 5,
"name": "Test discount",
"price": 540,
"ticket_types": [
"tt_123",
"tt_456",
"tt_78"
],
"times_redeemed": 3,
"type": "fixed_amount"
},
{
"object": "discount",
"id": "di_234",
"code": "discount_test123",
"expires": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"max_redemptions": 2,
"name": "Another test discount",
"price_percent": 5,
"ticket_types": [],
"times_redeemed": 2,
"type": "percentage"
}
],
"links": {
"next": "/v1/discounts?starting_after=di_123",
"previous": "/v1/discounts?ending_before=di_234"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [object] | none |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Create new discount code
Code samples
# You can also use wget
curl -X POST /v1/discounts \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/discounts', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/discounts', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/discounts', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/discounts
Creates a new discount code that can be used on checkout.
Body parameter
code: discount_test123
expires: 1588368600
max_redemptions: 5
name: Test discount
price: 540
ticket_types:
- tt_123
- tt_456
- tt_78
type: fixed_amount
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» booking_fee | body | integer¦null | false | Booking fee amount in cents. Could be null. |
» booking_fee_percent | body | integer¦null | false | Percent of the booking fee. Could be null. |
» code | body | string | true | Discount code |
» expires | body | integer¦null | false | Discount code's expiry date as Unix timestamp |
» max_redemptions | body | integer¦null | true | The maximum number of times this discount can be used. |
» name | body | string | true | A descriptive name given to the discount |
» price | body | integer¦null | false | Price in cents. Could be null. |
» price_percent | body | integer¦null | false | Percent of the price. Could be null. |
» ticket_types | body | [string] | false | An array of associated ticket types. |
» type | body | string | true | Type of discount. Either a fixed amount or a percentage |
Enumerated Values
Parameter | Value |
---|---|
» type | fixed_amount |
» type | percentage |
Example responses
201 Response
{
"object": "discount",
"id": "di_123",
"code": "discount_test123",
"expires": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"max_redemptions": 5,
"name": "Test discount",
"price": 540,
"ticket_types": [
"tt_78",
"tt_123",
"tt_456"
],
"times_redeemed": 3,
"type": "fixed_amount"
}
Response Schema
Status Code 201
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the discount |
» booking_fee | integer¦null | Booking fee amount in cents. Could be null. |
» booking_fee_percent | integer¦null | Percent of the booking fee. Could be null. |
» code | string | Discount code |
» expires | object¦null | Discount code's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» max_redemptions | integer¦null | The maximum number of times this discount can be used. |
» name | string | A descriptive name given to the discount |
» price | integer¦null | Price in cents. Could be null. |
» price_percent | integer¦null | Percent of the price. Could be null. |
» ticket_types | [string] | An array of associated ticket types. |
» times_redeemed | integer¦null | The number of times that the discount was used |
» type | string | Type of discount. Either a fixed amount or a percentage |
Enumerated Values
Property | Value |
---|---|
type | fixed_amount |
type | percentage |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
View single discount
Code samples
# You can also use wget
curl -X GET /v1/discounts/{discount_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/discounts/{discount_id}', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/discounts/{discount_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/discounts/{discount_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/discounts/{discount_id}
Find the existing discount by ID and view it
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
discount_id | path | string | true | The unique identifier for the existing discount |
Example responses
200 Response
{
"object": "discount",
"id": "di_123",
"code": "discount_test123",
"expires": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"max_redemptions": 5,
"name": "Test discount",
"price": 540,
"ticket_types": [
"tt_78",
"tt_123",
"tt_456"
],
"times_redeemed": 3,
"type": "fixed_amount"
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the discount |
» booking_fee | integer¦null | Booking fee amount in cents. Could be null. |
» booking_fee_percent | integer¦null | Percent of the booking fee. Could be null. |
» code | string | Discount code |
» expires | object¦null | Discount code's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» max_redemptions | integer¦null | The maximum number of times this discount can be used. |
» name | string | A descriptive name given to the discount |
» price | integer¦null | Price in cents. Could be null. |
» price_percent | integer¦null | Percent of the price. Could be null. |
» ticket_types | [string] | An array of associated ticket types. |
» times_redeemed | integer¦null | The number of times that the discount was used |
» type | string | Type of discount. Either a fixed amount or a percentage |
Enumerated Values
Property | Value |
---|---|
type | fixed_amount |
type | percentage |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Update an existing discount
Code samples
# You can also use wget
curl -X POST /v1/discounts/{discount_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/discounts/{discount_id}', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/discounts/{discount_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/discounts/{discount_id}', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/discounts/{discount_id}
Find the existing discount by ID and update it
Body parameter
code: discount_test123
expires: 1588368600
max_redemptions: 5
name: Test discount
price: 540
ticket_types:
tt_123: "1"
tt_456: "0"
tt_78: ""
type: fixed_amount
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
discount_id | path | string | true | The unique identifier for the existing discount |
body | body | object | false | none |
» booking_fee | body | integer¦null | false | Booking fee amount in cents. Could be null. |
» booking_fee_percent | body | integer¦null | false | Percent of the booking fee. Could be null. |
» code | body | string | false | Discount code |
» expires | body | integer¦null | false | Discount code's expiry date as Unix timestamp |
» max_redemptions | body | integer¦null | false | The maximum number of times this discount can be used. |
» name | body | string | false | A descriptive name given to the discount |
» price | body | integer¦null | false | Price in cents. Could be null. |
» price_percent | body | integer¦null | false | Percent of the price. Could be null. |
» ticket_types | body | object | false | An array of associated ticket types. |
»» additionalProperties | body | string | false | none |
»»» ticket_type_id | body | string | false | none |
»»» discount_association | body | string | false | '1' = add to discount, '0' = remove from discount, '' = do nothing |
» type | body | string | false | Type of discount. Either a fixed amount or a percentage |
Enumerated Values
Parameter | Value |
---|---|
» type | fixed_amount |
» type | percentage |
Example responses
200 Response
{
"object": "discount",
"id": "di_123",
"code": "discount_test123",
"expires": "2022-10-22 14:15:16",
"face_value_amount": 540,
"max_redemptions": 5,
"name": "Test discount",
"ticket_types": [
"tt_123",
"tt_78"
],
"times_redeemed": 3,
"type": "fixed_amount"
}
default Response
{
"status": 0,
"error_code": "string",
"message": "string",
"errors": [
{
"field": "string",
"messages": [
"string"
]
}
]
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the discount |
» booking_fee | integer¦null | Booking fee amount in cents. Could be null. |
» booking_fee_percent | integer¦null | Percent of the booking fee. Could be null. |
» code | string | Discount code |
» expires | object¦null | Discount code's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» max_redemptions | integer¦null | The maximum number of times this discount can be used. |
» name | string | A descriptive name given to the discount |
» price | integer¦null | Price in cents. Could be null. |
» price_percent | integer¦null | Percent of the price. Could be null. |
» ticket_types | [string] | An array of associated ticket types. |
» times_redeemed | integer¦null | The number of times that the discount was used |
» type | string | Type of discount. Either a fixed amount or a percentage |
Enumerated Values
Property | Value |
---|---|
type | fixed_amount |
type | percentage |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Delete a discount by its ID
Code samples
# You can also use wget
curl -X DELETE /v1/discounts/{discount_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('DELETE','/v1/discounts/{discount_id}', [
'headers' => $headers,
=> $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/discounts/{discount_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.delete(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.delete('/v1/discounts/{discount_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
DELETE /v1/discounts/{discount_id}
Delete an existing discount. This action is irreversible. The discount will be permanently removed.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
discount_id | path | string | true | The unique identifier for the existing discount |
Example responses
200 Response
{
"id": "di_123",
"object": "discount",
"deleted": true
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» id | string | ID of the deleted discount |
» object | string | none |
» deleted | string | Delete operation successful |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Voucher
Get list of vouchers
Code samples
# You can also use wget
curl -X GET /v1/vouchers \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/vouchers', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/vouchers', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/vouchers', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/vouchers
Returns the paginated list of the vouchers
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | query | string | false | The number of items to retrieve |
expiry_date | query | integer | false | Unix timestamp filter that returns items with matched expiry_date value. |
expiry_date.gt | query | integer | false | Unix timestamp filter that returns items with expiry_date greater than the given value. |
expiry_date.gte | query | integer | false | Unix timestamp filter that returns items with expiry_date greater than or equal to the given value. |
expiry_date.lt | query | integer | false | Unix timestamp filter that returns items with expiry_date less than given value. |
expiry_date.lte | query | integer | false | Unix timestamp filter that returns items with expiry_date less than or equal given value. |
created_at | query | integer | false | Unix timestamp filter that returns items with matched created_at value. |
created_at.gt | query | integer | false | Unix timestamp filter that returns items with created_at greater than given value. |
created_at.gte | query | integer | false | Unix timestamp filter that returns items with created_at greater than or equal given value. |
created_at.lt | query | integer | false | Unix timestamp filter that returns items with created_at less than given value. |
created_at.lte | query | integer | false | Unix timestamp filter that returns items with created_at less than or equal given value. |
Example responses
200 Response
{
"data": [
{
"object": "voucher",
"id": "vo_123",
"available_codes": 7,
"event_series_ids": [
"es_123",
"es_234",
"es_345"
],
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Test Voucher",
"total_codes": 25,
"value": 540
},
{
"object": "voucher",
"id": "vo_234",
"available_codes": 1,
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Another Test Voucher",
"total_codes": 12,
"value": 300
}
],
"links": {
"next": "/v1/vouchers?starting_after=vo_123",
"previous": "/v1/vouchers?ending_before=vo_234"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [object] | none |
»» object | string | none |
»» id | string | A unique identifier for the voucher |
»» available_codes | integer | The number of unused voucher codes belonging to the voucher |
»» event_series_ids | [string] | List of event series IDs |
»» expiry | object¦null | Voucher's expiry date |
»»» date | string | ISO-8601 date for the start of the event |
»»» formatted | string | A formatted date string for the start of the event |
»»» iso | string | ISO-8601 date and time for the start of the event |
»»» time | string | Time for the start of the event |
»»» timezone | string | Timezone offset for the start of the event |
»»» unix | integer | Unix timestamp for the start of the event |
»» name | string | A descriptive name given to the voucher |
»» total_codes | integer | Total number of voucher codes belonging to the voucher |
»» value | integer | The integer value in cents given to the voucher |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Create new voucher and voucher codes
Code samples
# You can also use wget
curl -X POST /v1/vouchers \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/vouchers', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/vouchers', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/vouchers', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/vouchers
Creates a new voucher and the associated voucher codes, if given.
Body parameter
codes:
- testCode1
- testCode2
event_series_ids:
- es_1
- es_2
expiry: 1588368600
name: Test voucher with codes
value: 540
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» codes | body | [string] | true | An array of associated voucher codes. |
» event_series_ids | body | [string] | false | An array of associated event series IDs |
» expiry | body | integer | true | Voucher's expiry date as Unix timestamp. |
» name | body | string | true | A descriptive name given to the voucher |
» value | body | integer | true | Voucher value in cents. |
Example responses
201 Response
{
"object": "voucher",
"id": "vo_123",
"available_codes": 7,
"event_series_ids": [
"es_123",
"es_234",
"es_345"
],
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Test Voucher",
"total_codes": 25,
"value": 540
}
Response Schema
Status Code 201
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the voucher |
» available_codes | integer | The number of unused voucher codes belonging to the voucher |
» event_series_ids | [string] | List of event series IDs |
» expiry | object¦null | Voucher's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» name | string | A descriptive name given to the voucher |
» total_codes | integer | Total number of voucher codes belonging to the voucher |
» value | integer | The integer value in cents given to the voucher |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
View single voucher
Code samples
# You can also use wget
curl -X GET /v1/vouchers/{voucher_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/vouchers/{voucher_id}', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/vouchers/{voucher_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/vouchers/{voucher_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/vouchers/{voucher_id}
Find the existing voucher by ID and view it
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
voucher_id | path | string | true | The unique identifier for the existing voucher |
Example responses
200 Response
{
"object": "voucher",
"id": "vo_123",
"available_codes": 7,
"event_series_ids": [
"es_123",
"es_234",
"es_345"
],
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Test Voucher",
"total_codes": 25,
"value": 540
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the voucher |
» available_codes | integer | The number of unused voucher codes belonging to the voucher |
» event_series_ids | [string] | List of event series IDs |
» expiry | object¦null | Voucher's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» name | string | A descriptive name given to the voucher |
» total_codes | integer | Total number of voucher codes belonging to the voucher |
» value | integer | The integer value in cents given to the voucher |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Update an existing voucher
Code samples
# You can also use wget
curl -X POST /v1/vouchers/{voucher_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/vouchers/{voucher_id}', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/vouchers/{voucher_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/vouchers/{voucher_id}', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/vouchers/{voucher_id}
Find the existing voucher by ID and update its name. If any voucher codes are given, create new voucher codes and associate them with the voucher
Body parameter
codes:
- testCode1
- testCode2
event_series_ids:
es_1: "1"
es_2: "0"
es_3: ""
expiry: 1588368600
name: Test voucher with codes
value: 540
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
voucher_id | path | string | true | The unique identifier for the existing voucher |
body | body | object | false | none |
» codes | body | [string]¦null | false | An array of associated voucher codes. |
» event_series_ids | body | object | false | An array of associated event series IDs |
»» additionalProperties | body | string | false | none |
»»» event_series_id | body | string | false | none |
»»» voucher_association | body | string | false | '1' = add to voucher, '0' = remove from voucher, '' = do nothing |
» expiry | body | integer¦null | false | Voucher's expiry date as Unix timestamp. |
» name | body | string¦null | false | A descriptive name given to the voucher |
» value | body | integer¦null | false | Voucher value in cents. |
Example responses
201 Response
{
"object": "voucher",
"id": "vo_123",
"available_codes": 7,
"event_series_ids": [
"es_123",
"es_234",
"es_345"
],
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"name": "Test Voucher",
"total_codes": 25,
"value": 540
}
Response Schema
Status Code 201
Name | Type | Description |
---|---|---|
» object | string | none |
» id | string | A unique identifier for the voucher |
» available_codes | integer | The number of unused voucher codes belonging to the voucher |
» event_series_ids | [string] | List of event series IDs |
» expiry | object¦null | Voucher's expiry date |
»» date | string | ISO-8601 date for the start of the event |
»» formatted | string | A formatted date string for the start of the event |
»» iso | string | ISO-8601 date and time for the start of the event |
»» time | string | Time for the start of the event |
»» timezone | string | Timezone offset for the start of the event |
»» unix | integer | Unix timestamp for the start of the event |
» name | string | A descriptive name given to the voucher |
» total_codes | integer | Total number of voucher codes belonging to the voucher |
» value | integer | The integer value in cents given to the voucher |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Delete a voucher by its ID
Code samples
# You can also use wget
curl -X DELETE /v1/vouchers/{voucher_id} \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('DELETE','/v1/vouchers/{voucher_id}', [
'headers' => $headers,
=> $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/vouchers/{voucher_id}', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.delete(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.delete('/v1/vouchers/{voucher_id}', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
DELETE /v1/vouchers/{voucher_id}
Delete an existing voucher and its associated voucher codes. This action is irreversible. The voucher and its voucher codes will be permanently removed.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
voucher_id | path | string | true | The unique identifier for the existing voucher |
Example responses
200 Response
{
"id": "vo_123",
"object": "voucher",
"deleted": true
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» id | string | ID of the deleted voucher |
» object | string | none |
» deleted | string | Delete operation successful |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Get the list of voucher codes for the given voucher ID
Code samples
# You can also use wget
curl -X GET /v1/vouchers/{voucher_id}/codes \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('GET','/v1/vouchers/{voucher_id}/codes', [
'headers' => $headers,
'json' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
resource = RestClient::Resource.new('/v1/vouchers/{voucher_id}/codes', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
response = requests.get('/v1/vouchers/{voucher_id}/codes', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
GET /v1/vouchers/{voucher_id}/codes
Returns the paginated list of voucher codes for the given voucher ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
voucher_id | path | string | true | The unique identifier for the existing voucher |
limit | query | string | false | The number of items to retrieve |
expiry_date | query | integer | false | Unix timestamp filter that returns items with matched expiry_date value. |
expiry_date.gt | query | integer | false | Unix timestamp filter that returns items with expiry_date greater than the given value. |
expiry_date.gte | query | integer | false | Unix timestamp filter that returns items with expiry_date greater than or equal to the given value. |
expiry_date.lt | query | integer | false | Unix timestamp filter that returns items with expiry_date less than given value. |
expiry_date.lte | query | integer | false | Unix timestamp filter that returns items with expiry_date less than or equal given value. |
created_at | query | integer | false | Unix timestamp filter that returns items with matched created_at value. |
created_at.gt | query | integer | false | Unix timestamp filter that returns items with created_at greater than given value. |
created_at.gte | query | integer | false | Unix timestamp filter that returns items with created_at greater than or equal given value. |
created_at.lt | query | integer | false | Unix timestamp filter that returns items with created_at less than given value. |
created_at.lte | query | integer | false | Unix timestamp filter that returns items with created_at less than or equal given value. |
Example responses
200 Response
{
"data": [
{
"object": "voucher_code",
"id": "vc_123",
"code": "Test Voucher Code",
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"used": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"value": 540,
"voucher_id": "vo_123456"
},
{
"object": "voucher_code",
"id": "vc_345",
"code": "Second Test Voucher Code",
"expiry": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"used": {
"date": "2020-05-01",
"formatted": "Fri 1 May 2020 10:30 PM",
"iso": "2020-05-01T22:30:00+01:00",
"time": "22:30",
"timezone": "+01:00",
"unix": 1588368600
},
"value": 350,
"voucher_id": "vo_123456"
}
],
"links": {
"next": "/v1/vouchers/vo_123456/codes?starting_after=vc_123",
"previous": "/v1/vouchers/vo_123456/codes?ending_before=vc_321"
}
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» data | [object] | none |
»» object | string | none |
»» id | string | A unique identifier for the voucher code |
»» code | string | A descriptive name given to the voucher code |
»» expiry | object | Voucher code's expiry date |
»»» date | string | ISO-8601 date for the start of the event |
»»» formatted | string | A formatted date string for the start of the event |
»»» iso | string | ISO-8601 date and time for the start of the event |
»»» time | string | Time for the start of the event |
»»» timezone | string | Timezone offset for the start of the event |
»»» unix | integer | Unix timestamp for the start of the event |
»» used | object¦null | Voucher code's used date |
»»» date | string | ISO-8601 date for the start of the event |
»»» formatted | string | A formatted date string for the start of the event |
»»» iso | string | ISO-8601 date and time for the start of the event |
»»» time | string | Time for the start of the event |
»»» timezone | string | Timezone offset for the start of the event |
»»» unix | integer | Unix timestamp for the start of the event |
»» value | integer | The integer value in cents given to the voucher code |
»» voucher_id | string | A unique identifier of the voucher that the code belongs To |
» links | object | none |
»» next | string¦null | none |
»» previous | string¦null | none |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Voucher code
Void a voucher code
Code samples
# You can also use wget
curl -X POST /v1/vouchers/{voucher_id}/codes/{voucher_code_id}/void \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = [
'Accept' => 'application/json',
];
$client = new \GuzzleHttp\Client([
'auth' => [
'sk_1000_1000_VGlja2V0VGFpbG9y',
''
]
]);
// Define array of request body.
$request_body = [];
try {
$response = $client->request('POST','/v1/vouchers/{voucher_id}/codes/{voucher_code_id}/void', [
'headers' => $headers,
'form_params' => $request_body,
]
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
params = {:event_id => "ev_1", :ticket_type_id => "tt_230656", :email => "john@example.com", :full_name => "John Doe"}
resource = RestClient::Resource.new('/v1/vouchers/{voucher_id}/codes/{voucher_code_id}/void', :user => 'sk_1000_1000_VGlja2V0VGFpbG9y', :password => '' )
response = resource.post(params, :headers => headers)
parsedResponse = JSON.parse(response)
import requests
headers = {
'Accept': 'application/json'
}
params = {"event_id": "ev_1", "ticket_type_id": "tt_230656", "email": "john@example.com", "full_name": "John Doe"}
response = requests.post('/v1/vouchers/{voucher_id}/codes/{voucher_code_id}/void', data=params, auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
POST /v1/vouchers/{voucher_id}/codes/{voucher_code_id}/void
Mark an existing voucher code as voided. This action is irreversible. This will only mark one voucher code as voided, and will not impact the other related codes.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
voucher_id | path | string | true | The unique identifier for the voucher |
voucher_code_id | path | string | true | The unique identifier for the voucher code |
Example responses
200 Response
{
"id": "vc_123",
"object": "voucher_code",
"voided": true
}
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
» id | string | ID of the voided voucher code |
» object | string | none |
» voided | string | Voiding operation successful or not |
Status Code default
Name | Type | Description |
---|---|---|
» status | integer | Http status code |
» error_code | string | Readable error code |
» message | string | Detailed error message |
» errors | [object] | Validation errors if POST request was sent. Otherwise not present. |
»» field | string | Field name that failed validation |
»» messages | [string] | Validation error message |
Webhooks
Introduction
Webhooks can be used to send updates to clients when data in Ticket Tailor has changed. After you have subscribed to a webhook, your app will receive updates, instead of having to continuously poll API for changes.
Configuration
Go to: Settings > API > Webhooks
- Select type of event that triggers the webhook.
- Enter a valid URL that will receive the webhook data.
Webhooks are triggered by events in Ticket Tailor. At the moment we support the following events:
Order
Event | Description |
---|---|
Created | Fires a webhook when an order is created. |
Updated | Fires a webhook when an order is updated. This includes cancelling an order. |
Issued ticket
Event | Description |
---|---|
Created | Fires a webhook when an issued ticket is created. |
Updated | Fires a webhook when an issued ticket is updated. This includes voiding issued tickets. |
Event
Event | Description |
---|---|
Created | Fires a webhook when an event is created. |
Updated | Fires a webhook when an event is updated. |
Deleted | Fires a webhook when an event is deleted. |
Structure
Webhook requests are application/json
POST requests with the following data structure:
- id: idempotent key for the webhook request.
- created_at: date time in UTC when the event was generated.
- event: type of event that triggered the webhook.
- resource_url: api url of the resource affected by the change.
- payload: the changed resource.
It is good practice to make clients idempotent in case webhooks are sent more than once. You can track ids of already processed requests to not execute tasks more than once.
Security
<?php
$sharedSecret = 'ABCD123';
$body = file_get_contents('php://input');
$headerParts = explode(',', $_SERVER['HTTP_TICKETTAILOR_WEBHOOK_SIGNATURE']);
$timestamp = explode('=', $headerParts[0])[1];
$signature = explode('=', $headerParts[1])[1];
$hash = hash_hmac('sha256', $timestamp . $body, $sharedSecret);
if (! hash_equals($hash, $signature)) {
throw new \Exception('Invalid signature');
}
$tolerance = 60 * 5; // 5 minutes
if ((time() - $timestamp) > $tolerance) {
throw new \Exception('Webhook is out of date');
}
sharedSecret = 'ABCD123'
headerParts = request.headers['TicketTailor-Webhook-Signature'].split(',')
timestamp = headerParts[0].split('=')[1]
signature = headerParts[1].split('=')[1]
hash = OpenSSL::HMAC.hexdigest(
OpenSSL::Digest.new('sha256'), sharedSecret, timestamp + request.body.string
)
if ActiveSupport::SecurityUtils.secure_compare(signature, hash)
logger.info 'Valid signature'
else
logger.info 'Invalid signature'
end
tolerance = 60 * 5 # 5 minutes
if Time.now.to_i - timestamp.to_i > tolerance
logger.info 'Out of date'
end
sharedSecret = 'ABCD123'
headerParts = request.headers.get('TicketTailor-Webhook-Signature').split(',')
timestamp = headerParts[0].split('=')[1]
signature = headerParts[1].split('=')[1]
requestBody = request.data
newSignature = hmac.new(
key=sharedSecret,
msg=timestamp + requestBody,
digestmod=hashlib.sha256
)
if hmac.compare_digest(newSignature.hexdigest(), str(signature)):
logging.info("Valid signature")
else:
logging.error("Invalid signature")
tolerance = 60 * 5 # 5 mintues
if time.time() - int(timestamp) > tolerance:
logging.error("Out of date")
Webhook requests are signed using a shared secret. You can find this in the webooks dashboard. The resulting signature with signing timestamp is sent with the request in Tickettailor-Webhook-Signature
header. We recommend to verify that the request is sent from Ticket Tailor. To do this, you must generate a HMAC-SHA256
signature of the request payload combined with the timestamp, compare it with the sent signature from Ticket Tailor, and verify they match.
We also recommend to invalidate webhooks received where the sent timestamp is older than 5 minutes.
See the code examples of how to verify webhook request.
Retry Strategy
Webhook calls are retried with exponential backoff over a 72 hour period. We mark a webhook as failed immediately when we receive redirect response or network error.
You can see all sent webhooks, their status and next delivery due date on the webhook history page.
Go to: Settings > API > Webhooks > Select "History" from webhook subscription actions dropdown menu.
Retry | Interval |
---|---|
01 | Immediately |
02 | 00:00:16 |
03 | 00:01:21 |
04 | 00:04:16 |
05 | 00:10:25 |
06 | 00:21:36 |
07 | 00:40:01 |
08 | 01:08:16 |
09 | 01:49:21 |
10 | 02:46:40 |
11 | 04:04:01 |
12 | 05:45:36 |
13 | 07:56:01 |
14 | 10:40:16 |
15 | 14:03:45 |
16 | 18:12:16 |
17 | 23:12:01 |
18 | 29:09:36 |
19 | 36:12:01 |
20 | 44:26:40 |
21 | 54:01:21 |
22 | 65:04:16 |
NOTE if a webhook continuously fails for 5 days, we will send warning email regarding disabling the webhook, and disable webhook if it continuously fails for 10 days. It will then have to be manually re-enabled by you in the Webhooks dashboard.
Testing
As webhooks need a public URL, it can be difficult to test your integration when developing locally. To overcome this issue we suggest two ways to test your webhooks:
- Webhook.site - a service you can point your webhook subscriptions to, and inspect the sent data.
- Ngrok - utility for setting up a tunnel between a server running on localhost and a public URL. When you run ngrok locally, it will give you an unique public URL you could point your webhook subscriptions to. Webhooks then will be sent straight through to your local machine.