### Event Data Example (JSON) Source: https://developers.tickettailor.com/docs/api/get-all-events An example of the JSON structure representing an event. It includes details like event ID, availability status, checkout URL, creation timestamp, currency, and nested objects for start and end times. ```json { "object": "event", "id": "ev_1", "available_status": "This event is available", "chk": "da99", "access_code": null, "call_to_action": "Buy tickets / Join the guestlist", "checkout_url": "https://www.tickettailor.com/checkout/view-event/id/1/chk/da99/", "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": { "event_image_url": null, "logo_url": null } } ``` -------------------------------- ### GET /v1/orders Source: https://developers.tickettailor.com/docs/intro Retrieves a list of orders from the Ticket Tailor platform using cursor-based pagination. ```APIDOC ## GET /v1/orders ### Description Retrieves a list of orders. Supports cursor-based pagination to navigate through large result sets. ### Method GET ### Endpoint https://api.tickettailor.com/v1/orders ### Parameters #### Query Parameters - **starting_after** (string) - Optional - Returns objects listed after the named object (e.g., or_1234). - **ending_before** (string) - Optional - Returns objects listed before the named object. - **limit** (integer) - Optional - Limits the number of results per-page (Maximum: 100). ### Request Example GET /v1/orders?limit=10 ### Response #### Success Response (200) - **data** (array) - A list of order objects. #### Response Example { "data": [ { "id": "or_1234", "status": "complete" } ] } ``` -------------------------------- ### Basic Authentication Example (Go) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Provides a Go language example for implementing Basic Authentication with the Ticket Tailor API. It involves setting the Authorization header with the base64 encoded API key. ```go // Go Basic Auth Example (Conceptual) package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" ) func main() { apiKey := "your_base64_encoded_api_key" encodedKey := base64.StdEncoding.EncodeToString([]byte(apiKey)) client := &http.Client{} req, err := http.NewRequest("GET", "https://api.tickettailor.com/v1/products/:product_id", nil) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "Basic " + encodedKey) req.Header.Add("Accept", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Authenticate API requests using Basic Auth username Source: https://developers.tickettailor.com/docs/intro Demonstrates how to authenticate by passing the API key as the username in the Basic Auth configuration. This approach simplifies authentication by omitting the password requirement. ```bash curl -X GET https://api.tickettailor.com/v1/orders \ -H 'Accept: application/json' \ -u 'sk_1000_1000_VGlja2V0VGFpbG9y:' ``` ```php $headers = [ 'Accept' => 'application/json', ]; $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) { print_r($e->getMessage()); } ``` ```php $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); ``` -------------------------------- ### Product List Response Schema and Example (JSON) Source: https://developers.tickettailor.com/docs/api/get-product-list Defines the schema for a successful response when listing products, including product details, pricing, and associated event information. An example JSON payload illustrates the expected structure. ```json { "data": [ { "object": "product", "id": "pr_1", "booking_fee": 100, "created_at": { "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 }, "currency": "usd", "description": "This is a product", "event_series_ids": [ "es_123", "es_234", "es_345" ], "instructions": "Buy this product at the venue", "issued_count": 0, "issue_ticket_voucher": "false", "voucher_id": null, "membership_type_id": null, "linked_to_all_event_series": "true", "name": "Test Product", "price": 956, "quantity": 10, "sell_in_store": "false", "status": "on_sale", "updated_at": { "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 } } ], "links": { "next": "/v1/products?starting_after=pr_120", "previous": "/v1/products?ending_before=pr_100" } } ``` -------------------------------- ### Basic Authentication Example (Ruby) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Provides a Ruby example for making authenticated requests to the Ticket Tailor API using Basic Authentication. The Authorization header must contain the base64 encoded API key. ```ruby # Ruby Basic Auth Example (Conceptual) require 'rest-client' api_key = 'your_base64_encoded_api_key' response = RestClient.get 'https://api.tickettailor.com/v1/products/:product_id', 'Authorization' => "Basic #{api_key}", 'Accept' => 'application/json' puts response.body ``` -------------------------------- ### Discount response schema example Source: https://developers.tickettailor.com/docs/api/get-discount-list An example of the JSON structure returned by the API when successfully retrieving a list of discounts. ```json { "data": [ { "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"], "products": ["pr_78", "pr_123", "pr_456"], "times_redeemed": 3, "type": "fixed_amount" } ], "links": { "next": "/v1/discounts?starting_after=di_123", "previous": "/v1/discounts?ending_before=di_234" } } ``` -------------------------------- ### Basic Authentication Example Source: https://developers.tickettailor.com/docs/api/create-issued-membership This section demonstrates how to use Basic Authentication with the Ticket Tailor API. It includes examples of how to construct the Authorization header using a base64 encoded API key. ```curl curl -L -X POST 'https://api.tickettailor.com/v1/issued_memberships' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+' ``` ```php // PHP example for Basic Authentication would go here ``` ```ruby # Ruby example for Basic Authentication would go here ``` ```python # Python example for Basic Authentication would go here ``` ```nodejs // Node.js example for Basic Authentication would go here ``` ```go // Go example for Basic Authentication would go here ``` -------------------------------- ### Discount Schema and Example (JSON) Source: https://developers.tickettailor.com/docs/api/update-discount-by-id Defines the structure of a discount object returned by the API, including fields like ID, code, expiry, pricing, and associated ticket types/products. An example JSON payload illustrates a successfully updated discount. ```json { "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" ], "products": [ "pr_78", "pr_123", "pr_456" ], "times_redeemed": 3, "type": "fixed_amount" } ``` ```json { "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" ], "products": [ "pr_123", "pr_456", "pr_78" ], "times_redeemed": 3, "type": "fixed_amount" } ``` -------------------------------- ### Fetch Orders using Ruby RestClient Source: https://developers.tickettailor.com/docs/intro This snippet demonstrates how to fetch orders from the Ticket Tailor API using the RestClient library in Ruby. It initializes a resource object for the orders endpoint and makes a GET request with specified headers. The response is then parsed as JSON. No password is required for authentication in this example. ```ruby 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) ``` -------------------------------- ### Basic Authentication Example (PHP) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Illustrates how to implement Basic Authentication in PHP for Ticket Tailor API requests. This involves setting the Authorization header with a base64 encoded API key. ```php // PHP Basic Auth Example (Conceptual) $apiKey = 'your_base64_encoded_api_key'; $headers = array( 'Authorization: Basic ' . $apiKey, 'Accept: application/json' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.tickettailor.com/v1/products/:product_id'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // ... other curl options ... $response = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Fetch Orders using Python Requests Source: https://developers.tickettailor.com/docs/intro This snippet shows how to retrieve orders from the Ticket Tailor API using the requests library in Python. It defines the necessary headers and makes a GET request to the orders endpoint with basic authentication. The response is then converted to JSON format. Similar to the Ruby example, the password field is left empty. ```python import requests headers = { 'Accept': 'application/json' } response = requests.get('https://api.tickettailor.com/v1/orders', auth=('sk_1000_1000_VGlja2V0VGFpbG9y', ''), headers=headers) print response.json() ``` -------------------------------- ### Basic Authentication Example (Python) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Shows how to use Basic Authentication with Python to interact with the Ticket Tailor API. This method requires the Authorization header to be set with a base64 encoded API key. ```python # Python Basic Auth Example (Conceptual) import requests api_key = 'your_base64_encoded_api_key' headers = { 'Authorization': f'Basic {api_key}', 'Accept': 'application/json' } response = requests.get('https://api.tickettailor.com/v1/products/:product_id', headers=headers) print(response.json()) ``` -------------------------------- ### Waitlist Configuration Example Source: https://developers.tickettailor.com/docs/api/update-event-series-by-id A JSON object outlining the configuration for a waitlist feature, including its active status, call to action, and confirmation messages. ```json { "waitlist_active": "true", "waitlist_call_to_action": "Join waiting list", "waitlist_event_page_text": "Join our waiting list to be notified when tickets become available.", "waitlist_confirmation_message": "Done! You are on the waiting list." } ``` -------------------------------- ### Example Store Information Response Source: https://developers.tickettailor.com/docs/api/get-store-by-id This is an example of a successful JSON response when retrieving store information. It includes the store's object type, unique ID, currency, name, and arrays of associated payment method and product IDs. ```json { "object": "store", "id": "st_18", "currency": "EUR", "name": "Example store name", "payment_methods": [ "pm_7301", "pm_7302" ], "products": [ "pr_105676" ] } ``` -------------------------------- ### Get Hold by ID - CURL Example Source: https://developers.tickettailor.com/docs/api/get-hold-by-id This snippet demonstrates how to retrieve a specific hold using its unique identifier via a CURL request. It includes the necessary endpoint, headers for authentication and content type, and placeholders for the hold ID and authentication credentials. ```curl curl -L 'https://api.tickettailor.com/v1/holds/:hold_id' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+' ``` -------------------------------- ### POST /products Source: https://developers.tickettailor.com/docs/api/create-product Creates a new product in the system. This endpoint returns the created product object including its unique ID and metadata. ```APIDOC ## POST /products ### Description Creates a new product. This endpoint allows you to define product details such as price, currency, quantity, and association with event series. ### Method POST ### Endpoint /products ### Request Body - **name** (string) - Required - Name of the product - **price** (integer) - Required - Price in cents - **currency** (string) - Optional - Currency code (e.g., gbp, usd, eur) - **description** (string) - Optional - Description of the product - **quantity** (integer) - Optional - Number available for purchase ### Request Example { "name": "Test Product", "price": 956, "currency": "usd", "description": "This is a product" } ### Response #### Success Response (201) - **id** (string) - Unique identifier for the product - **name** (string) - Name of the product - **status** (string) - Current status (on_sale, hidden, sold_out) #### Response Example { "object": "product", "id": "pr_1", "name": "Test Product", "status": "on_sale" } ``` -------------------------------- ### Basic Authentication Example (Node.js) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Demonstrates Basic Authentication in Node.js for Ticket Tailor API calls. The Authorization header should include the base64 encoded API key. ```javascript // Node.js Basic Auth Example (Conceptual) const axios = require('axios'); const apiKey = 'your_base64_encoded_api_key'; axios.get('https://api.tickettailor.com/v1/products/:product_id', { headers: { 'Authorization': `Basic ${apiKey}`, 'Accept': 'application/json' } }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Checkout Form Element JSON Schema Source: https://developers.tickettailor.com/docs/api/get-checkout-form-element-by-id Example JSON response structure for a successful checkout form element retrieval. ```json { "object": "checkout_form_element", "id": "ce_123", "checkout_form_id": "cf_123", "options": [ "Yes", "No" ], "per_ticket": "true", "question": "Do you have any dietary requirements?", "required": "true", "type": "radio", "terms_and_conditions": null } ``` -------------------------------- ### Fetch Event Occurrence (Ruby) Source: https://developers.tickettailor.com/docs/api/get-event-occurrence-by-id Example using Ruby to fetch a specific event occurrence from the Ticket Tailor API. This code snippet shows how to make an HTTP GET request with appropriate headers. ```ruby require 'uri' require 'net/http' url = URI("https://api.tickettailor.com/v1/event_series/:event_series_id/events/:event_occurrence_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Accept"] = "application/json" request["Authorization"] = "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+" response = http.request(request) puts response.read_body ``` -------------------------------- ### List Voucher Codes using Go Source: https://developers.tickettailor.com/docs/api/get-voucher-code-list This Go code snippet shows how to retrieve voucher codes using the `net/http` package. It creates an HTTP client, constructs the request with appropriate headers, and sends the GET request to the API. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://api.tickettailor.com/v1/vouchers/:voucher_id/codes", nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Basic Authentication with cURL Source: https://developers.tickettailor.com/docs/api/get-all-issued-memberships This example demonstrates how to make a GET request to the Ticket Tailor API using Basic Authentication with cURL. The Authorization header is constructed using a base64 encoded username and password. ```curl curl -L 'https://api.tickettailor.com/v1/issued_memberships' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+' ``` -------------------------------- ### Issued Membership JSON Schema Example Source: https://developers.tickettailor.com/docs/api/create-issued-membership Represents the structure of an issued membership object returned by the API. It includes member identification, validity status, and nested date objects for issue, start, and expiry times. ```json { "object": "issued_membership", "id": "im_123", "code": "MMABC123", "benefits": [ "Free entry to all events", "10% discount on merchandise" ], "email": "john.doe@example.com", "first_name": "John", "full_name": "John Doe", "is_valid": "true", "issue_date": { "date": "2024-01-01", "formatted": "Mon 1 Jan 2024 12:00 PM", "iso": "2024-01-01T12:00:00+00:00", "time": "12:00", "timezone": "+00:00", "unix": 1704110400 }, "last_name": "Doe", "max_redemptions": 10, "membership_type_id": "mt_456", "membership_type_name": "Annual Pass", "redemption_collection": [], "redemptions": 0, "valid_from": { "date": "2024-01-01", "formatted": "Mon 1 Jan 2024 12:00 PM", "iso": "2024-01-01T12:00:00+00:00", "time": "12:00", "timezone": "+00:00", "unix": 1704110400 }, "valid_to": { "date": "2024-12-31", "formatted": "Tue 31 Dec 2024 11:59 PM", "iso": "2024-12-31T23:59:59+00:00", "time": "23:59", "timezone": "+00:00", "unix": 1735689599 }, "voided_at": null } ``` -------------------------------- ### Basic Authentication Example (cURL) Source: https://developers.tickettailor.com/docs/api/get-product-by-id Demonstrates how to perform Basic Authentication using cURL to access a Ticket Tailor API endpoint. It requires a base64 encoded API key provided in the Authorization header. ```shell curl -L 'https://api.tickettailor.com/v1/products/:product_id' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ>' ``` -------------------------------- ### List Check Ins - Ruby Request Source: https://developers.tickettailor.com/docs/api/get-check-in-list Example of how to make a request to list check-ins using Ruby. This uses the Net::HTTP library to send the GET request. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.tickettailor.com/v1/check_ins") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_PEER request = Net::HTTP::Get.new(url) request["Accept"] = "application/json" request["Authorization"] = "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ>" response = http.request(request) puts response.read_body ``` -------------------------------- ### Fetch Events using cURL Source: https://developers.tickettailor.com/docs/api/get-all-event-occurrences Example of how to fetch events for an event series using cURL. It demonstrates setting the Accept header to application/json and includes the Authorization header with Basic authentication. The endpoint URL is provided. ```curl curl -L 'https://api.tickettailor.com/v1/event_series/:event_series_id/events' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ>' ``` -------------------------------- ### Update Discount Endpoint (PHP) Source: https://developers.tickettailor.com/docs/api/update-discount-by-id Demonstrates how to update a discount using PHP with cURL. This example shows setting up the cURL request, including headers and the POST data for the discount update. ```php "https://api.tickettailor.com/v1/discounts/:discount_id", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "booking_fee=540&name=Test+discount", CURLOPT_HTTPHEADER => [ "Accept: application/json", "Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+", "Content-Type: application/x-www-form-urlencoded" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; } ``` -------------------------------- ### List Check Ins - PHP Request Source: https://developers.tickettailor.com/docs/api/get-check-in-list Example of how to make a request to list check-ins using PHP. This demonstrates using cURL to send the GET request with appropriate headers. ```php 'https://api.tickettailor.com/v1/check_ins', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ>' ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #" . $err; } else { echo $response; } ``` -------------------------------- ### Error response schema example Source: https://developers.tickettailor.com/docs/api/get-discount-by-id Represents the JSON structure returned when a request fails. Includes a status code, a readable error code, and an optional array of field-specific validation errors. ```json { "status": 400, "error_code": "VALIDATION_ERROR", "message": "One or more fields failed validation", "errors": [ { "field": "name", "value": null, "messages": ["Value is required and can't be empty"], "expected": [] } ] } ``` -------------------------------- ### Update Discount Endpoint (Go) Source: https://developers.tickettailor.com/docs/api/update-discount-by-id A Go program demonstrating how to update a discount using the standard 'net/http' package. It constructs a POST request with the required headers and form data. ```go package main import ( "fmt" "net/http" "strings" ) func main() { url := "https://api.tickettailor.com/v1/discounts/:discount_id" payload := strings.NewReader("booking_fee=540&name=Test discount") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+") req.Header.Add("Content-Type", "application/x-www-form-urlencoded") client := &http.Client{} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() fmt.Println(res) } ``` -------------------------------- ### Update Discount Endpoint (Node.js) Source: https://developers.tickettailor.com/docs/api/update-discount-by-id Illustrates updating a discount using Node.js with the 'axios' library. This example covers setting up the request with necessary headers and sending the POST request with the discount update data. ```nodejs const axios = require('axios'); const url = 'https://api.tickettailor.com/v1/discounts/:discount_id'; const headers = { 'Accept': 'application/json', 'Authorization': 'Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+', 'Content-Type': 'application/x-www-form-urlencoded' }; const data = { 'booking_fee': '540', 'name': 'Test discount' }; axios.post(url, data, { headers: headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Discount response schema example Source: https://developers.tickettailor.com/docs/api/get-discount-by-id Represents the successful JSON response object returned when a discount is retrieved. Contains details such as the discount code, expiry date, redemption limits, and associated ticket types. ```json { "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"], "products": ["pr_78", "pr_123", "pr_456"], "times_redeemed": 3, "type": "fixed_amount" } ``` -------------------------------- ### Authenticate API requests with Base64 encoded API keys Source: https://developers.tickettailor.com/docs/intro Demonstrates how to authenticate API requests by manually encoding the API key into a Base64 string and including it in the Authorization header. This method is supported across multiple languages including cURL, PHP, Ruby, and Python. ```bash curl -X GET https://api.tickettailor.com/v1/orders \ -H 'Accept: application/json' \ -H 'Authorization: Basic c2tfMTAwMF8xMDAwX1ZHbGphMlYwVkdGcGJHOXk=' ``` ```php $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) { print_r($e->getMessage()); } ``` ```php $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); ``` ```ruby 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) ``` ```python 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() ``` -------------------------------- ### GET /vouchers/:voucher_id Source: https://developers.tickettailor.com/docs/api/get-voucher-by-id Retrieves the details of an existing voucher by its unique identifier. ```APIDOC ## GET /vouchers/:voucher_id ### Description Returns the full details of an existing voucher identified by the provided voucher_id. ### Method GET ### Endpoint https://api.tickettailor.com/v1/vouchers/:voucher_id ### Parameters #### Path Parameters - **voucher_id** (string) - Required - The unique identifier for the existing voucher. ### Request Example ``` curl -L 'https://api.tickettailor.com/v1/vouchers/vo_123' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+' ``` ### Response #### Success Response (200) - **id** (string) - A unique identifier for the voucher - **available_codes** (integer) - The number of unused voucher codes - **event_series_ids** (string[]) - List of event series IDs - **expiry** (object) - Voucher's expiry date details - **name** (string) - A descriptive name given to the voucher - **partial_redemption** (string) - Indicates whether voucher can be partially redeemed - **total_codes** (integer) - Total number of voucher codes - **type** (string) - Type of voucher (PROMO, GIFT_CARD) - **value** (integer) - The integer value in cents #### Response Example { "object": "voucher", "id": "vo_123", "available_codes": 7, "event_series_ids": ["es_123"], "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", "partial_redemption": "true", "total_codes": 25, "type": "PROMO", "usable_on_any_event": "true", "value": 540 } ``` -------------------------------- ### Voucher IDs Example Source: https://developers.tickettailor.com/docs/api/update-event-series-by-id An array of strings representing voucher identifiers. ```json [ "vo_123", "vo_345", "vo_567" ] ``` -------------------------------- ### GET /v1/stores/:store_id Source: https://developers.tickettailor.com/docs/api/get-store-by-id Retrieves the current store configuration for a given store ID. ```APIDOC ## GET /v1/stores/:store_id ### Description Returns the current store configuration. ### Method GET ### Endpoint https://api.tickettailor.com/v1/stores/:store_id ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier for the store. ### Request Example ```bash curl -L 'https://api.tickettailor.com/v1/stores/:store_id' \ -H 'Accept: application/json' \ -H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+' ``` ### Response #### Success Response (200) - **object** (string) - Type of the object, 'store'. - **id** (string) - A unique identifier for the store. - **currency** (string) - The currency code used by the store. Possible values: [`gbp`, `usd`, `eur`, `sgd`, `aud`, `brl`, `cad`, `czk`, `dkk`, `hkd`, `huf`, `ils`, `jpy`, `myr`, `mxn`, `nok`, `nzd`, `php`, `pln`, `rub`, `sek`, `chf`, `twd`, `thb`, `try`]. - **name** (string) - Name of the store. - **payment_methods** (string[]) - Array of payment method IDs associated with the store. - **products** (string[]) - Array of product IDs that are sold in the store. #### Response Example ```json { "object": "store", "id": "st_18", "currency": "EUR", "name": "Example store name", "payment_methods": [ "pm_7301", "pm_7302" ], "products": [ "pr_105676" ] } ``` #### Error Response (default) - **status** (integer) - Http status code. - **error_code** (string) - Readable error code. - **message** (string) - Detailed error message. - **errors** (object[]) - Validation errors if a POST request was sent. Otherwise not present. - **field** (string) - Field name that failed validation. - **value** (string) - Value of the field that failed validation. - **messages** (string[]) - Validation error message. - **expected** (object[]) - Expected value of the field. #### Error Response Example ```json { "status": 400, "error_code": "VALIDATION_ERROR", "message": "One or more fields failed validation", "errors": [ { "field": "name", "value": null, "messages": [ "Value is required and can't be empty" ], "expected": [] } ] } ``` ### Authorization **Type:** http **Scheme:** basic **Description:** Use base64 encoded api key created in Ticket Tailor dashboard. ``` -------------------------------- ### GET /v1/membership_types/:membership_type_id Source: https://developers.tickettailor.com/docs/api/get-membership-type-by-id Retrieves the details of a specific membership type by its unique ID. ```APIDOC ## GET /v1/membership_types/:membership_type_id ### Description Returns an existing membership type by its unique identifier. ### Method GET ### Endpoint https://api.tickettailor.com/v1/membership_types/:membership_type_id ### Parameters #### Path Parameters - **membership_type_id** (string) - Required - The unique identifier for the membership type (e.g., mt_123) ### Request Example ``` curl -L 'https://api.tickettailor.com/v1/membership_types/mt_123' \ -H 'Accept: application/json' \ -H 'Authorization: Basic ' ``` ### Response #### Success Response (200) - **object** (string) - Object type identifier - **id** (string) - Unique identifier for the membership type - **conditions_and_benefits** (string[]) - List of conditions and benefits - **max_redemptions** (integer) - Maximum number of redemptions allowed - **name** (string) - Name of the membership type - **photo_required** (string) - Whether a photo is required #### Response Example { "object": "membership_type", "id": "mt_123", "conditions_and_benefits": ["Free entry to all events", "10% discount on merchandise"], "max_redemptions": 10, "name": "Annual Pass", "photo_required": "false", "valid_from_type": "relative", "valid_to_type": "relative" } ```