Availability

Getting availability for a product

What you need to know:

The OCTo specification outlines a number of types of inventory calls. We implement the following OCTo availability calls:

POST /suppliers/:id/availability/ this endpoint will return a single availability object for each day, based on the request parameters. You MUST perform this step to obtain the availabilityId to perform a sale transaction.

You must pass in one of the following combinations of parameters for this endpoint:

  • localDate

  • localDateStart and localDateEnd

  • availabilityIds

Example of POST /availability/ :

POST /availability/
{
  "productId": "cabfc194-9443-40fa-8342-85ed9d8ec58c",
  "optionId": "DEFAULT",
  "localDateStart": "2024-10-10",
  "localDateEnd": "2024-10-20",
  "units": [
    { "id": "seniors_83af6d2c-1c35-4728-ac03-3418a75c5579", "quantity": 2 },
    { "id": "adults_0e064227-c793-426b-857c-2d1fcba62582", "quantity": 1 }
  ]
}

Check Availability

POST https://api.zaui.io/octo/availability

Determines the current availability of a product.

Request Body

Name
Type
Description

productId*

string/uuid

The product ID

optionId*

string

The option ID

localDateStart

string

Travel start date to search. (YYYY-MM-DD)

localDateEnd

string

Travel end date to search. (YYYY-MM-DD)

units[].id

string/uuid

seniors or adults or students or children or infants

units[].quantity

string

The unit quantity

localDate

string

The local date to query (Format: YYYY-MM-DD)

availabilityIds

array

Filter the results by given ids

[
    {
        "id": "2023-01-11T10:00:00-08:00",
        "localDateTimeStart": "2023-01-11T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-11T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-11T23:00:00Z",
        "openingHours": {
            "from": "06:00",
            "to": "20:00"
        }
    },
    {
        "id": "2023-01-12T10:00:00-08:00",
        "localDateTimeStart": "2023-01-12T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-12T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-12T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-13T10:00:00-08:00",
        "localDateTimeStart": "2023-01-13T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-13T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-13T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-14T10:00:00-08:00",
        "localDateTimeStart": "2023-01-14T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-14T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-14T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-15T10:00:00-08:00",
        "localDateTimeStart": "2023-01-15T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-15T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-15T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-16T10:00:00-08:00",
        "localDateTimeStart": "2023-01-16T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-16T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-16T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-17T10:00:00-08:00",
        "localDateTimeStart": "2023-01-17T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-17T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-17T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-18T10:00:00-08:00",
        "localDateTimeStart": "2023-01-18T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-18T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-18T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-19T10:00:00-08:00",
        "localDateTimeStart": "2023-01-19T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-19T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-19T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    },
    {
        "id": "2023-01-20T10:00:00-08:00",
        "localDateTimeStart": "2023-01-20T10:00:00-08:00",
        "localDateTimeEnd": "2023-01-20T12:00:00-08:00",
        "allDay": false,
        "available": true,
        "status": "FREESALE",
        "vacancies": null,
        "capacity": null,
        "maxUnits": 10000,
        "utcCutoffAt": "2023-01-20T23:00:00Z",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ]
    }
]

Check Availability Calendar

POST https://api.zaui.io/octo/availability/calendar/

Returns a single object per day. Designed for large date ranges used to populate an availability calendar.

Request Body

Name
Type
Description

productId*

string/uuid

The product ID

optionId*

string

The option ID

localDateStart*

string

Start date to query (Format: YYYY-MM-DD)

localDateEnd*

string

End date to query (Format: YYYY-MM-DD)

units

array

A list of units

units.id*

string/uuid

The unit id

units.quantity*

int

The quantity of the unit

[
    {
        "localDate": "2023-01-01",
        "available": true,
        "status": "AVAILABLE",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ],
        "vacancies": 14,
        "capacity": 14
    },
    {
        "localDate": "2023-01-02",
        "available": true,
        "status": "AVAILABLE",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ],
        "vacancies": 14,
        "capacity": 14
    },
    {
        "localDate": "2023-01-03",
        "available": true,
        "status": "AVAILABLE",
        "openingHours": [
            {
                "from": "06:00",
                "to": "20:00"
            }
        ],
        "vacancies": 14,
        "capacity": 14
    }
]

Response Objects:

Field

Description

id

The availability ID. You need this for making a Booking.

localDateTimeStart

The travel date/time for this availability, in the same time zone as the supplier's product.

localDateTimeEnd

The travel date/time for this availability, in the same time zone as the supplier's product.

allDay

Boolean indicating an all day or a fixed departure time. If true, then there will be no other available objects on the same day.

available

Whether there is availability for this date/time slot.

status

The status of that date. Possible values are:

AVAILABLE This availability is available for sale

FREESALE This availability has no capacity and is available.

SOLD_OUT This availability is not available

LIMITED This availability is available but limited.

vacancies

The remaining inventory.

capacity

Total allowed inventory.

maxUnits

Maximum number of units that can be sold within one booking on this date/time slot.

utcCutoffAt

The time by which the booking must be confirmed.

openingHours[].from

When this product opens (HH:MM)

openingHours[].to

When this product closes (HH:MM)

If the product status is CLOSED then there will be no availability object returned.

Last updated