Availability

The first step when making a sale is to check for availability. Note if allowFreesale is set to true on the product then this step is optional but it is advised you check it anyway if you can to check for closures.

OCTO has two main availability calls:

Availability Calendar endpoint is designed to be highly optimized and returns a single object per day. It's designed to be queried for large date ranges and the result is used to populate an availability calendar.

Availability Check endpoint may be slightly slower as it will return an object for each individual departure time (or day).

Availability Calendar

Availability Calendar

post

This endpoint is highly optimised and will return a single object per day. It's designed to be queried for large date ranges and the result is used to populate an availability calendar.

When the end user selects an open date you can call on /availability endpoint to get the availabilityId to create the booking.

Body
productIdstringRequired

The product id.

Example: 6b903d44-dc24-4ca4-ae71-6bde6c4f4854
optionIdstringRequired

The option id.

Example: DEFAULT
localDateStartstringRequired

Start date to query for (YYYY-MM-DD).

Example: 2022-05-23
localDateEndstringRequired

End date to query for (YYYY-MM-DD).

Example: 2022-05-29
Responses
chevron-right
200

OK

application/json

Schema for the /avalibility/calendar endpoint. For querying general open slots per day on a large range of days versus availability per departure time.

localDatestring · dateRequired

A single date to query. Must be ISO 8601 compliant date.

Example: 2022-05-12
availablebooleanRequired

Whether there is availability for this date / slot.

statusstring · enumRequired

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 There are no more spots available for this date / slot. LIMITED This availability is available but has less than 50% capacity left. CLOSED Availability is closed for this day / slot.

Example: AVAILABLEPossible values:
vacanciesinteger · nullableRequired

This SHOULD NOT be returned when status is FREESALE. This SHOULD be a shared pool for all Unit types in the Option. If availability is tracked per-Unit then this value MUST be equal to the available quantity for the Unit that has the most remaining.

Example: 10
capacityinteger · nullableRequired

The total capacity on this day.

Example: 10
post
/availability/calendar

Availability Check

triangle-exclamation

Availability Check

post

This endpoint is slightly slower as it will return an object for each individual departure time (or day). You have to perform this step to retrieve an availabilityId in order to confirm a sale, so if you just want to use this endpoint and skip the calendar endpoint then that's perfectly ok.

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

  • localDate
  • localeDateStart and localDateEnd
  • availabilityIds
Body
productIdstringRequired

The product id.

Example: 6b903d44-dc24-4ca4-ae71-6bde6c4f4854
optionIdstringRequired

The option id.

Example: DEFAULT
localDateStartstring · dateOptional

Start date to query for (YYYY-MM-DD). Required if localDateEnd is set.

Example: 2022-05-23
localDateEndstring · dateOptional

End date to query for (YYYY-MM-DD). Required if localDateStart is set.

Example: 2022-05-29
availabilityIdsstring[]Optional

Filter the results by the given ids.

Example: ["2022-05-23T00:00:00+01:00"]
Responses
chevron-right
200

OK

application/json

Schema for the /avalibility/calendar endpoint. It's designed to be queried for large date ranges and the result is used to populate an availability calendar.

idstringRequired

The availability id, you''ll need this when booking. MUST be a unique identifier within the scope of an option.

Example: 2022-05-23T00:00:00+01:00
localDateTimeStartstring · date-timeRequired

The start time for this availability. This will be in the local time zone of the product. Must be an ISO 8601 compliant date and time.

Example: 2022-05-23T00:00:00+01:00
localDateTimeEndstring · date-timeRequired

The end time for this availability. This will be in the local time zone of the product. Must be an ISO 8601 compliant date and time.

Example: 2022-05-24T00:00:00+01:00
allDaybooleanRequired

A boolean field indicating whether this is an all day availability and not a fixed departure time. If this value is true then there will be no other availability object on the same day.

availablebooleanRequired

Whether there is availability for this date / slot.

statusstring · enumRequired

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 There are no more spots available for this date / slot. LIMITED This availability is available but has less than 50% capacity left. CLOSED Availability is closed for this day / slot.

Example: AVAILABLEPossible values:
vacanciesinteger · nullableRequired

This SHOULD NOT be returned when status is FREESALE. This SHOULD be a shared pool for all Unit types in the Option. If availability is tracked per-Unit then this value MUST be equal to the available quantity for the Unit that has the most remaining.

Example: 10
capacityinteger · nullableRequired

The total capacity on this day.

Example: 10
maxUnitsinteger · nullableRequired

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

Example: 10
utcCutoffAtstringRequired

The time by which the booking must be confirmed at

Example: 2022-05-22T23:00:00Z
post
/availability

Last updated