Skip to content
Last updated

Availability

The Availability endpoint allows the Booking Channel to retrieve a list of available time slots for a specific Venue based on party size, date, and area.


IMPORTANT NOTE

If the venue has the bookableAreas property set to true, it is mandatory to first request the available areas before using this endpoint, as the availability is depending of the area.


Object definition

KeyTypeDescription
dateStringDate time in Timestamp UTC format (e.g. 1634387400 for 2021-10-16 14:30).
partySizeIntNumber of people.
slotsArrayList of maximum 9 available slots around the selected time.
slots[time]StringTime of the slot (e.g. "14:00").
slots[requireCreditCard]BooleanIndicates if a credit card is required to book the slot.
slots[amount]IntegerAmount to be paid. If 0, the credit card is only used as a guarantee.
slots[type]StringBooking type. Possible values: book, request.
openingTimesArrayFull list of available opening times for the venue.
nextAvailability[date]StringTimestamp of the next available slot.
nextAvailability[slots]ArraySlots available on the next available date.
previousAvailability[date]StringTimestamp of the previous available slot.
previousAvailability[slots]ArraySlots available on the previous available date.
requiresDurationBooleanIndicates if a duration is required to complete a booking.
durationsArrayList of available durations.
durations[value]IntDuration in seconds (e.g. 10800 for 3 hours).
durations[label]StringHuman-readable duration label (e.g. "3:00").
durations[endTime]StringLatest end time available for the selected duration.
bookingTypesArrayList of predefined booking types.
bookingTypes[id]StringID of the booking type to send during booking creation.
bookingTypes[name]StringName of the booking type to display to the user.

Get Venue Availability

This endpoint retrieves a list of slots available for a specific Venue on a specific date, session and party size.

Endpoint

GET https://api-sandbox.mozrest.com/v1/bc/availability

Query Parameters

ParameterStatusDescription
venueIdMandatoryVenue ID
areaIdOptionalArea ID to filter results.
dateMandatoryDate time in Timestamp UTC format (e.g. 1634387400 for 2021-10-16 14:30).
partySizeMandatoryNumber of persons (e.g. 4).

Example Request

curl GET "https://api-sandbox.mozrest.com/v1/bc/availability" \
  -H "Authorization: Bearer {{api_key}}" \
  -d "venueId=60e5a3ed409541da3650bd90" \
  -d "areaId=60e5a3ed409541da3650bd90" \
  -d "date=1633930574" \
  -d "partySize=4"

Example Response

{
  "date": 1677247200,
  "partySize": 2,
  "slots": [
    {
      "time": "12:00",
      "requireCreditCard": false,
      "amount": 0,
      "type": "book"
    },
    {
      "time": "14:00",
      "requireCreditCard": true,
      "amount": 2050,
      "type": "request"
    }
  ],
  "openingTimes": [
    {
      "time": "09:00"
    },
    {
      "time": "21:00"
    }
  ],
  "nextAvailability": {
    "date": 1664282700,
    "slots": [
      {
        "time": "12:45"
      }
    ]
  },
  "previousAvailability": {
    "date": 1664282700,
    "slots": [
      {
        "time": "12:45"
      }
    ]
  },
  "requiresDuration": true,
  "durations": [
    {
      "value": 10800,
      "label": "3:00",
      "endTime": "22:00"
    },
    {
      "value": 12600,
      "label": "3:30",
      "endTime": "22:30"
    }
  ],
  "bookingTypes": [
    {
      "id": "64ca5f2cab23a4112a7d2dde",
      "name": "Rugby World Cup"
    },
    {
      "id": "5f5b58da8ef6d152cf7b3fb5",
      "name": "Live Sports (let us know what you're here for)"
    }
  ]
}