Skip to content

Firehose and Checkout \[BETA\]

Is an Opportunity Bookable?

It is possible to book, in Checkout, ScheduledSessions and Slots that are found in Firehose. Not all of these are bookable. In order to determine whether a ScheduledSession or Slot is bookable, find its associated SessionSeries or FacilityUse in the respective endpoints and check that the following three requirements are ALL met:

  1. (ScheduledSession/Slot) imin:isPotentiallyBookable is TRUE
    • This means that the ScheduledSession/Slot is bookable.
    • This could be FALSE if e.g. this particular occurrence ran out of spaces.
  2. (SessionSeries/FacilityUse) imin:aggregateOffer.publicAdult.imin:isPotentiallyBookable is TRUE
    • This means that the SessionSeries/FacilityUse is bookable.
    • This could be FALSE if e.g. this opportunity does not support online bookings.
  3. (ScheduledSession/Slot) startDate is within the window specified by (SessionSeries/FacilityUse)imin:aggregateOffer.publicAdult.validFromBeforeStartDate
    • The start of the time window is the startDate (i.e. the time that the customer is browsing this data) minus the validFromBeforeStartDate duration e.g. if validFromBeforeStartDate is P1W (“one week”), then the ScheduledSession/Slot is only bookable for the one week period before it starts. It cannot be booked 8 days before it starts.
    • The end of the time window is the startDate - Otherwise, it’s already started!

Booking a Session or Slot

If an opportunity is bookable according to the rules above, you can show your customers a “Book” button/link which uses the following URL, for ScheduledSessions:

https://{checkoutBaseUrl}/v1/scheduled-sessions/{scheduled-session-identifier}

Where:

  • checkoutBaseUrl is the Checkout hostname that we’ve set up together e.g. checkout.acmesports.com (see here for more information).
  • scheduled-session-identifier: The .identifier field in the bookable ScheduledSession. This must be URI encoded.

And for Slots:

https://{checkoutBaseUrl}/v1/slots/{slot-identifier}

Where:

  • slot-identifier: The .identifier field in the bookable Slot. This must be URI encoded.