OCTO Developer Hub
OCTO WebsiteOpenAPI (Swagger)Become a Member
  • Welcome
  • Getting Started
    • Glossary of Terms
    • Errors
    • Headers
    • Authentication
    • Endpoints & Capabilities
    • Schemas
    • Development Support
  • OCTO API Core
    • Supplier
    • Products
    • Availability
    • Bookings
  • Capabilities (Optional)
    • Pricing
    • Notifications
    • Content
    • Pickups (Proposed Draft)
    • Promotions (Proposed Draft)
  • Additional Resources
    • Validation Tool
    • Postman Collections
    • Known Implementations
Powered by GitBook
On this page

Was this helpful?

  1. OCTO API Core

Availability

PreviousProductsNextBookings

Last updated 1 year ago

Was this helpful?

The first step when making a sale is to check for availability. Note if allowFreesale is set to true on the 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:

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.

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

Availability Calendar

Availability Check

A reseller has to perform to retrieve an availabilityId in order to make a , so this endpoint is critical for the booking flow.

product
Availability Calendar
Availability Check
Availability Check
  • Availability Calendar
  • POSTAvailability Calendar
  • Availability Check
  • POSTAvailability Check

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
200
OK
application/json
400
Example response
application/json
post
POST /octo/availability/calendar HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "productId": "6b903d44-dc24-4ca4-ae71-6bde6c4f4854",
  "optionId": "DEFAULT",
  "localDateStart": "2022-06-14",
  "localDateEnd": "2022-06-16"
}
[
  {
    "localDate": "2022-06-14",
    "available": true,
    "status": "AVAILABLE",
    "vacancies": 20,
    "capacity": 20,
    "openingHours": []
  },
  {
    "localDate": "2022-06-15",
    "available": true,
    "status": "AVAILABLE",
    "vacancies": 10,
    "capacity": 10,
    "openingHours": []
  },
  {
    "localDate": "2022-06-16",
    "available": true,
    "status": "AVAILABLE",
    "vacancies": 10,
    "capacity": 10,
    "openingHours": []
  }
]

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
200
OK
application/json
400
Example response
application/json
post
POST /octo/availability HTTP/1.1
Host: api.example.com
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": "09:00",
        "to": "17:00"
      }
    ]
  }
]
Booking Reservation