### Run Supplier API Mock Server Source: https://github.com/tiqets/supplier-api/blob/master/supplier_server_mock/README.md Starts the Supplier API mock server. This command assumes the package has been installed and is available in your PATH. ```shell supplier_server ``` -------------------------------- ### Example Variant with Price (JSON) Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md An example of a 'variants' array entry that includes the optional 'price' object, specifying the amount and currency for a variant. ```json { "variants": [ { "id": "1", "name": "Adult", "available_tickets": 100, "price": { "amount": "10.99", "currency": "EUR" } } ] } ``` -------------------------------- ### Mock Server Source: https://context7.com/tiqets/supplier-api/llms.txt Instructions on how to install and run the `supplier-api-mock-server` for local testing. ```APIDOC ## Mock Server The `supplier-api-mock-server` package provides a local mock implementation for testing integrations against the Tiqets Supplier API specification. ### Installation ```bash pip install supplier-api-mock-server ``` ### Running the Mock Server - **Local installation:** ```bash supplier_server ``` - **Using Docker:** ```bash make image make run ``` ### Testing the Mock Server - **Get products:** ```bash curl -H "API-Key: secret" http://localhost:8000/v2/products ``` - **Get availability:** ```bash curl -H "API-Key: secret" "http://localhost:8000/v2/products/A300-FX/availability?start=2024-06-01&end=2024-06-07" ``` - **Create a reservation:** ```bash curl -X POST http://localhost:8000/v2/products/A300-FX/reservation \ -H "API-Key: secret" \ -H "Content-Type: application/json" \ -d '{ "datetime": "2024-06-26T15:30", "tickets": [{"variant_id": "adult", "quantity": 2}], "customer": { "first_name": "Test", "last_name": "User", "email": "test@example.com", "phone": "+1234567890", "country": "us" } }' ``` ``` -------------------------------- ### Install Supplier API Mock Server using pip Source: https://github.com/tiqets/supplier-api/blob/master/supplier_server_mock/README.md Installs the supplier-api-mock-server package using pip. Ensure you have Python 3.7+ installed. ```shell pip install supplier-api-mock-server ``` -------------------------------- ### Retrieve Product Catalog via HTTP Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Demonstrates the updated HTTP GET request structure for retrieving the product catalog in the v2 API. ```shell GET https://your-api-domain/v2/products ``` -------------------------------- ### GET /availability Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Retrieves the availability of products, including ticket counts and variant pricing. ```APIDOC ## GET /availability ### Description Returns availability for a product. The response is keyed by a timestamp (YYYY-MM-DDTHH:MM). If no timeslots are supported, the time must be T00:00. ### Method GET ### Endpoint /availability ### Response #### Success Response (200) - **[timestamp]** (object) - Availability data for the specific time slot. - **available_tickets** (integer) - Total tickets available. - **variants** (array) - List of ticket variants. - **price** (object, optional) - Pricing details (amount, currency). #### Response Example { "2022-12-19T16:30": { "available_tickets": 100, "variants": [ { "id": "TcGz7ywywiWYURHEWD", "name": "Adult", "available_tickets": 100, "price": { "amount": "10", "currency": "EUR" } } ] } } ``` -------------------------------- ### Build and Run Supplier API Mock Server with Docker Source: https://github.com/tiqets/supplier-api/blob/master/supplier_server_mock/README.md Builds the Docker image for the mock server and then runs it. This requires Docker to be installed and configured. ```shell make image make run ``` -------------------------------- ### CLI Testing Tool Source: https://context7.com/tiqets/supplier-api/llms.txt Instructions on how to install and use the `supplier-api-tester` package for validating API implementations. ```APIDOC ## CLI Testing Tool The `supplier-api-tester` package provides a command-line tool to validate API implementations against the specification. It supports testing individual endpoints or running the complete test suite. ### Installation ```bash pip install supplier-api-tester ``` ### Usage Examples - **List products from your API:** ```bash supplier_products -u 'http://localhost:8000' -k 'secret' -v 2 ``` - **Run all tests for a specific product:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -v 2 ``` - **Run only availability tests:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -a -v 2 ``` - **Run only reservation tests:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -r -v 2 ``` - **Run only booking tests:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -b -v 2 ``` - **Run only product catalog tests:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -c -v 2 ``` - **Test with timeslots enabled:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A300-FX' -t -v 2 ``` - **Disable colored output:** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -nc -v 2 ``` - **Test v1 API implementation (deprecated):** ```bash supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -v 1 ``` ``` -------------------------------- ### Perform API Requests via cURL Source: https://context7.com/tiqets/supplier-api/llms.txt Examples of making authenticated GET requests to the Tiqets API endpoints using cURL. These snippets demonstrate how to pass API keys and query parameters to retrieve availability data. ```bash curl -X GET "https://your-api-domain/v2/products/687345694/availability?start=2024-06-01" \ -H "API-Key: your-secret-key" ``` -------------------------------- ### Example cURL Request to Supplier API Mock Server Source: https://github.com/tiqets/supplier-api/blob/master/supplier_server_mock/README.md Demonstrates how to make a request to the mock server using cURL. It includes setting the API-Key header and specifies the endpoint for fetching products. ```shell curl -H "API-Key: secret" http://localhost:8000/v2/products ``` -------------------------------- ### GET /v2/products Source: https://context7.com/tiqets/supplier-api/llms.txt Retrieves the complete list of products, including metadata like timeslot support, refundability, and required visitor data fields. ```APIDOC ## GET /v2/products ### Description Returns the complete list of products (attractions, events, or tours) available from the supply partner. ### Method GET ### Endpoint /v2/products ### Request Example curl -X GET "https://your-api-domain/v2/products" -H "API-Key: your-secret-key" ### Response #### Success Response (200) - **id** (string) - Unique product identifier - **name** (string) - Name of the product - **use_timeslots** (boolean) - Whether the product requires timeslot selection - **is_refundable** (boolean) - Whether the product is refundable - **cutoff_time** (integer) - Minutes before start time for booking cutoff #### Response Example [ { "id": "687345694", "name": "Example Tour", "use_timeslots": true, "is_refundable": true, "cutoff_time": 30 } ] ``` -------------------------------- ### Reservation API Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Create a reservation for a product. The endpoint path remains the same, but it's now part of v2. ```APIDOC ## POST /v2/products/{product_id}/reservation ### Description Creates a reservation for a specific product. This endpoint is part of the v2 specification. ### Method POST ### Endpoint /v2/products/{product_id}/reservation ### Parameters #### Path Parameters - **product_id** (string) - Required - The ID of the product for which to create a reservation. #### Request Body - **reservation_details** (object) - Required - Details required for the reservation (e.g., date, time, quantity, visitor information). ### Request Example ```json { "reservation_details": { "date": "2023-10-27", "time": "11:00", "quantity": 2 } } ``` ### Response #### Success Response (200) - **reservation_id** (string) - The ID of the created reservation. - **status** (string) - The status of the reservation. #### Response Example ```json { "reservation_id": "res_abc123", "status": "confirmed" } ``` ``` -------------------------------- ### POST /reservation Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Handles reservation requests with updated requirements for datetime and order/visitor data. ```APIDOC ## POST /reservation ### Description Creates a reservation. Note that v2 requires a 'datetime' field and includes 'required_order_data' and 'required_visitor_data'. ### Method POST ### Endpoint /reservation ### Request Body - **datetime** (string) - Required - ISO 8601 formatted date and time. - **required_order_data** (object) - Required - Order-specific data requirements. - **required_visitor_data** (object) - Required - Visitor-specific data requirements. ### Response #### Success Response (200) - **unit_price** (string, optional) - Price per unit for the reservation. ``` -------------------------------- ### POST /booking Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Handles booking requests, supporting test order headers and updated response fields. ```APIDOC ## POST /booking ### Description Processes a booking. Supports an optional 'TIQETS-TEST-ORDER' header to identify test bookings. ### Method POST ### Endpoint /booking ### Headers - **TIQETS-TEST-ORDER** (string) - Optional - Used to mark the request as a test booking. ### Response #### Success Response (200) - **barcode_scope** (string) - Renamed from 'barcode_position' in v1. ``` -------------------------------- ### Booking API Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Process a booking. The endpoint path is updated to v2. ```APIDOC ## POST /v2/booking ### Description Processes a booking. This endpoint is part of the v2 specification. ### Method POST ### Endpoint /v2/booking ### Parameters #### Request Body - **booking_details** (object) - Required - Details required for the booking (e.g., reservation ID, payment information). ### Request Example ```json { "booking_details": { "reservation_id": "res_abc123", "payment_method": "credit_card" } } ``` ### Response #### Success Response (200) - **booking_id** (string) - The ID of the confirmed booking. - **confirmation_number** (string) - The confirmation number for the booking. #### Response Example ```json { "booking_id": "book_xyz789", "confirmation_number": "CONF-123456789" } ``` ``` -------------------------------- ### Product Catalog API Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Retrieve the product catalog. Version 2 simplifies the endpoint and introduces new optional fields in the response. ```APIDOC ## GET /v2/products ### Description Retrieves the product catalog. This endpoint has been simplified in v2 compared to v1. ### Method GET ### Endpoint /v2/products ### Parameters #### Query Parameters - **use_timeslots** (boolean) - Removed in v2 ### Response #### Success Response (200) - **max_tickets_per_order** (integer) - Optional - Specify the maximum amount of tickets that can be added to a single order. The absence of this field will mean that the product doesn't have such limits. - **required_visitor_data** (array) - Optional - A list of additional data that is required from each visitor (e.g., _full name_, _email_, _phone_, _address_, _passport id_, _date of birth_). - **required_order_data** (array) - Optional - A list of the additional fields required to be delivered on the order level (e.g., _pickup location_, _nationality_, _zip code_). #### Response Example ```json { "products": [ { "id": "prod_123", "name": "Eiffel Tower Ticket", "max_tickets_per_order": 10, "required_visitor_data": ["full name", "email"], "required_order_data": ["nationality"] } ] } ``` ``` -------------------------------- ### Fetch Product Availability Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Compares v1 and v2 availability endpoints. V2 consolidates separate v1 endpoints for timeslots and variants into a single unified availability endpoint. ```shell # v1 Availability (Timeslots) GET https://your-api-domain/v1/products/{product-id}/timeslots # v1 Availability (Full-day) GET https://your-api-domain/v1/products/{product-id}/variants # v2 Unified Availability GET https://your-api-domain/v2/products/{product-id}/availability ``` -------------------------------- ### Get Product Catalog (Bash) Source: https://context7.com/tiqets/supplier-api/llms.txt Retrieves the complete list of products offered by a supply partner. This endpoint is crucial for understanding available attractions, events, or tours, including their metadata like timeslot support, refundability, and pricing availability. It requires an API-Key for authentication. ```bash # Get product catalog curl -X GET "https://your-api-domain/v2/products" \ -H "API-Key: your-secret-key" ``` -------------------------------- ### Availability API Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Fetch product availability, supporting both timeslots and full-day products with a single endpoint in v2. ```APIDOC ## GET /v2/products/{product_id}/availability ### Description Fetches the availability for a given product. This v2 endpoint consolidates availability fetching for products with or without timeslots, replacing separate endpoints from v1. ### Method GET ### Endpoint /v2/products/{product_id}/availability ### Parameters #### Path Parameters - **product_id** (string) - Required - The ID of the product to fetch availability for. ### Response #### Success Response (200) - **availability** (array) - A list of available dates and timeslots for the product. #### Response Example ```json { "availability": [ { "date": "2023-10-27", "slots": ["10:00", "11:00", "12:00"] } ] } ``` ``` -------------------------------- ### Cancellation API Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Cancel an existing booking. The endpoint path is updated to v2. ```APIDOC ## DELETE /v2/booking ### Description Cancels an existing booking. This endpoint is part of the v2 specification. ### Method DELETE ### Endpoint /v2/booking ### Parameters #### Query Parameters - **booking_id** (string) - Required - The ID of the booking to cancel. ### Response #### Success Response (200) - **status** (string) - The status of the cancellation (e.g., "cancelled"). #### Response Example ```json { "status": "cancelled" } ``` ``` -------------------------------- ### Error Code Migration Overview Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Summary of changes to error codes for specific API v2 endpoints compared to v1. ```APIDOC ## Error Code Changes (v1 to v2) ### Description This section details the migration of error codes for specific endpoints. Developers must update their error handling logic to account for deprecated codes and new additions in v2. ### Affected Endpoints - `/v2/products/{product_id}/availability` - `/v2/products/{product_id}/reservation` - `/v2/booking/{booking_id}` ### Summary Table | Endpoint | Error Code | v1 Status | v2 Status | | --- | --- | --- | --- | | `/v2/products/{product_id}/availability` | 2009 | present | removed | | `/v2/products/{product_id}/reservation` | 2006 | present | removed | | `/v2/products/{product_id}/reservation` | 2010 | present | removed | | `/v2/products/{product_id}/reservation` | 1003 | N/A | new | | `/v2/booking/{booking_id}` | 3005 | N/A | new | ### Additional Resources For a comprehensive list of all supported error codes in v2, please refer to the [Official API Documentation](https://tiqets.github.io/supplier-api/). ``` -------------------------------- ### GET /v2/products/{id}/availability Source: https://context7.com/tiqets/supplier-api/llms.txt Checks real-time availability for a specific product within a defined date range, returning ticket counts and pricing variants. ```APIDOC ## GET /v2/products/{id}/availability ### Description Returns available variants (ticket types) for a product within a specified date range. ### Method GET ### Endpoint /v2/products/{id}/availability ### Parameters #### Path Parameters - **id** (string) - Required - The unique product identifier #### Query Parameters - **start** (string) - Required - Start date in YYYY-MM-DD format - **end** (string) - Required - End date in YYYY-MM-DD format ### Request Example curl -X GET "https://your-api-domain/v2/products/687345694/availability?start=2024-06-01&end=2024-06-01" ### Response #### Success Response (200) - **available_tickets** (integer) - Total tickets available for the slot - **variants** (array) - List of ticket types with pricing #### Response Example { "2024-06-01T11:00": { "available_tickets": 100, "variants": [ { "id": "TcGz7ywywiWYURHEWD", "name": "Adult", "price": { "amount": "10.00", "currency": "EUR" } } ] } } ``` -------------------------------- ### Availability Response Schema without Timeslots (JSON) Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Demonstrates the JSON response format for products that do not support timeslots. The time component in the key is fixed to 'T00:00'. ```json { "2022-12-19T00:00": { "available_tickets": 100, "variants": [ { "id": "Y0J7aP1f3", "name": "Adult", "available_tickets": 100, "price": { "amount": "10", "currency": "EUR" } }, { "id": "3cSQ8i", "name": "Child", "available_tickets": 10 } ] } } ``` -------------------------------- ### Get Product Availability (Bash) Source: https://context7.com/tiqets/supplier-api/llms.txt Fetches available ticket variants and quantities for a specific product within a given date range. This endpoint is essential for real-time availability checks and can include optional pricing information. It supports both timeslot-based and full-day products, with specific handling for the time component in the response. ```bash # Get availability for a product with timeslots curl -X GET "https://your-api-domain/v2/products/687345694/availability?start=2024-06-01&end=2024-06-07" \ -H "API-Key: your-secret-key" ``` ```bash # Get availability for a full-day product (no timeslots) curl -X GET "https://your-api-domain/v2/products/345678900-345678/availability?start=2024-06-01&end=2024-06-01" \ -H "API-Key: your-secret-key" ``` ```bash # No availability response # Response (200 OK) {} ``` -------------------------------- ### Variant Price Field Schema (JSON) Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Defines the schema for the optional 'price' field within the 'variants' array in the availability response. It includes 'amount' and 'currency'. ```json { "amount": string, "currency": string } ``` -------------------------------- ### Availability Response Schema (JSON) Source: https://github.com/tiqets/supplier-api/blob/master/MIGRATION.md Illustrates the JSON structure for the availability endpoint's response, where keys represent available days/timeslots in 'YYYY-MM-DDTHH:MM' format. Includes details on 'available_tickets' and 'variants'. ```json { "2022-12-19T16:30": { "available_tickets": 100, "variants": [ { "id": "TcGz7ywywiWYURHEWD", "name": "Adult", "available_tickets": 100, "price": { "amount": "10", "currency": "EUR" } }, { "id": "hKl5sDxP9ont4GB", "name": "Child", "available_tickets": 10 } ] } } ``` -------------------------------- ### Run Local Mock Server Source: https://context7.com/tiqets/supplier-api/llms.txt The mock server provides a local environment to simulate the Tiqets Supplier API. It supports product listing, availability checks, and reservation creation via standard HTTP requests. ```bash pip install supplier-api-mock-server supplier_server ``` -------------------------------- ### Create Temporary Reservation - Bash Source: https://context7.com/tiqets/supplier-api/llms.txt Creates a temporary reservation for tickets for a specific product. The request includes the desired datetime, ticket variants with quantities, and customer information. Products may have additional requirements for visitor or order data. The response provides a reservation ID and expiration time. ```bash # Basic reservation without additional visitor data curl -X POST "https://your-api-domain/v2/products/687345694/reservation" \ -H "API-Key: your-secret-key" \ -H "Content-Type: application/json" \ -d '{ "datetime": "2024-06-26T15:30", "tickets": [ { "variant_id": "TcGz7ywywiWYURHEWD", "quantity": 2 }, { "variant_id": "hKl5sDxP9ont4GB", "quantity": 1 } ], "customer": { "first_name": "Jon", "last_name": "Snow", "email": "jon@snow.com", "phone": "+48 555 555 555", "country": "nl" } }' # Response (200 OK) - Product without pricing { "expires_at": "2024-06-26T16:00:00+00:00", "reservation_id": "78940" } # Response (200 OK) - Product with pricing (provides_pricing=true) { "expires_at": "2024-06-26T16:00:00+00:00", "reservation_id": "78940", "unit_price": { "TcGz7ywywiWYURHEWD": { "amount": "10.00", "currency": "EUR" }, "hKl5sDxP9ont4GB": { "amount": "5.75", "currency": "EUR" } } } # Reservation with required visitor and order data curl -X POST "https://your-api-domain/v2/products/UFJELUEtMTIzNDU=/reservation" \ -H "API-Key: your-secret-key" \ -H "Content-Type: application/json" \ -d '{ "datetime": "2024-06-26T15:30", "tickets": [ { "variant_id": "rLVezl2rFjo5Hxtb", "quantity": 2, "required_visitor_data": [ { "full_name": "Jon Snow", "email": "jon@snow.com" }, { "full_name": "Tyrion Lannister", "email": "tyrion@casterlyrock.com" } ] }, { "variant_id": "h2xK0CeEYeN7n", "quantity": 1, "required_visitor_data": [ { "full_name": "Arya Stark", "email": "arya@north.com" } ] } ], "customer": { "first_name": "Jon", "last_name": "Snow", "email": "jon@snow.com", "phone": "+48 555 555 555", "country": "nl" }, "required_order_data": { "pickup_location": "Porto Azzurro Aparthotel, Malta", "passport_id": "AB123456" } }' # Response (200 OK) { "expires_at": "2024-06-26T16:00:00+00:00", "reservation_id": "78941" } # Reservation for full-day product (time is T00:00) curl -X POST "https://your-api-domain/v2/products/345678900-345678/reservation" \ -H "API-Key: your-secret-key" \ -H "Content-Type: application/json" \ -d '{ "datetime": "2024-06-26T00:00", "tickets": [ { "variant_id": "Y0J7aP1f3", "quantity": 2 } ], "customer": { "first_name": "Jon", "last_name": "Snow", "email": "jon@snow.com", "phone": "+48 555 555 555", "country": "nl" } }' ``` -------------------------------- ### Validate API with CLI Tester Source: https://context7.com/tiqets/supplier-api/llms.txt The supplier-api-tester tool allows developers to validate API implementations against the specification. It supports running full test suites or specific categories like availability, reservation, or product catalog tests. ```bash pip install supplier-api-tester supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -v 2 ``` -------------------------------- ### POST /v2/products/{productId}/reservation Source: https://context7.com/tiqets/supplier-api/llms.txt Creates a temporary reservation for tickets for a specific product. This endpoint is used to hold tickets before the customer completes the payment. It supports specifying ticket variants, quantities, customer details, and optionally, required visitor and order data. ```APIDOC ## POST /v2/products/{productId}/reservation ### Description Creates a temporary reservation for tickets. The request includes the datetime, ticket variants with quantities, and customer information. Products may require additional visitor data or order-level data. Returns a reservation ID and expiration time. ### Method POST ### Endpoint `/v2/products/{productId}/reservation` ### Parameters #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. #### Query Parameters None #### Request Body - **datetime** (string) - Required - The desired date and time for the reservation (e.g., "YYYY-MM-DDTHH:MM"). - **tickets** (array) - Required - An array of ticket objects, each specifying `variant_id` and `quantity`. - **variant_id** (string) - Required - The ID of the ticket variant. - **quantity** (integer) - Required - The number of tickets for this variant. - **required_visitor_data** (array) - Optional - An array of visitor data objects if required by the product. - **full_name** (string) - Required - Full name of the visitor. - **email** (string) - Required - Email address of the visitor. - **customer** (object) - Required - Customer information. - **first_name** (string) - Required - Customer's first name. - **last_name** (string) - Required - Customer's last name. - **email** (string) - Required - Customer's email address. - **phone** (string) - Required - Customer's phone number. - **country** (string) - Required - Customer's country code (e.g., "nl"). - **required_order_data** (object) - Optional - Additional data required at the order level. - **pickup_location** (string) - Optional - The location for ticket pickup. - **passport_id** (string) - Optional - Passport ID if required. ### Request Example ```json { "datetime": "2024-06-26T15:30", "tickets": [ { "variant_id": "TcGz7ywywiWYURHEWD", "quantity": 2 }, { "variant_id": "hKl5sDxP9ont4GB", "quantity": 1 } ], "customer": { "first_name": "Jon", "last_name": "Snow", "email": "jon@snow.com", "phone": "+48 555 555 555", "country": "nl" } } ``` ### Response #### Success Response (200 OK) - **expires_at** (string) - The expiration time of the reservation. - **reservation_id** (string) - The unique identifier for the reservation. - **unit_price** (object) - Optional. Contains pricing details per ticket variant if `provides_pricing` is true for the product. - **amount** (string) - The price amount. - **currency** (string) - The currency of the price. #### Response Example ```json { "expires_at": "2024-06-26T16:00:00+00:00", "reservation_id": "78940", "unit_price": { "TcGz7ywywiWYURHEWD": { "amount": "10.00", "currency": "EUR" }, "hKl5sDxP9ont4GB": { "amount": "5.75", "currency": "EUR" } } } ``` ``` -------------------------------- ### Confirm Booking and Generate Tickets - Bash Source: https://context7.com/tiqets/supplier-api/llms.txt Confirms a previously created reservation, generating tickets with barcodes after customer payment. Supports various barcode formats (QRCODE, CODE128, PDF) and scopes (per-order or per-ticket). Test bookings can be identified using the TIQETS-TEST-ORDER header. The response includes a booking ID and barcode information. ```bash # Confirm a booking curl -X POST "https://your-api-domain/v2/booking" \ -H "API-Key: your-secret-key" \ -H "Content-Type: application/json" \ -d '{ "reservation_id": "78940", "order_reference": "12345678910" }' # Response (200 OK) - One barcode per visitor { "booking_id": "657788", "barcode_format": "QRCODE", "barcode_scope": "ticket", "tickets": { "TcGz7ywywiWYURHEWD": [ "BARCODE-ADULT-001", "BARCODE-ADULT-002" ], "hKl5sDxP9ont4GB": [ "BARCODE-CHILD-001" ] } } # Response (200 OK) - Single barcode for entire order { "booking_id": "657789", "barcode_format": "QRCODE", "barcode_scope": "order", "barcode": "ORDER-BARCODE-001" } # Response (200 OK) - PDF barcode (base64 encoded) { "booking_id": "657787", "barcode_format": "PDF", "barcode_scope": "order", "barcode": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PgplbmRvYmoK..." } # Test booking (marked in supplier's system) curl -X POST "https://your-api-domain/v2/booking" \ -H "API-Key: your-secret-key" \ -H "TIQETS-TEST-ORDER: true" \ -H "Content-Type: application/json" \ -d '{ "reservation_id": "78940", "order_reference": "TEST-123456" }' ``` -------------------------------- ### Cancel Booking - Bash Source: https://context7.com/tiqets/supplier-api/llms.txt Cancels a previously confirmed booking using its booking ID. A successful cancellation results in a 204 No Content response. Note that cancellations may be restricted based on the product's cutoff time settings. ```bash # Cancel a booking curl -X DELETE "https://your-api-domain/v2/booking/657788" \ -H "API-Key: your-secret-key" # Response (204 No Content) - Success ``` -------------------------------- ### POST /v2/booking Source: https://context7.com/tiqets/supplier-api/llms.txt Confirms a reservation after customer payment and generates tickets with barcodes. This endpoint supports various barcode formats and scopes. Test bookings can be marked using a specific header. ```APIDOC ## POST /v2/booking ### Description Confirms a reservation after customer payment and generates tickets with barcodes. Supports various barcode formats (QRCODE, CODE128, PDF, etc.) and scopes (per-order or per-ticket). Test bookings can be marked using the TIQETS-TEST-ORDER header. ### Method POST ### Endpoint `/v2/booking` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **reservation_id** (string) - Required - The ID of the reservation to confirm. - **order_reference** (string) - Required - A unique reference for the order. ### Request Example ```json { "reservation_id": "78940", "order_reference": "12345678910" } ``` ### Response #### Success Response (200 OK) - **booking_id** (string) - The unique identifier for the confirmed booking. - **barcode_format** (string) - The format of the generated barcodes (e.g., "QRCODE", "PDF"). - **barcode_scope** (string) - Indicates whether barcodes are generated per ticket or per order. - **tickets** (object) - Optional. A mapping of ticket variant IDs to an array of generated barcodes, if `barcode_scope` is "ticket". - **barcode** (string) - Optional. The single barcode for the entire order, if `barcode_scope` is "order". This may be base64 encoded for formats like PDF. #### Response Example ```json { "booking_id": "657788", "barcode_format": "QRCODE", "barcode_scope": "ticket", "tickets": { "TcGz7ywywiWYURHEWD": [ "BARCODE-ADULT-001", "BARCODE-ADULT-002" ], "hKl5sDxP9ont4GB": [ "BARCODE-CHILD-001" ] } } ``` ### Headers - **TIQETS-TEST-ORDER** (boolean) - Optional. Set to `true` to mark this as a test order. This will not generate actual tickets but will simulate the booking process. ``` -------------------------------- ### Error Response Format Source: https://context7.com/tiqets/supplier-api/llms.txt Details the structure of error responses for 400-range errors, categorized by error codes. ```APIDOC ## Error Response Format All 400-range errors return a structured JSON response with error code, error name, and descriptive message. Error codes are categorized: 1xxx for missing input, 2xxx for invalid input, and 3xxx for processing failures. ### Common Error Examples - **Error 1000: Missing required argument** ```json { "error_code": 1000, "error": "Missing argument", "message": "Required argument end was not found" } ``` - **Error 1001: Product not found** ```json { "error_code": 1001, "error": "Missing product", "message": "Product with ID nonexistent doesn't exist" } ``` - **Error 2000: Invalid date format** ```json { "error_code": 2000, "error": "Malformed datetime", "message": "Incorrect date format, please use the YYYY-MM-DD format" } ``` - **Error 3000: Availability error during reservation** ```json { "error_code": 3000, "error": "Availability error", "message": "The requested number of tickets is not longer available for the given variant and/or date/timeslot" } ``` - **Error 3001: Reservation expired during booking** ```json { "error_code": 3001, "error": "Reservation expired", "message": "Your reservation has expired 15 minutes ago" } ``` - **Error 3003: Booking already cancelled** ```json { "error_code": 3003, "error": "Already Cancelled", "message": "The booking with ID 657788 has already been cancelled" } ``` - **Error 3005: Tickets already used** ```json { "error_code": 3005, "error": "Tickets already used", "message": "The booking can't be cancelled because tickets have already been used" } ``` - **Error 2009: Within cutoff time** ```json { "error_code": 2009, "error": "Incorrect date", "message": "The booking can only be cancelled 24 hours in advance" } ``` ### Authentication Failure - **Response (403 Forbidden)** - Empty body ``` -------------------------------- ### DELETE /v2/booking/{bookingId} Source: https://context7.com/tiqets/supplier-api/llms.txt Cancels a previously confirmed booking using its booking ID. Note that cancellations may be restricted based on the product's cutoff time settings. ```APIDOC ## DELETE /v2/booking/{bookingId} ### Description Cancels a previously confirmed booking by booking ID. Returns 204 No Content on success. Cancellation may be restricted by the product's cutoff time setting. ### Method DELETE ### Endpoint `/v2/booking/{bookingId}` ### Parameters #### Path Parameters - **bookingId** (string) - Required - The unique identifier of the booking to cancel. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X DELETE "https://your-api-domain/v2/booking/657788" \ -H "API-Key: your-secret-key" ``` ### Response #### Success Response (204 No Content) Indicates that the booking was successfully cancelled. ``` -------------------------------- ### Handle API Error Responses Source: https://context7.com/tiqets/supplier-api/llms.txt Standardized JSON error response structure for 400-range HTTP errors. Error codes are categorized by type: 1xxx for missing inputs, 2xxx for invalid inputs, and 3xxx for processing failures. ```json { "error_code": 3003, "error": "Already Cancelled", "message": "The booking with ID 657788 has already been cancelled" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.