Skip to main content
Tickets API
Updated over a week ago

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 - Verify the validity of a ticket using its QR code without recording a scan event. Useful for checking ticket validity before performing an action.

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


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

  • qr_code (string, required): The QR code of the ticket to be verified.

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:

  • MalformedProblem: Incorrect parameters provided.

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" }

  • TicketVerifyActionBookingCanceledError: The booking associated with the ticket has been canceled.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_canceled",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "canceled_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

  • TicketVerifyActionBookingInPastError: The booking is in the past and the ticket is no longer valid.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_in_past",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

  • TicketVerifyActionBookingInFutureError: The booking is in the future and the ticket is not yet valid.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_in_future",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

401 Unauthorized

Invalid or missing authentication token.

Error Response Example:

{   "type": "https://example.com/error-type",   "title": "Authorization token invalid",   "status": 401,   "detail": "please verify your authorization token is correct and has not expired",   "code": "invalid_bearer_token",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a" }

500 Internal Server Error

An unexpected error occurred on the server.

Error Response Example:

{   "type": "https://example.com/error-type",   "title": "Something went wrong",   "status": 500,   "detail": "please try again later",   "code": "server_error",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a" }

Ticket Resource Structure

TicketItemResource

Represents an individual ticket.

Properties:

  • id (string): Unique identifier of the ticket.

  • type (string): The type of ticket. Possible values are guest or addon.

  • qr_code (string): The QR code associated with the ticket.

  • experience (string): URL to the associated experience.

  • booking (string): URL to the associated booking.

  • guest (string): URL to the guest associated with the ticket.

  • time_slot (object): The time slot details.

    • local_datetime_start (string): Start date and time of the time slot in local timezone.

    • local_datetime_end (string): End date and time of the time slot in local timezone.

  • scans (array): List of scan events associated with the ticket.

    • device (string): Identifier of the device that performed the scan.

    • scanned_at (string): The date and time when the scan occurred.

  • created (string): The date and time when the ticket was created.

  • updated (string): The date and time when the ticket was last updated.

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"     }   ] }

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

  • device (string, required): The identifier of the device performing the scan.

  • qr_code (string, required): The QR code of the ticket to be scanned.

Request Body Example

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

Responses

200 OK

Returns the ticket information after a successful scan.

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:

  • MalformedProblem: Incorrect parameters provided.

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" }

  • TicketVerifyActionBookingCanceledError: The booking associated with the ticket has been canceled.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_canceled",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "canceled_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

  • TicketVerifyActionBookingInPastError: The booking is in the past and the ticket is no longer valid.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_in_past",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

  • TicketVerifyActionBookingInFutureError: The booking is in the future and the ticket is not yet valid.

Error Response Example:

{   "type": "guest",   "title": "Custom error title",   "status": 400,   "detail": "Custom error description",   "code": "booking_in_future",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a",   "booking_date": "2019-08-24T14:15:22Z",   "booking": "string",   "qr_code": "string",   "experience": "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"     }   ] }

401 Unauthorized

Invalid or missing authentication token.

Error Response Example:

{   "type": "https://example.com/error-type",   "title": "Authorization token invalid",   "status": 401,   "detail": "please verify your authorization token is correct and has not expired",   "code": "invalid_bearer_token",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a" }

500 Internal Server Error

An unexpected error occurred on the server.

Error Response Example:

{   "type": "https://example.com/error-type",   "title": "Something went wrong",   "status": 500,   "detail": "please try again later",   "code": "server_error",   "instance": "/path",   "request_id": "5f7e0797-7a42-4807-afaa-3efb80c8423a" }

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.

Did this answer your question?