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()