Tickets API | AnyRoad Help Center

Tickets API

October 18, 2024

Overview

The Tickets API allows you to interact with tickets associated with bookings on the AnyRoad platform. You can verify tickets to see if they are valid, and you can also scan a ticket (actually check-in a guest) using the endpoints provided below.

Endpoints

Verify Tickets

Endpoint

POST /tickets/verify

Description

Verify the validity of a ticket using its QR code without recording a scan event. Useful for checking ticket validity before performing an action.

Request Body Parameters

Request Body Example

{   "qr_code": "QR_CODE_STRING" }

Responses

200 OK

Returns the ticket information if the ticket is valid.

Response Body Example:

{   "url": "string",   "next_url": "string",   "previous_url": "string",   "first_url": "string",   "items": [     {       "type": "guest",       "qr_code": "string",       "experience": "string",       "booking": "string",       "guest": "string",       "time_slot": {         "local_datetime_start": "2019-08-24T14:15:22Z",         "local_datetime_end": "2019-08-24T14:15:22Z"       },       "scans": [         {           "device": "string",           "scanned_at": "2019-08-24T14:15:22Z"         }       ],       "id": "string",       "created": "2019-08-24T14:15:22Z",       "updated": "2019-08-24T14:15:22Z"     }   ] }

400 Bad Request

The request was malformed or invalid.

Possible error responses include:

Error Response Example:

{   "type": "https://example.com/error-type",   "title": "Incorrect parameters provided",   "status": 400,   "detail": "limit value 'abc' must be an integer",   "code": "limit_out_of_range",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a" }

401 Unauthorized

Invalid or missing authentication token.

500 Internal Server Error

An unexpected error occurred on the server.

Ticket Resource Structure

TicketItemResource

Represents an individual ticket.

Properties:

Scan Tickets

Endpoint

POST /tickets/scan

Description

Scan a ticket using its QR code. This action records a scan event for the ticket and returns the ticket information.

Request Body Parameters

Request Body Example

{   "device": "string",   "qr_code": "string" }

Responses

200 OK

Returns the ticket information after a successful scan.

400 Bad Request

The request was malformed or invalid.

401 Unauthorized

Invalid or missing authentication token.

500 Internal Server Error

An unexpected error occurred on the server.

Authentication

All requests to the Tickets API require authentication using a valid bearer token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Note: Replace placeholder values like YOUR_ACCESS_TOKEN, QR_CODE_STRING, request_id, and URLs with actual values when making requests.

If you have any additional questions, you can contact our Customer Experience team via chat or at support@anyroad.com.