Firehose and Checkout [BETA]
Is an Opportunity Bookable?
The exact name of the field referred to below as imin:isPotentiallyBookable
has yet to be agreed upon. With this in mind, the following should be used for reference purposes only and should not be coded against.
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:
(
ScheduledSession
/Slot
)imin:isPotentiallyBookable
isTRUE
This means that the
ScheduledSession
/Slot
is bookable.This could be
FALSE
if e.g. this particular occurrence ran out of spaces.
(
SessionSeries
/FacilityUse
)imin:aggregateOffer.publicAdult.imin:isPotentiallyBookable
isTRUE
This means that the
SessionSeries
/FacilityUse
is bookable.This could be
FALSE
if e.g. this opportunity does not support online bookings.
(
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 thevalidFromBeforeStartDate
duration e.g. ifvalidFromBeforeStartDate
isP1W
("one week"), then theScheduledSession
/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!
Put another way, in order to realise if something is bookable, you must ask:
Is the
SessionSeries
/FacilityUse
potentially bookable?Is the
ScheduledSession
/Slot
potentially bookable?Is the time that the end user is making the request to book in the valid time before?
A session/facility that is only for children will not have imin:aggregateOffer.publicAdult
, which means that the 2nd requirement from the list above will not be met. You should, therefore, consider these items not to be bookable.
For information on how to locate the the associated SessionSeries
/FacilityUse
based on data in the ScheduledSession
/Slot
(and vice versa), please refer to Introduction to the Firehose.
Is a parent potentially bookable? If the parent does not exist or is not potentially bookable, then the ScheduledSession
/Slot
will not be potentially bookable.
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
:
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 bookableScheduledSession
. This must be URI encoded.
And for Slots
:
Where:
slot-identifier
: The.identifier
field in the bookable Slot. This must be URI encoded.
To learn more about the checkoutBaseUrl
and how to set one up, please refer to Your {checkoutBaseUrl}
& your DNS settings.
Last updated