Impact migration of the route GET /v2​/customers​/{customer_id}​/bookings​/{booking_id}

  • Obsolète
  • 10 août 2023
  • 1 route liée

Context

Upgrade from GET - /v2​/customers​/{customer_id}​/bookings​/{booking_id} to ** GET** - /v3/customers​/{customer_id}​/bookings​/{booking_id}

Key benefits : Retrieve the expiration date time of the bookings ℹ️ expiration_date_time is inside an object "option_durability" that contains "expiration_date_time" & "is_reliable"

⭐ Ajout du Champ is_renewed_option


As a CustomerAccount dev I want to retrieve the expiration date and time of a booking in option + if it has been renewed or not In order to show it on the front end


Impacts

Route to call :

  • GET - /v3​/customers​/{customer_id}​/bookings​/{booking_id}

OUTPUT WAS:

{
  "id": "12345",
  "creation_date": "20160415",
  "departure_date": "20160415",
  "return_date": "20160415",
  "multiple_sale_contracts": true,
  "expiration_date_time": "20160415T10:23:00.234Z",
  "booking_status": "VALIDATED",
  "payment_status": "PAID",
  "allowed_to_pay": true,
  "locale": "fr-FR",
  "vendor": {
    "sold_by": "CLUBMED",
    "name": "CLUB MEDITERRANEE INTERNET SCA",
    "contact": "0850 644 364",
    "type": "WEB"
  },
  "stays": [
    {
      "id": "AGAC20160415",
      "product_id": "AGAC",
      "label": "Agadir",
      "product_type": "VILLAGE",
      "resort_arrival_date": "20160415",
      "resort_leaving_date": "20160422",
      "duration": 7,
      "attendees": [
        {
          "adults_count": 4,
          "children_count": 4,
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ],
          "start_date": "20160415",
          "end_date": "20160422",
          "attendee_ids": [
            "A"
          ]
        }
      ],
      "total_adults_count": 4,
      "total_children_count": 4,
      "outward_trip": {
        "departure_city": "Paris",
        "arrival_city": "Paris",
        "transportation": [
          "TRAIN"
        ]
      },
      "api_upsell_available": true,
      "accommodations": [
        {
          "start_date": "20170517",
          "end_date": "20170520",
          "quantity": 1,
          "baby_bed": true,
          "shared_room": true,
          "occupation": 2,
          "accommodation_id": "C2",
          "rooms": [
            {
              "number": "1421",
              "building": "Grand Yabuli",
              "orientation": "Sud",
              "floor": "24",
              "status": "NOT_READY"
            }
          ],
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ]
        }
      ],
      "packages": [
        {
          "id": "AI4",
          "label": "All Inclusive",
          "attendee_ids": [
            "A"
          ],
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ]
        }
      ],
      "_links": [
        {
          "method": "GET",
          "href": "https://api.clubmed.com/v1/products/AGAC",
          "rel": "product_detail"
        }
      ]
    }
  ],
  "events": [
    {
      "code": "PO",
      "label": "PAYMENT OPTION",
      "date": "2020-10-04T00:00:00.000Z"
    }
  ],
  "_links": [
    {
      "method": "GET",
      "href": "https://api.clubmed.com/v1/products/AGAC",
      "rel": "product_detail"
    }
  ]
}

OUTPUT BECAME:

{
  "id": "12345",
  "creation_date": "20160415",
  "departure_date": "20160415",
  "return_date": "20160415",
  "multiple_sale_contracts": true,
+    "option_durability": {
+      "expiration_date_time": "20230101T01:00:00Z",
+      "is_reliable": "true"
+    },
  "booking_status": "VALIDATED",
+ "is_renewed_option": true,
  "payment_status": "PAID",
  "allowed_to_pay": true,
  "locale": "fr-FR",
  "vendor": {
    "sold_by": "CLUBMED",
    "name": "CLUB MEDITERRANEE INTERNET SCA",
    "contact": "0850 644 364",
    "type": "WEB"
  },
  "stays": [
    {
      "id": "AGAC20160415",
      "product_id": "AGAC",
      "label": "Agadir",
      "product_type": "VILLAGE",
      "resort_arrival_date": "20160415",
      "resort_leaving_date": "20160422",
      "duration": 7,
      "attendees": [
        {
          "adults_count": 4,
          "children_count": 4,
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ],
          "start_date": "20160415",
          "end_date": "20160422",
          "attendee_ids": [
            "A"
          ]
        }
      ],
      "total_adults_count": 4,
      "total_children_count": 4,
      "outward_trip": {
        "departure_city": "Paris",
        "arrival_city": "Paris",
        "transportation": [
          "TRAIN"
        ]
      },
      "api_upsell_available": true,
      "accommodations": [
        {
          "start_date": "20170517",
          "end_date": "20170520",
          "quantity": 1,
          "baby_bed": true,
          "shared_room": true,
          "occupation": 2,
          "accommodation_id": "C2",
          "rooms": [
            {
              "number": "1421",
              "building": "Grand Yabuli",
              "orientation": "Sud",
              "floor": "24",
              "status": "NOT_READY"
            }
          ],
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ]
        }
      ],
      "packages": [
        {
          "id": "AI4",
          "label": "All Inclusive",
          "attendee_ids": [
            "A"
          ],
          "_links": [
            {
              "method": "GET",
              "href": "https://api.clubmed.com/v1/products/AGAC",
              "rel": "product_detail"
            }
          ]
        }
      ],
      "_links": [
        {
          "method": "GET",
          "href": "https://api.clubmed.com/v1/products/AGAC",
          "rel": "product_detail"
        }
      ]
    }
  ],
  "events": [
    {
      "code": "PO",
      "label": "PAYMENT OPTION",
      "date": "2020-10-04T00:00:00.000Z"
    }
  ],
  "_links": [
    {
      "method": "GET",
      "href": "https://api.clubmed.com/v1/products/AGAC",
      "rel": "product_detail"
    }
  ]
}

Model

Champ APIDéfinitionExampleType
option_durability.expiration_date_timeBooking expiration date and time20230101T01:00
Date Timestamp format TZ
option_durability.is_reliableIndicates if the expiration date is reliable or not. The expiration date of a booking in option with transportation included will automatically be less reliable than one without transportationTrueBolean
is_renewed_optionIndicates if an option has been renewed or nottrue / falseBoolean