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

Authorizations
Header parameters
Octo-CapabilitiesstringRequired

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

Accept-LanguagestringOptional

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.

Body
productIdstringRequired

The product id.

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

The option id.

Example: DEFAULT
localDateStartstringOptional

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

Example: 2022-05-23
localDateEndstringOptional

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

Example: 2022-05-29
currencystringOptional

Can be used only when pricing capability is used.

Example: USD
Responses
200
The request has succeeded.
application/json
post
POST /api/octo/availability/calendar HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Octo-Capabilities: text
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "productId": "6b903d44-dc24-4ca4-ae71-6bde6c4f4854",
  "optionId": "DEFAULT",
  "localDateStart": "2022-05-23",
  "localDateEnd": "2022-05-29"
}
[
  {
    "localDate": "2022-06-14",
    "available": true,
    "status": "FREESALE",
    "vacancies": null,
    "capacity": null,
    "openingHours": [
      {
        "from": "08:00",
        "to": "16:00"
      }
    ]
  },
  {
    "localDate": "2022-06-15",
    "available": true,
    "status": "FREESALE",
    "vacancies": null,
    "capacity": null,
    "openingHours": [
      {
        "from": "08:00",
        "to": "16:00"
      }
    ]
  },
  {
    "localDate": "2022-06-16",
    "available": true,
    "status": "FREESALE",
    "vacancies": null,
    "capacity": null,
    "openingHours": [
      {
        "from": "08:00",
        "to": "16:00"
      }
    ]
  }
]

Availability Check

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

Authorizations
Header parameters
Octo-CapabilitiesstringRequired

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

Accept-LanguagestringOptional

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.

Body
productIdstringRequired

The product id.

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

The option id.

Example: DEFAULT
localDateStartstringOptional

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

Example: 2022-05-23
localDateEndstringOptional

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

Can be used only when pricing capability is used.

Example: USD
Responses
200
The request has succeeded.
application/json
post
POST /api/octo/availability/ HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Octo-Capabilities: text
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "productId": "6b903d44-dc24-4ca4-ae71-6bde6c4f4854",
  "optionId": "DEFAULT",
  "localDateStart": "2022-05-23",
  "localDateEnd": "2022-05-29"
}
[
  {
    "id": "2022-06-30T00:00:00+01:00",
    "localDateTimeStart": "2022-06-30T00:00:00+01:00",
    "localDateTimeEnd": "2022-07-01T00:00:00+01:00",
    "allDay": true,
    "available": true,
    "status": "FREESALE",
    "vacancies": null,
    "capacity": null,
    "maxUnits": null,
    "utcCutoffAt": "2022-06-29T22:00:00Z",
    "openingHours": [
      {
        "from": "08:00",
        "to": "16:00"
      }
    ]
  }
]

Last updated

Was this helpful?