duffelhq / duffel-api-javascript

JavaScript client library for the Duffel API
https://duffel.com/docs
MIT License
36 stars 12 forks source link

Missing seat designator from OrderSegment passenger #944

Open Tom-Carpendale opened 1 month ago

Tom-Carpendale commented 1 month ago

The Duffel docs describe how you can access a passengers seat designator from the passengers on the segments, however I am finding that even when the service is present in the create order response and has the relevant Ids for the segment and passenger, the seat field on the passenger is null.

{
  ...
  "slices": [
    {
      ...
      "segments": [
        {
          ...
          "passengers": [
            {
              ...
              "cabin_class_marketing_name": "Standard",
              "passenger_id": "pas_0000Akv58riqaQ5Mk7Og9y",
              "seat": null,
              "cabin_class": "economy"
            }
          ],
          ...
          "id": "seg_0000Akv5DvV60AjF8R8XaN"
        }
      ],
     ...
      "id": "sli_0000Akv5DvVnxXIPAdT6hS"
    }
  ],
  "passengers": [
    {
      ...
      "id": "pas_0000Akv58riqaQ5Mk7Og9y"
    }
  ],
  ...
  "services": [
    {
      "segment_ids": [
        "seg_0000Akv5DvV60AjF8R8XaN"
      ],
      "passenger_ids": [
        "pas_0000Akv58riqaQ5Mk7Og9y"
      ],
      ...
      "metadata": {
        "disclosures": [],
        "designator": "1C",
        "name": "Extra legroom"
      },
      "type": "seat",
      "id": "ser_0000Akv5DvVnxXIPAdT6hN"
    }
  ],
  ...
  "id": "ord_0000Akv5DvV60AjF8R8XaM"
}
Full json response ``` { "documents": [], "synced_at": "2024-08-13T09:16:31Z", "available_actions": [ "update" ], "cancellation": null, "airline_initiated_changes": [], "tax_currency": "GBP", "base_currency": "GBP", "base_amount": "69.48", "tax_amount": "7.00", "total_currency": "GBP", "offer_id": "off_0000Akv58tysBo5pkOuVQB", "booking_reference": "K8M8XR2", "created_at": "2024-08-13T09:16:31.106223Z", "payment_status": { "paid_at": "2024-08-13T09:16:31Z", "price_guarantee_expires_at": null, "payment_required_by": null, "awaiting_payment": false }, "live_mode": false, "total_amount": "76.48", "slices": [ { "changeable": false, "destination_type": "airport", "origin_type": "airport", "fare_brand_name": "Standard", "segments": [ { "origin_terminal": null, "destination_terminal": null, "aircraft": null, "departing_at": "2024-08-13T16:10:00", "arriving_at": "2024-08-13T17:25:00", "operating_carrier": { "logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/U2.svg", "logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/U2.svg", "conditions_of_carriage_url": "https://www.easyjet.com/en/terms-and-conditions", "iata_code": "U2", "name": "easyJet", "id": "arl_00009VME7DC2bj9quHXKop" }, "marketing_carrier": { "logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/U2.svg", "logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/U2.svg", "conditions_of_carriage_url": "https://www.easyjet.com/en/terms-and-conditions", "iata_code": "U2", "name": "easyJet", "id": "arl_00009VME7DC2bj9quHXKop" }, "departure_terminal": null, "arrival_terminal": null, "operating_carrier_flight_number": "320", "marketing_carrier_flight_number": "320", "arrival_datetime": "2024-08-13T17:25:00", "departure_datetime": "2024-08-13T16:10:00", "distance": null, "passengers": [ { "baggages": [ { "quantity": 0, "type": "carry_on" }, { "quantity": 0, "type": "checked" } ], "cabin_class_marketing_name": "Standard", "passenger_id": "pas_0000Akv58riqaQ5Mk7Og9y", "seat": null, "cabin_class": "economy" } ], "duration": "PT1H15M", "destination": { "icao_code": "EGPH", "iata_country_code": "GB", "city_name": "Edinburgh", "iata_city_code": "EDI", "iata_code": "EDI", "latitude": 55.950392, "longitude": -3.366976, "city": null, "time_zone": "Europe/London", "type": "airport", "name": "Edinburgh Airport", "id": "arp_edi_gb" }, "origin": { "icao_code": "EGGD", "iata_country_code": "GB", "city_name": "Bristol", "iata_city_code": "BRS", "iata_code": "BRS", "latitude": 51.383166, "longitude": -2.716318, "city": null, "time_zone": "Europe/London", "type": "airport", "name": "Bristol Airport", "id": "arp_brs_gb" }, "id": "seg_0000Akv5DvV60AjF8R8XaN" } ], "conditions": { "change_before_departure": null }, "duration": "PT1H15M", "destination": { "icao_code": "EGPH", "iata_country_code": "GB", "city_name": "Edinburgh", "iata_city_code": "EDI", "iata_code": "EDI", "latitude": 55.950392, "longitude": -3.366976, "city": null, "time_zone": "Europe/London", "type": "airport", "name": "Edinburgh Airport", "id": "arp_edi_gb" }, "origin": { "icao_code": "EGGD", "iata_country_code": "GB", "city_name": "Bristol", "iata_city_code": "BRS", "iata_code": "BRS", "latitude": 51.383166, "longitude": -2.716318, "city": null, "time_zone": "Europe/London", "type": "airport", "name": "Bristol Airport", "id": "arp_brs_gb" }, "id": "sli_0000Akv5DvVnxXIPAdT6hS" } ], "passengers": [ { "born_on": "1990-02-01", "loyalty_programme_accounts": [], "infant_passenger_id": null, "family_name": "SMITH", "given_name": "JOHN", "gender": "m", "phone_number": "+441234567890", "user_id": null, "email": "john.smith@email.com", "title": "mr", "type": "adult", "id": "pas_0000Akv58riqaQ5Mk7Og9y" } ], "conditions": { "refund_before_departure": { "penalty_currency": null, "penalty_amount": null, "allowed": false }, "change_before_departure": { "penalty_currency": "GBP", "penalty_amount": "42.00", "allowed": true } }, "cancelled_at": null, "changes": [], "content": "managed", "services": [ { "segment_ids": [ "seg_0000Akv5DvV60AjF8R8XaN" ], "passenger_ids": [ "pas_0000Akv58riqaQ5Mk7Og9y" ], "total_currency": "GBP", "quantity": 1, "total_amount": "27.49", "metadata": { "disclosures": [], "designator": "1C", "name": "Extra legroom" }, "type": "seat", "id": "ser_0000Akv5DvVnxXIPAdT6hN" } ], "users": [], "metadata": {}, "type": "instant", "owner": { "logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/U2.svg", "logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/U2.svg", "conditions_of_carriage_url": "https://www.easyjet.com/en/terms-and-conditions", "iata_code": "U2", "name": "easyJet", "id": "arl_00009VME7DC2bj9quHXKop" }, "id": "ord_0000Akv5DvV60AjF8R8XaM" } ```

Thanks!