Upgrade GET/v2/customers/{customer_id}/bookings/{booking_id}/transport_details to GET/v3/customers/{customer_id}/bookings/{booking_id}/transport_details

  • Outdated
  • June 25, 2024
  • 1 related route

Context

A while ago, we worked on enhancing two API resources that allow China to display ticket numbers, reservation numbers, and PNR to its customers. However, this information was only available in the case of Webtheo. The goal now is to ensure that these details are displayed for all types of transportation and to bring them down to the "travel_section" level rather than the direction (round trip).

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

Key benefits : Having pnr_number / reservation_number / ticket_number fields at the travel_section level


As a CC dev I want to be able to retrieve the pnr_number In order to let my customers have access to it


Impacts

Route to call :

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

Output was:

[
  {
    "way": "INBOUND",
    "stay_id": "BALC20170310",
    "pre_post_trip": true,
    "_links": [
      {
        "rel": "self",
        "method": "GET",
        "href": "https://api.clubmed.com/products"
      }
    ],
    "reservation_number": "ZTG2MO",
    "pnr_number": "UP7XZH",
    "attendees": [
      {
        "id": "A",
        "ticket_number": "147-5250548512"
      }
    ],
    "travel_sections": [
      {
        "departure": {
          "city": {
            "id": "PAR",
            "label": "PARIS"
          },
          "date": "20160812",
          "time": "13:34:00.000",
          "location": {
            "id": "CDG",
            "label": "PARIS-ROISSY CDG",
            "terminal_code": "2A"
          }
        },
        "arrival": {
          "city": {
            "id": "PAR",
            "label": "PARIS"
          },
          "date": "20160812",
          "time": "13:34:00.000",
          "location": {
            "id": "CDG",
            "label": "PARIS-ROISSY CDG",
            "terminal_code": "2A"
          }
        },
        "technical_stops": 0,
        "connection_duration_in_min": 130,
        "stopover_duration_in_min": 130,
        "transport": {
          "type": "PLANE",
          "company": {
            "operator": {
              "id": "SQ",
              "label": "SINGAPORE AIRLINES",
              "logo": "http://www.airfrance.fr/logo"
            },
            "exploiter": {
              "id": "SQ",
              "label": "SINGAPORE AIRLINES",
              "logo": "http://www.airfrance.fr/logo"
            }
          },
          "travel_number": "SQ1234",
          "baggage": {
            "quantity": "2",
            "weight": "23kg"
          },
          "vehicle_type": "BOEING 747",
          "class": "PLANE_ECONOMY",
          "reference": "SQ1234",
          "fare_class": "U"
        }
      }
    ]
  }
]

Output became:

[
  {
    "way": "INBOUND",
    "stay_id": "SEYC20240322",
    "pre_post_trip": true,
-     "reservation_number": null,
-      "pnr_number": null,
-       "attendees": [
-          {
-            "id": "A",
-            "status": "VALIDATED",
-            "ticket_number": null
-          }
-        ],
    "travel_sections": [
      {
+        "attendees": [
+          {
+            "id": "A",
+            "status": "VALIDATED",
+            "ticket_number": null,
+            "reservation_number": null,
+            "pnr": null
+          }
+        ],
        "departure": {
          "city": {
            "id": "ELS",
            "label": "EAST LONDON"
          },
          "location": {
            "id": "ELS",
            "label": "EAST LONDON",
            "terminal_code": ""
          },
          "date": "20240322",
          "time": "09:25:00.000"
        },
        "arrival": {
          "city": {
            "id": "JNB",
            "label": "JOHANNESBOURG"
          },
          "location": {
            "id": "JNB",
            "label": "JOHANNESBURG-JAN SMUTS",
            "terminal_code": ""
          },
          "date": "20240322",
          "time": "10:55:00.000"
        },
        "transport": {
          "type": "PLANE",
          "class": "PLANE_ECONOMY",
          "company": {
            "operator": {
              "id": "FA",
              "label": "SAFAIR",
              "logo": ""
            },
            "exploiter": {
              "id": "FA",
              "label": "SAFAIR",
              "logo": ""
            }
          },
          "reference": "0389",
!          "baggage": {
!            "quantity": "1",
!            "weight": null
          }
        },
        "technical_stops": 0,
        "connection_duration_in_min": "",
        "stopover_duration_in_min": ""
      },
  {
    "way": "OUTBOUND",
    "stay_id": "SEYC20240322",
    "pre_post_trip": true,
-     "reservation_number": null,
-      "pnr_number": null,
-       "attendees": [
-          {
-            "id": "A",
-            "status": "VALIDATED",
-            "ticket_number": null
-          }
-        ],
    "travel_sections": [
+      {
+        "attendees": [
+          {
+            "id": "A",
+            "status": "VALIDATED",
+            "ticket_number": null,
+            "reservation_number": null,
+            "pnr": null
+          }
+        ],
        "departure": {
          "city": {
            "id": "SEZ",
            "label": "SEYCHELLES"
          },
          "location": {
            "id": "SEZ",
            "label": "SEYCHELLES",
            "terminal_code": ""
          },
          "date": "20240329",
          "time": "09:25:00.000"
        },
        "arrival": {
          "city": {
            "id": "JNB",
            "label": "JOHANNESBOURG"
          },
          "location": {
            "id": "JNB",
            "label": "JOHANNESBURG-JAN SMUTS",
            "terminal_code": ""
          },
          "date": "20240329",
          "time": "12:30:00.000"
        },
        "transport": {
          "type": "PLANE",
          "class": "PLANE_ECONOMY",
          "company": {
            "operator": {
              "id": "HM",
              "label": "AIR SEYCHELLES",
              "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/HM.png"
            },
            "exploiter": {
              "id": "HM",
              "label": "AIR SEYCHELLES",
              "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/HM.png"
            }
          },
          "reference": "0061",
!          "baggage": {
!            "quantity": "1",
!            "weight": null
          }
        },
        "technical_stops": 0,
        "connection_duration_in_min": "",
        "stopover_duration_in_min": ""
      },
  }
]