Availability

Availability Check

Changed on

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
post/availability/

Request

  • Base URL: http://localhost:8080/api/octo
  • URL: http://localhost:8080/api/octo/availability/
  • Auth: HTTP bearer

Headers

Octo-Capabilitiesstring required

A list of the Capabilities (their IDs) initialized with your request.

Accept-Languagestring

This optional request header allows to specify preferred languages for content in the response. A language code that specifies the language of the product content. This code must conform to the BCP 47 standard, following RFC 5646 and RFC 4647 specifications for language tags. Examples include en-US for American English, fr-FR for French (France), and es-ES for Spanish (Spain). This header supports a comma-separated list of language tags with optional quality values (q) to indicate priority, such as en-US, fr-CA;q=0.8, fr;q=0.7, which prioritizes U.S. English, followed by Canadian French, and general French. This header is defined in the HTTP/1.1 specification (RFC 7231) and is commonly used for internationalized websites and services to enhance user experience. For more details, visit MDN Web Docs: Accept-Language - HTTP | MDN. Note this only determines preference and does not guarantee location has content available in the desired language.

Request body

productIdstring required

The product id.

optionIdstring required

The option id.

localDateStartstring

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

localDateEndstring

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

availabilityIdsstring[]

Filter the results by the given ids.

currencystring nullable

Can be used only when pricing capability is used.

Example request

{
  "productId": "6b903d44-dc24-4ca4-ae71-6bde6c4f4854",
  "optionId": "DEFAULT",
  "localDateStart": "2022-05-23",
  "localDateEnd": "2022-05-29"
}

Response

The request has succeeded.

idstring required

A unique identifier for this availability. This ID is used during booking and must be unique within the scope of an option.

localDateTimeStartstring required

The start time for this availability in the product’s local time zone. This value must conform to ISO 8601 standards (e.g., "2024-11-17T09:00:00+00:00").

localDateTimeEndstring required

The end time for this availability in the product’s local time zone. It must also adhere to ISO 8601 standards.

utcCutoffAtstring date-time required

The time by which the booking must be confirmed at

allDayboolean required

Indicates if this availability spans the entire day. If set to true, there will be no specific start or end times for this availability.

availableboolean required

Indicates if there are remaining slots available for this date or time slot.

status'AVAILABLE' | 'FREESALE' | 'SOLD_OUT' | 'LIMITED' | 'CLOSED' required
vacanciesinteger nullable required

Specifies the number of available slots remaining. Should be nulled or omitted when status is FREESALE. If availability is tracked per unit, this represents the maximum remaining quantity across all units.

capacityinteger nullable required

The total capacity for this availability.

maxUnitsinteger nullable required

The maximum number of units that can be sold in a single booking during this availability slot.

titlestring nullable

The public, customer-facing for the availablity. This name is displayed to end customers and should accurately represent the option for marketing and sales purposes. Can be null when not appliable

shortDescriptionstring

A brief, customer-facing description of the availability. This field provides a concise overview of availability.

Example response

[
  {
    "id": "2022-05-23T00:00:00+01:00",
    "localDateTimeStart": "2022-05-23T00:00:00+01:00",
    "localDateTimeEnd": "2022-05-24T00:00:00+01:00",
    "utcCutoffAt": "2022-05-22T23:00:00Z",
    "allDay": false,
    "available": true,
    "status": "AVAILABLE",
    "vacancies": 10,
    "capacity": 10,
    "maxUnits": null,
    "openingHours": [
      {
        "from": "08:00",
        "to": "16:00"
      }
    ]
  }
]

Changes