Impact migration of the route POST /v2/bookings
- Outdated
- October 11, 2023
- 1 related route
Context
Upgrade from POST - /v2/bookings to POST - /v3/bookings
⭐ Key benefits : Behind the scene, this endpoint acts like calling the POST /v3/proposals/search and the PUT /v1/proposals/{proposal_id}/attendees before creating the booking. To create a booking, the proposal must contain attendees information. The booking can be created with different statuses impacting the booking life cycle.
Migration
Route to call :
- POST -
/v3/bookings⚠️ In order to migrate from POST v2/bookings to POST v3/bookings, you only need to change the route version (v3). The V3 has been developed in a way that it can be use exactly as the V2.
INPUT WAS:
{
"proposal_id": "123456",
"opportunity_id": "456789123",
"sending_option_information": true,
"booking_status": "OPTION",
"seller_email": "pierre.dupont@partner.com",
"salesman_id": "45535786",
"sales_network_id": "OPERA_00_P2T",
"comment": "blablabla blablabla"
}
INPUT BECAME:
{
"resort_arrival_date": "20230711",
"duration": 7,
"product_id": "MPAC",
"package_id": "PAI",
"voucher_code": "CDDEZS",
"sales_network_id": "OPERA_00_P2T",
"transfer_code": "AGAVSY",
"departure_option_id": "PAR",
"accommodation_id": "A4+",
"households": [
{
"household_id": "A",
"address": {
"number": "15",
"street": "AVENUE DES CHAMPS ELYSEES",
"add_on": "6A",
"town": "Luynes",
"city": "Aix-en-Provence",
"zip_code": "75000",
"state_or_district": "CA",
"country": "FRANCE",
"country_code": "FR",
"additional_information_1": "Chez M. Dupont",
"additional_information_2": "Entreprise Clubmed"
},
"attendees": [
{
"id": "A",
"customer_id": "123456789",
"first_name": "Marc",
"unicode_first_name": "北",
"last_name": "Dupont",
"unicode_last_name": "王",
"email": "bei.wang@123.com",
"civility_code": "MR",
"health_pass_id": "1234567892",
"identity": {
"number": "E001241",
"type": "TAX_NUMBER"
},
"birthdate": "2022-04-15T10:23:00.234Z",
"travel_documents": [
{
"document_number": "09PR5121F",
"type": "PASSPORT",
"expiration_date": "20281015",
"issuing_date": "20181015",
"nationality": "FR",
"issuing_country": "FR",
"birth_country": "FR",
"authority": "Prefecture de Torcy"
}
],
"phones": [
{
"number": "0623456789",
"type": "MOBILE"
}
],
"optins": [
{
"channel": "EMAIL",
"optin": true,
"optin_partners": true
}
]
}
],
"language_code": "FR"
}
],
"opportunity_id": "456789123",
"sending_option_information": true,
"booking_status": "OPTION",
"seller_email": "pierre.dupont@partner.com",
"salesman_id": "45535786",
"comment": "blablabla blablabla",
"proposal_id": "123456",
"price": {
"requested_price": 12345
}
}
OUTPUT WAS:
{
"booking_id": "654321",
"attendees": [
{
"customer_id": 987654,
"type": "MAIN"
}
]
}
OUTPUT BECAME:
{
"booking_id": "654321",
"households": [
{
"attendees": [
{
"customer_id": 987654,
"type": "MAIN"
}
]
}
],
"option_durability": {
"is_reliable": true,
"expiration_date_time": "20160415T10:23:00.234Z"
}
}