Have you noticed an issue with our API? Please email api@tickettailor.com.
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
The Ticket Tailor API uses API key to authenticate requests. You can manage your API keys in your box office settings. Authentication to the API is performed via HTTP Basic Auth.
- Header
- Username
When manually adding the API key to the Authorization header, ensure it is Base64 encoded in the format: Authorization: Basic Base64Encode(api_key).
- curl
- php guzzle
- php curl
- ruby
- python
curl -X GET https://api.tickettailor.com/v1/orders \
-H 'Accept: application/json' \
-H 'Authorization: Basic c2tfMTAwMF8xMDAwX1ZHbGphMlYwVkdGcGJHOXk='
$apikey = 'sk_1000_1000_VGlja2V0VGFpbG9y';
$hashed = base64_encode($apikey);
$headers = [
'Accept' => 'application/json',
'Authorization' => 'Basic ' . $hashed,
];
$client = new \GuzzleHttp\Client();
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());
}
$apikey = 'sk_1000_1000_VGlja2V0VGFpbG9y';
$hashed = base64_encode($apikey);
$headers = [
'Accept: application/json',
'Authorization: Basic ' . $hashed,
];
$curlHandler = curl_init();
curl_setopt($curlHandler, CURLOPT_URL, 'https://api.tickettailor.com/v1/orders');
curl_setopt($curlHandler, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($curlHandler);
curl_close($curlHandler);
print_r($result);
require 'rest-client'
require 'json'
require 'base64'
apikey = 'sk_1000_1000_VGlja2V0VGFpbG9y'
hashed = Base64.encode64(apikey)
headers = {
'Accept' => 'application/json',
'Authorization' => 'Basic ' + hashed,
}
resource = RestClient::Resource.new('https://api.tickettailor.com/v1/orders')
response = resource.get(:headers => headers)
parsedResponse = JSON.parse(response)
import requests
import base64
apikey = 'sk_1000_1000_VGlja2V0VGFpbG9y'
hashed = base64.b64encode(apikey.encode()).decode()
headers = {
'Accept': 'application/json',
'Authorization': 'Basic ' + str(hashed),
}
response = requests.get('https://api.tickettailor.com/v1/orders', headers=headers)
print response.json()
API key can also be added as the basic auth username. You do not need to provide a password. Add a trailing colon (:) to not ask for password.
- curl
- php guzzle
- php curl
- ruby
- python
curl -X GET https://api.tickettailor.com/v1/orders \
-H 'Accept: application/json' \
-u 'sk_1000_1000_VGlja2V0VGFpbG9y:'
// 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());
}
$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://api.tickettailor.com/v1/orders', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers)
print response.json()
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 |
Rate limiting
You can make up to 5000 requests per 30 minutes to the 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. |
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. |