3. Prices#
During the Prices step, all of the ticketing options for a set availability with a set combination of options get retrieved, the amount of tickets to book get selected, with corresponding pricing and it’s possible to compute the global price.
This operation is implemented through two endpoints.
getPrices#
Retrieves all of the ticketing options (eg: adult, child…) for an availability, with their rules (ex: adults from 12 to 99 years) and limitations (eg: max number of participants).
Path
GET /booking-flow/v1/products/:productId/availabilities/:availabilityId/prices
Input body example
None
Output body example
{
"id": "01d0597b-a819-478b-b32d-f99290b70e88",
"availabilityDate": "2023-12-19",
"availabilityOptions": [
{
"label": "Ticket Type",
"level": "0",
"id": "24deeda6-bcda-4c04-9659-e2ca2b2beedc",
"selectedOptionId": "528446",
"optionChoices": {
"528446": "Eiffel ,2 Day Bus Pass &Cruise"
}
},
{
"label": "Start Time",
"level": "1",
"id": "01d28c41-0b26-4d3a-a0ec-229125e07c63",
"selectedOptionId": "420013_20231219",
"optionChoices": {
"420013_20231219": "12:00"
}
}
],
"unitOptions": [
{
"label": "Adult",
"id": "143731",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 114.9,
"currency": "EUR"
},
"unitQuantity": 0,
"minAge": 13,
"maxAge": 99
},
{
"label": "Child",
"id": "112820",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 99.9,
"currency": "EUR"
},
"unitQuantity": 0,
"minAge": 4,
"maxAge": 12
},
{
"label": "Infant",
"id": "112821",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 0.0,
"currency": "EUR"
},
"unitQuantity": 0,
"minAge": 0,
"maxAge": 3
}
],
"maxParticipants": 10,
"minParticipants": 1,
"isOptionStepCompleted": true,
"isPricingStepCompleted": false
}
setPrices#
Increases or decreases the number of desired tickets for one priceOption in the availability, returning the updated limitations and computed total price.
Path
PUT /booking-flow/v1/products/:productId/availabilities/:availabilityId/prices
Input body example
[
{ "unitid": "143731", "value" : 2 },
{ "unitId": "112820", "value" : 1 }
]
Output body example
{
"id": "01d0597b-a819-478b-b32d-f99290b70e88",
"availabilityDate": "2023-12-19",
"availabilityOptions": [
{
"label": "Ticket Type",
"level": "0",
"id": "24deeda6-bcda-4c04-9659-e2ca2b2beedc",
"selectedOptionId": "528446",
"optionChoices": {
"528446": "Eiffel ,2 Day Bus Pass &Cruise"
}
},
{
"label": "Start Time",
"level": "1",
"id": "01d28c41-0b26-4d3a-a0ec-229125e07c63",
"selectedOptionId": "420013_20231219",
"optionChoices": {
"420013_20231219": "12:00"
}
}
],
"unitOptions": [
{
"label": "Adult",
"id": "143731",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 114.9,
"currency": "EUR"
},
"unitQuantity": 2,
"minAge": 13,
"maxAge": 99
},
{
"label": "Child",
"id": "112820",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 99.9,
"currency": "EUR"
},
"unitQuantity": 1,
"minAge": 4,
"maxAge": 12
},
{
"label": "Infant",
"id": "112821",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 0.0,
"currency": "EUR"
},
"unitQuantity": 0,
"minAge": 0,
"maxAge": 3
}
],
"maxParticipants": 10,
"minParticipants": 1,
"isOptionStepCompleted": true,
"isPricingStepCompleted": true
}
Note
While the the ticketing options are presented all at once, the setPrices endpoint enforces rules such as child-to-adult ticket ratios or minimum participant counts. It’s important to update each value sequentially, as changes may affect the rules applied to other options.
While different products might have similar pricing options, keep in mind that every supplier might have a different definition of what identifies an Adult, Child, Infant or Senior. These definitions are reperesented in the minAge and maxAge properties for each unitOption. Also remember to check the accompaniedBy property for restrictions and indications. It typically reflects the fact that for some activities children must be accompanied by an adult.
Final price computation
In a unitPrice, the unitPriceType property defines how the total price for the activity should be computed and if additional limitations have to be observed. These financial elements should be retrieved from the response of the last call to setPrices.
These are the possible alternatives.
PER_GROUP or GROUP: with this value, the price of the unitPrice represents the cost for an entire group, and minQuantity and maxQuantity properties define the group restrictions that need to be met for the booking to be finalizable. Every booking will only represent a single group.
PER_PERSON: with this value, the total price of the booking is calculated by multiplying the individual unitPrice price per amount of participants, for all unitPrices. Even so, some products could however require a minimum number of participants to be booked, and this is reflected in the minQuantity property.
Note
Special case: For some rare products, the price for each participant may vary depending on the number participants, in a non linear way. It is typically the case for activities where you have a fix cost part (for example for a vehicle) and a variable part (for example a meal) . For such products, you can have a complex cost structure like 150€ for 1 participants, 180€ for 2 participants, 200€ for 3 participants… The accurate value is computed in the response of the last SetPricing call.
When the quantity of tickets set per pricingOption amounts to a bookable state, the setOptions response will return the isPricingStepComplete flag set to true. It’s possible to keep updating the unitQuantity until desired, but this is the condition to move on to the next step.