Packages
Adds package information showing sub-products within a booking
To use this capability add octo/packages
to your Octo-Capabilities
header.
Packages are when a product contains multiple sub-products. Generally it's fine to sell packages without needing this capability, but using it will expose more information about the sub-products and allows you to customise the travel date of them.
Get Package Includes
GET
https://api.ventrata.com/octo/products
The product schema has been updated to introduce two new fields:
product.isPackage
which is a boolean field indicating whether this product is a package and therefore contains sub-products.
option.packageIncludes
a list of the sub-products in groups on the option level.
For example:
In the example above we have two include groups Premium Products
and Standard Products
this package is configured to allow you to pick 1 premium product and 5 standard products from the includes list.
The field definitions on the include
object are as follows:
Now we need to book the inclusions.
Package Booking
POST
https://api.ventrata.com/octo/bookings
It's possible to pick your includes before and after the booking is created. The process for doing so is identical and in this example we do it on the booking reservation call just as an example:
In this example we make the booking reservation call for the package and include the inclusions we want to choose by putting them in the packageBookings
array.
It might not look it buch each object under packageBookings
is actually a full booking object, and will include all the fields you would otherwise include when making a booking (including for capabilities like custom questions, extras, hotel pickup, etc.). The only difference is the fields productId
optionId
and unitItems
which would normally be required are ignored, that's because the package booking knows the product and option from the packageIncludeId
value and the unitItems
are ALWAYS fixed to be the same as the unitItems
of the parent booking.
That means by buying 2 adults and 1 child of the parent, you will be automatically including 2 adults and 1 child of each of the package bookings also.
Package Booking
PATCH
https://api.ventrata.com/octo/bookings/:uuid
Path Parameters
It's also possible to pick the included products after the booking has already been reserved or confirmed. This can be done just by including the packageBookings
array with the includes you have chosen.
Unlike the unitItems
array this will only add to the list of package bookings, so you can call it it multiple times and it'll add package bookings each time without deleting the list already in there. To remove existing package bookings you have to DELETE them.
The response on both endpoints is the same, and will return the package booking object. This package booking contains all the included bookings that you have booked or which were required and booked automatically for you when the sale was made. For example:
You can then fetch the references/barcodes on the individual packageBookings
and give these as separate vouchers to the guests.
To update/cancel one of the package bookings you can perform a PATCH / DELETE request on the package booking using its uuid
value just as you would any normal booking.
Last updated