For the surcharge you use the surcharge value that is returned from the calendar endpoint.
{
"status":200,
"message":null,
"result":{
"prices":[
{
"year":"2020",
"months":[
{
"month":"June",
"days":[
{
"day":1,
"limited_spots":false,
"check_in":"2020-06-01",
"check_out":"2020-06-06",
"accommodation":{
"amounts":{
"price":482310
}
},
"accommodation_and_flights":null,
"flights":null,
"surcharge":0
},
{
"day":2,
"limited_spots":false,
"check_in":"2020-06-02",
"check_out":"2020-06-07",
"accommodation":{
"amounts":{
"price":482310
}
},
"accommodation_and_flights":null,
"flights":null,
"surcharge":100
}
]
}
]
}
]
}
}
So if you were booking the 1st of June
the surcharge would be 0
. If you were booking the 2nd of June
the surcharge would be 79875
.
If you get the above failure you will need to use a new order id as the order for the previous ID has already been created and abandoned.
--> retry
{
"id": "307e481e-690e-427e-9922-8bbb24c155a4",
"currency_code": "CNY",
"region_code": "CN",
"utm_source": "zoomzoomzoomtour",
"brand": "yidu",
"accommodation_items": [{
"item_id": "6bded51b-a4e6-431d-90f7-a7f6b4dd54a2",
"check_in": "2020-05-21",
"booking_first_name": "Seungyeob",
"booking_last_name": "Song",
"booking_email": "[email protected]",
"booking_phone_prefix": "82",
"booking_phone": "4444444",
"guest_special_requests": "",
"guest_first_name": "Seungyeob",
"guest_last_name": "Song",
"guest_email": "[email protected]",
"guest_phone": "4444444",
"number_of_adults": 1,
"number_of_children": 0,
"number_of_infants": 0,
"offer_id": "0060I00000Y42b9QAB",
"offer_type": "hotel",
"package_id": "a0s0I000005n1HyQAI",
"price": 3321,
"surcharge": 864
}],
"customer": {
"last_name": "Song",
"first_name": "Seungyeob",
"email": "[email protected]",
"phone_prefix": "82",
"phone": "4444444",
"id": "10871b22-c4af-49d3-942c-68681151f3c5"
}
}
In the above case you would need a new uuid for the order->id and accommodation_item->item_id
Hmm is that for every order?
We're seeing items in our response.
Creating order with id: c05f098a-fad7-41c2-a2c6-2fbd4903d61c
{ accommodation_items:
[ { id: '3a7931c0-9e43-11ea-897a-0bfd75de3533',
item_id: '3ed76fb7-1b43-4839-b2aa-f7d3e0b43120',
state: 'pending',
transaction_key: '08516227-765f-4c6d-8254-5e8b28f678f9',
check_in: '2020-05-27',
check_out: '2020-06-01',
first_name: 'Zoomzoom E2E',
last_name: 'customer',
guest_first_name: 'string',
guest_last_name: 'string',
guest_special_requests: 'Special requests are pending translation, will be updated shortly',
surcharge_paid_direct_to_vendor: false,
number_of_adults: 2,
number_of_children: 0,
number_of_infants: 0 } ],
tour_items: [] }
Could you please give me an example request?
4th question - which field to look at for deal start and end date; root/run_date & end_date? or list_visibility_schedules/AU?
Okay so with schedules there are three differen't types.
- list_visibility_schedule is used to show this offer on the homepage
- online_purchase defines if the offer is for sale online
The list_visibility_schedule
will always fall in the range of the online_purchase_schedule
. You should use online_purchase
schedule to know if it's available or sold out.