Impact Migration of the route POST /v1/proposals/{proposal_id}/alternative_transports

  • Obsolète
  • 8 janvier 2025
  • 1 route liée

Context

Upgrade from POST - /v1/proposals/{proposal_id}/alternative_transports to ** POST** - /v2/proposals/{proposal_id}/alternative_transports

Key benefits :

  • GOs can exclude one or more flight companies
  • GOs can exclude one or more connection cities
  • GOs can allow or not cabin mixability
  • GOs can chose a min/max connection duration
  • GOs can allow airport change between 2 travel sections

As a BE B2B dev I want to use the POST alternative transport in an advanced mode In order to provide more options/flexibility to GOs


Impacts

Route to call :

  • POST - /v2/proposals/{proposal_id}/alternative_transports

BODY WAS:

[
  {
    "departure": {
      "location_id": "PAR",
      "date": "20210606"
    },
    "arrival": {
      "location_id": "NYC"
    },
    "transport_class": "PLANE_ECONOMY",
    "max_connections": 0
  },
  {
    "departure": {
      "location_id": "NYC",
      "date": "20210620"
    },
    "arrival": {
      "location_id": "PAR"
    },
    "transport_class": "PLANE_ECONOMY",
    "max_connections": 0
  }
]

BODY BECAME:

{
  "journeys": [
    {
      "way": "INBOUND",
      "travel_sections": [
        {
          "departure": {
            "city": {
              "id": "PAR",
              "label": "PARIS"
            },
            "date": "20160812",
            "time": "17:00:00",
            "location": {
              "id": "CDG",
              "label": "PARIS-ROISSY CDG",
              "terminal_code": "2A"
            }
          },
          "arrival": {
            "city": {
              "id": "PAR",
              "label": "PARIS"
            },
            "date": "20160812",
            "time": "17:00:00",
            "location": {
              "id": "CDG",
              "label": "PARIS-ROISSY CDG",
              "terminal_code": "2A"
            }
          }
        }
      ],
      "transport_class": "PLANE_ECONOMY"
    }
  ],
  "is_direct_flight_only": true,
  "max_connections": 2,
  "transport_connection_duration": {
    "min": 60,
    "max": 120
  },
  "is_transport_stations_changes_allowed": {
    "on_connection": true,
    "along_roundtrip": false
  },
  "is_cabin_mixing_allowed": false,
  "is_companies_mixing_allowed": true,
  "imposed_companies": [
    "AF"
  ],
  "imposed_connection_cities": [
    "PAR"
  ],
  "excluded_companies": [
    "RA"
  ],
  "excluded_connection_cities": [
    "HAM"
  ]
}

Body Model

Champ APITypeDescriptionExemple
journeys.wayStringIndicates the way of the journey (outbound / inbound)OUTBOUND
journeys.transport_classENUMAllows to choose a specific flight/train class [ PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND ]PLANE_ECONOMY
journeys.travel_sections.departure.city.idStringIndicates the travel section's departure city IdPAR
journeys.travel_sections.departure.dateStringIndicates the travel section's departure date20230812
journeys.travel_sections.arrival.city.idStringIndicates the travel section's arrival city IdPUJ
max_connectionsStringIndicates the proposal's max connections number2
excluded_companiesStringIndicates the list of excluded companiesRA
excluded_connection_citiesStringIndicates the list of excluded connection citiesHAM
imposed_companiesStringIndicates the list of imposed companiesAF
imposed_connection_citiesStringIndicates the list of imposed connection citiesPAR
is_transport_class_mixing_allowedBooleanIndicates if transport class mixing is allowed or not between flightsfalse
is_companies_mixing_allowedBooleanIndicates if flight companies mixing is allowed or notfalse
transport_connection_duration.minStringIndicates the proposal's transport connection minimum duration (in minutes)60
transport_connection_duration.maxStringIndicates the proposal's transport connection maximum duration (in minutes)120
is_transport_stations_changes_allowed.on_connectionBooleanIndicates if the airport change between connections is allowed or not. For exemple, if allowed, an attendee might have a connection in Paris Orly, and go to CDG to take his next flight.true
is_transport_stations_changes_allowed.along_roundtripBooleanIndicates if the airport change between inbound and outbound is allowed or not. For exemple, if allowed, an attendee can leave from Paris Orly and come back at Paris CDG.true

OUTPUT BECAME:

[
  {
    "id": "2:ac27a:64845",
    "price": {
      "amount": 1734,
+      "currency": "EUR"
    },
    "total_differential_price": {
      "amount": 154,
      "currency": "EUR",
      "is_best_differential_price": true
    },
    "journeys": [
      {
        "way": "INBOUND",
        "total_duration_in_min": 520,
        "travel_sections": [
          {
            "technical_stops": 0,
            "connection_duration_in_min": null,
            "stopover_duration_in_min": null,
            "duration_in_min": null,
            "clubmed_transport": false,
 +           "cancellation_policy_type": "THEO",
            "departure": {
              "date": "20240615",
              "time": "11:30:00",
              "city": {
                "id": "PAR",
                "label": "PARIS"
              },
              "location": {
                "id": "ORY",
                "label": "PARIS-ORLY",
                "terminal_code": "3"
              }
            },
            "arrival": {
              "date": "20240615",
              "time": "14:10:00",
              "city": {
                "id": "FDF",
                "label": "FORT DE FRANCE"
              },
              "location": {
                "id": "FDF",
                "label": "FORT DE FRANCE",
                "terminal_code": ""
              }
            },
            "transport": {
              "type": "PLANE",
              "class": "PLANE_ECONOMY",
              "travel_number": "842",
              "vehicle_type": "BOEING 777-200/300",
              "company": {
                "operator": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                },
                "exploiter": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                }
              },
              "baggage": {
                "weight": "",
                "quantity": "1"
              },
              "fare_class": "U"
            },
            "flight_code": "THEO2E"
          }
        ]
      },
      {
        "way": "OUTBOUND",
        "total_duration_in_min": 495,
        "travel_sections": [
          {
            "technical_stops": 0,
            "connection_duration_in_min": null,
            "stopover_duration_in_min": null,
            "duration_in_min": null,
            "clubmed_transport": false,
            "cancellation_policy_type": "THEO",
            "departure": {
              "date": "20240629",
              "time": "16:40:00",
              "city": {
                "id": "FDF",
                "label": "FORT DE FRANCE"
              },
              "location": {
                "id": "FDF",
                "label": "FORT DE FRANCE",
                "terminal_code": ""
              }
            },
            "arrival": {
              "date": "20240630",
              "time": "06:55:00",
              "city": {
                "id": "PAR",
                "label": "PARIS"
              },
              "location": {
                "id": "ORY",
                "label": "PARIS-ORLY",
                "terminal_code": "3"
              }
            },
            "transport": {
              "type": "PLANE",
              "class": "PLANE_ECONOMY",
              "travel_number": "841",
              "vehicle_type": "BOEING 777-200/300",
              "company": {
                "operator": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                },
                "exploiter": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                }
              },
              "baggage": {
                "weight": "",
                "quantity": "1"
              },
              "fare_class": "U"
            },
            "flight_code": "THEO2E"
          }
        ]
      }
    ]
  }
]