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

[
    {
        "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

[
    {
        "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:

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

Last updated