# 预订中座位与行李

{% hint style="info" %}
遇到 API 接入问题时，可登录 [Eva](https://www.atriptech.com/) 寻求帮助。
{% endhint %}

## Seat Availability

> \*\*Dependency:\*\*\
> Verify or getOffer function should be called in prior to this call.\
> \
> The seat map API is divided into \*\*independent mode\*\* and \*\*non-independent mode\*\*.\
> \- \*\*Independent mode\*\* means it can be used standalone without relying on other APIs.\
> \- \*\*Non-independent mode\*\* depends on the price verification API or the get offer API.\
> \
> \> In a booking process, please call the 'seatAvailability' API to get seat availability information after price verification via 'verify' or 'getOffer'.\
> \> Steps:\
> \> 1. API sequence\
> \>    \* Search - Verify- seatAvailability - Order - Pay\
> \>    \* getOffer - seatAvailability - Order - Pay\
> \> 2. Pass 'offerId' in 'seatAvailability' requests:\
> \>    \* From 'verify': Use sessionId directly.\
> \>    From 'getOffer': Use its offerId.\
> \> 3. In the Order step, use the productCode to add specific seat to the ticket order.\
> \
> \*\*Endpoint:\*\*\
> <https://sandbox.atriptech.com/seatAvailability.do>

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Shopping and Ticketing"}],"security":[],"paths":{"/seatAvailability.do":{"post":{"summary":"Seat Availability","deprecated":false,"description":"**Dependency:**\nVerify or getOffer function should be called in prior to this call.\n\nThe seat map API is divided into **independent mode** and **non-independent mode**.\n- **Independent mode** means it can be used standalone without relying on other APIs.\n- **Non-independent mode** depends on the price verification API or the get offer API.\n\n> In a booking process, please call the 'seatAvailability' API to get seat availability information after price verification via 'verify' or 'getOffer'.\n> Steps:\n> 1. API sequence\n>    * Search - Verify- seatAvailability - Order - Pay\n>    * getOffer - seatAvailability - Order - Pay\n> 2. Pass 'offerId' in 'seatAvailability' requests:\n>    * From 'verify': Use sessionId directly.\n>    From 'getOffer': Use its offerId.\n> 3. In the Order step, use the productCode to add specific seat to the ticket order.\n\n**Endpoint:**\nhttps://sandbox.atriptech.com/seatAvailability.do","tags":["Shopping and Ticketing"],"parameters":[{"name":"Accept","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Accept-Encoding","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-id","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-secret","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","description":"The`sessionId`returned by price verification api(`verify.do`). Only required in **Non-independent mode**."},"offerId":{"type":"string","description":"The`offerID`returned by get offer api(`getOffers.do`). Only required in **Non-independent mode**."},"carrier":{"type":"string","description":"The IATA code of MSC(known as Most Significant Carrier) of the itinerary."},"outboundSegments":{"type":"array","items":{"properties":{"flightNumber":{"type":"string"},"segmentIndex":{"type":"integer"},"depAirport":{"type":"string"},"arrAirport":{"type":"string"},"cabinClass":{"type":"string"},"depTime":{"type":"string"}},"$ref":"#/components/schemas/SeatMapFlight"},"description":"Outbound segments. All segments of the itinerary must be specified. Segments should be arranged in the order of takeoff.","minItems":1},"inboundSegments":{"type":"array","items":{"$ref":"#/components/schemas/SeatMapFlight"},"description":"Inbound segments. All segments of the itinerary must be specified. Segments should be arranged in the order of takeoff.","minItems":1,"nullable":true}},"required":["carrier","outboundSegments","sessionId","offerId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/SeatAvailabilityResponseStatus","description":"- 214: Session ID invalid or expired.\n- 215: Segment index missing.\n- 216: Seat selection failed.\n- 217: Unknown error.\n- 218: The airline don’t support seat selection currently.\n- 219: The route don’t support seat selection currently.\n- 220: illegal request parameter.\n- 221: Fare family is empty and not configured with lowest price fare family.\n- 223: The ratio of seat quotation requests to payment orders has exceeded the allowed threshold."},"msg":{"$ref":"#/components/schemas/ResponseMessage","nullable":true},"cabins":{"type":"array","items":{"type":"object","properties":{"segmentIndex":{"type":"integer","description":"The segment index to which the cabin belongs"},"cabin":{"properties":{"deck":{"type":"string","description":"Main deck or upper deck above that, which is found on some large aircraft.","enum":["Main","Upper deck"],"default":"Main","nullable":true},"cabinClass":{"$ref":"#/components/schemas/CabinClass","description":"Service grade of the fare","nullable":true},"cabinLayout":{"properties":{"columns":{"type":"array","items":{"properties":{"designator":{"type":"string","description":"A letter used to uniquely identify the seat position in the column.\n**Typical values:** A,B,C,D,E,F"},"characteristics":{"type":"string","description":"characteristics of column:\n-`A`: column by the aisle\n-`M`: middle column\n-`W`: column by the window","nullable":true}},"required":["designator"],"type":"object"},"description":"Contains columns and seat information for seat display purposes. Returns the characteristics for each column. Provided in the order from left to right."},"rows":{"properties":{"first":{"type":"integer","description":"First-row number Row starting row position for columns A,B,C,D,E,F"},"last":{"type":"integer","description":"Last row number Row ending row position for columns A,B,C,D,E,F"}},"required":["first","last"],"description":"Contains rows and seat information for seat display purposes Returns the starting end row position for each column","type":"object"},"exitRowPositions":{"type":"array","items":{"type":"object","properties":{"first":{"type":"integer","description":"Exit seat starting row position"},"last":{"type":"integer","description":"Exit seat ending row position"}},"required":["first","last"]},"description":"Return the position of exit rows, if applicable. The row number generally starts from 1 and increases from the front to the tail of the aircraft, that is, the seats close to the cockpit (nose) have the smallest row numbers, and the closer to the tail, the larger the row numbers.","nullable":true}},"required":["columns","rows"],"description":"Used to describe the seat layout of the cabin.","type":"object"},"rows":{"type":"array","items":{"properties":{"number":{"type":"integer","description":"Seat row number","minimum":1},"seats":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string","description":"The column where the seat is located"},"seatStatus":{"type":"string","description":"A flag used to indicate whether a seat is free or occupied.\n- F: Free\n- O: Occupied","enum":["F","O"]},"seatCharacteristics":{"type":"array","items":{"type":"string"},"description":"A list contains seat characteristics, typical values(but not limited to):\n-`A`: Aisle seat\n-`E`: Exit and emergency exit\n-`I`: Seat suitable for adult with an infant\n-`IE`: Seat not suitable for child\n-`L`: Leg space seat\n-`U`: Seat suitable for unaccompanied minors\n-`V`: Seat to be left vacant or offered last\n-`W`: Window seat\n\nFor more information, please refer to: [EDIFACT Standards for Seat Characteristics (9825)](https://support.travelport.com/webhelp/GWS/Content/XML_Select_Web_Service/Codes/edifact_standards_for_seating.htm).","nullable":true},"price":{"type":"number","description":"The total price of the seat, including taxes"},"currency":{"type":"string","description":"Currency of the price."},"vendorPrice":{"type":"number","description":"The total price in vendor's currency of the seat, including taxes","nullable":true},"vendorCurrency":{"type":"string","description":"Vendor's currency","nullable":true},"productCode":{"type":"string","description":"A code used to uniquely identify this seat, which needs to be used when submitting a seat selection request."},"displayCurrency":{"type":"number","description":"Display currency","nullable":true},"displayPrice":{"type":"number","description":"The total price in display currency of the seat, including taxes","nullable":true}},"required":["column","seatStatus","price","currency","productCode"]},"description":"A list of seats that make up this row"}},"required":["number","seats"],"type":"object"},"description":"A list of rows in this cabin. A cabin row has one or more seats."}},"required":["cabinLayout","rows"],"description":"An object used to describe the seat layout within a cabin.","type":"object"}},"required":["segmentIndex","cabin"]},"description":"An array containing all cabins and the seat layouts within them.","nullable":true}},"required":["status"]}}},"headers":{}}}}}},"components":{"schemas":{"SeatMapFlight":{"type":"object","properties":{"segmentIndex":{"type":"integer","description":"This is the segment number, which starts from 1 and increments in the order of takeoff of each segment.","minimum":1},"flightNumber":{"type":"string","description":"Marketing flight number(with airline code prefix)."},"depAirport":{"type":"string","description":"3-letter iata code for the airport at which the segment is scheduled to depart."},"arrAirport":{"type":"string","description":"3-letter iata code for the arrival airport at which the segment is scheduled to arrive."},"depTime":{"type":"string","description":"The datetime at which the segment is scheduled to depart, in the departure airport timezone. The format is`YYYYMMDD`."},"cabinClass":{"$ref":"#/components/schemas/CabinClass","description":"Cabin class.\n- 1: economy\n- 2: business\n- 3: first\n- 4: premium economy"}},"required":["flightNumber","segmentIndex","depAirport","arrAirport","cabinClass","depTime"]},"CabinClass":{"type":"integer","enum":[1,2,3,4],"title":""},"SeatAvailabilityResponseStatus":{"type":"integer","enum":[214,215,216,217,218,219,220,221,223]},"ResponseMessage":{"type":"string","description":"It serves as an additional description of the response result. Especially when the interface reports an error (`status` !=`0`), it is usually a human-readable error message. Note: Do not use this field in any programming scenarios. For example, do not judge whether the interface responds successfully based on this field. Instead, you should only determine it by checking whether the status is equal to`0`at any time."}}}}
```

## Get Luggage

> \> In a booking process, please call the 'getLuggage' API to get precise baggage quotes after price verification via 'verify' or 'getOffer'.\
> \> Steps:\
> \> 1. API sequence\
> \>    \* Search - Verify- getLuggage - Order - Pay\
> \>    \* getOffer - getLuggage - Order - Pay\
> \> 2. For exact baggage prices, request 'getLuggage'.\
> \> 3. Pass 'offerId' in 'getLuggage' requests:\
> \>    \* From 'verify': Use sessionId as offerId\
> \>    \* From 'getOffer': Use its offerId directly.\
> \> 4. 'getLuggage' returns all flight segments' baggage data, each identified by a unique productCode.\
> \> 5. In the Order step, use the productCode to add specific baggage products to the ticket order.\
> \
> \*\*Endpoint:\*\*\
> <https://sandbox.atriptech.com/getLuggage.do>

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Shopping and Ticketing"}],"security":[],"paths":{"/getLuggage.do":{"post":{"summary":"Get Luggage","deprecated":false,"description":"> In a booking process, please call the 'getLuggage' API to get precise baggage quotes after price verification via 'verify' or 'getOffer'.\n> Steps:\n> 1. API sequence\n>    * Search - Verify- getLuggage - Order - Pay\n>    * getOffer - getLuggage - Order - Pay\n> 2. For exact baggage prices, request 'getLuggage'.\n> 3. Pass 'offerId' in 'getLuggage' requests:\n>    * From 'verify': Use sessionId as offerId\n>    * From 'getOffer': Use its offerId directly.\n> 4. 'getLuggage' returns all flight segments' baggage data, each identified by a unique productCode.\n> 5. In the Order step, use the productCode to add specific baggage products to the ticket order.\n\n**Endpoint:**\nhttps://sandbox.atriptech.com/getLuggage.do","tags":["Shopping and Ticketing"],"parameters":[{"name":"x-atlas-client-id","in":"header","description":"api access id","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-secret","in":"header","description":"api access secret","required":true,"schema":{"type":"string"}},{"name":"Accept-Encoding","in":"header","description":"建议设置该请求头，能很大程度地减小网络传输报文的大小","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"offerId":{"type":"string","description":"The`sessionId`returned by verify api(`verify.do`)"},"maxResponseTime":{"type":"integer","description":"Query timeout, unit: milliseconds, default 5000ms.\n<br>\n**Note:** Due to network transmission and computational performance impacts, the client may still receive a normal result (rather than a timeout) even if this duration is exceeded. This time is used to control the overall response time of the interface within a certain range, with an error generally not exceeding a few hundred milliseconds.<br>\nIf you have strict requirements for the timeout, it is recommended to set the timeout of your HTTP toolkit. If the HTTP toolkit you are using does not support this capability, you may need to leverage other tools—related capabilities are generally provided in most programming languages.","default":5000,"nullable":true}},"required":["offerId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"- 212: illegal parameter.\n- 214: offer not exists.\n- 205: timed out.\n- 299: airline error.\n- 9999: system error.","enum":[212,214,205,299,9999]},"msg":{"type":"string","description":"As an additional description of the response result. Especially when the interface reports an error (status ≠ 0), it is usually a human-readable error message.\n<br>\n**Note:** Do not use this field in any programming scenarios, such as judging whether the interface response is successful based on this field. You should always judge solely based on whether the status is equal to 0.","nullable":true},"data":{"type":"object","properties":{"offerId":{"type":"string"},"outboundSegments":{"type":"array","items":{"$ref":"#/components/schemas/RoutingSegment"}},"inboundSegments":{"type":"array","items":{"$ref":"#/components/schemas/RoutingSegment"},"nullable":true},"ancillaryProductElements":{"type":"array","items":{"$ref":"#/components/schemas/AncillaryProduct"}}},"required":["offerId","outboundSegments","ancillaryProductElements"]}},"required":["data","status"]}}},"headers":{}}}}}},"components":{"schemas":{"RoutingSegment":{"type":"object","properties":{"aircraftCode":{"type":"string","description":"IATA Code of aircraft type","nullable":true},"arrAirport":{"type":"string","description":"3-letter iata code for the arrival airport at which the segment is scheduled to arrive."},"arrTerminal":{"type":"string","description":"The terminal at the destination airport where the segment is scheduled to arrive.","nullable":true},"arrTime":{"type":"string","description":"The datetime at which the segment is scheduled to arrive, in the arrival airport timezone. The format is `YYYYMMDD`."},"cabin":{"type":"string","description":"RBD(known as Reservation Booking Designator) displayed by the airline.","nullable":true},"cabinClass":{"$ref":"#/components/schemas/CabinClass","description":"Cabin class of the segment.\n- 1: economy\n- 2: business\n- 3: first\n- 4: premium economy"},"carrier":{"type":"string","description":"IATA code of marketing carrier."},"codeShare":{"type":"boolean","description":"A flag used to identify whether it is a code share flight."},"depAirport":{"type":"string","description":"3-letter iata code for the airport at which the segment is scheduled to depart."},"depTerminal":{"type":"string","description":"The terminal at the departure airport from which the segment is scheduled to depart.","nullable":true},"depTime":{"type":"string","description":"The datetime at which the segment is scheduled to depart, in the departure airport timezone. The format is`YYYYMMSS`."},"duration":{"type":"integer","description":"The duration of the segment in munites."},"fareFamily":{"type":"string","description":"Fare Family as per the information received from the airline"},"flightNumber":{"type":"string","description":"Marketing flight number. The format is: CA123 or TR021 or FR1290, with the first two letters representing the carrier and the following number representing the flight number."},"operatingCarrier":{"type":"string","description":"2-letter iata code for the operating carrier. The airline actually operating this segment. This may differ from the marketing carrier in the case of a \"codeshare\", where one airline sells flights operated by another airline.","nullable":true},"operatingFlightnumber":{"type":"string","description":"Operating flight number.","nullable":true},"seatCount":{"type":"integer","description":"Max booking seats for the fare."},"segmentIndex":{"type":"integer","description":"Segment sequence. Starts from 1. If it is return trip, sequence for outbound trip and inbound trip would be together. The segment index also represents the flight sequence of the segment."},"stopCities":{"type":"string","description":"IATA code/Name of cities from where the passengers will take stopover flights. Include IATA code of cities and use a comma in case of multiple cities to separate transfer airports count is higher than 1. For example: `CGK, SUB`. \n`null` or blank means non-stop flight.","nullable":true}},"required":["arrAirport","arrTime","cabinClass","carrier","codeShare","depAirport","depTime","duration","fareFamily","flightNumber","seatCount","segmentIndex"]},"CabinClass":{"type":"integer","enum":[1,2,3,4],"title":""},"AncillaryProduct":{"type":"object","properties":{"ancillaryCode":{"type":"string","description":"A code that is relatively readable by humans and contains information about auxiliary business specifications (such as weight and quantity limitations of luggage). \n**Note:** \nThis content is only for display purposes and should not be used for programming purposes. That is to say, do not attempt to parse the information about auxiliary business specifications from this code. If you want to access the auxiliary business specifications, please use structured fields. For example, for luggage, please use`auxBaggageElement`."},"auxBaggageElement":{"type":"object","properties":{"isAllWeight":{"type":"boolean","description":"Mark whether the`weight`field restricts the total weight or the weight of a single piece.\n- `true`: The weight is for all the pieces\n- `false`: The weight is for each piece"},"piece":{"type":"integer","description":"The maximum number of pieces that can be purchased per person.\n- `0`: No Limitation about piece\n- `>0`: Maximum pieces"},"size":{"type":"string","description":"Maximum size for the baggage","nullable":true},"weight":{"type":"integer","description":"The maximum weight that can be purchased per person.\n- `0`: No limitation for weight\n- `>0`: Weight limit (KG)"}},"description":"Baggage specification limitations. This node is valid only when the ancillary type (`categoryCode`) is baggage.","required":["isAllWeight","piece","weight"],"nullable":true},"canPurchasePostTicket":{"type":"integer","description":"A flag used to mark if this ancillary product can be purchased in the post-ticketing flow.\n- `0`: No\n- `1`: Yes"},"canPurchaseWithTicket":{"type":"integer","description":"A flag used to mark if this ancillary product can be purchased during the booking flow.\n- `0`: No\n- `1`: Yes"},"categoryCode":{"description":"Type of the ancillary.\n\n- StandardCheckInBaggage: Standard Check-in Baggage.\n- CabinBaggage: Usually refers to the Cabin Baggage Overhead Locker. Transition value. It will gradually transition to `CabinBaggageOverheadLocker`.\n- CabinBaggageOverheadLocker: Cabin Baggage Overhead Locker.\n- CabinBaggageUnderSeat: Cabin Baggage Under Seat. Usually refers to the personal item.","$ref":"#/components/schemas/AncillaryCategory"},"clientTechnicalServiceFee":{"type":"number","description":"The service fee charged by Atlas for the purchase of the ancillary.","nullable":true},"currency":{"type":"string","description":"The currency in which Atlas settles transactions with you"},"maxQty":{"type":"integer","description":"The maximum number of purchases allowed per person per flight segment"},"minQty":{"type":"integer","description":"The minimum quantity allowed to be purchased per person per flight segment."},"price":{"type":"number","description":"Price for this ancillary."},"productCode":{"type":"string","description":"Unique identifier for the ancillary product. It would be used in the order request."},"segmentIndex":{"type":"integer","description":"The index of segment the ancillary applies to."},"vendorCurrency":{"type":"string","description":"The currency in which the vendor charges for the ancillary. If the fare does not allow for the VCC pass-through or BYOA payment, this information will be`null`."},"vendorPrice":{"type":"integer","description":"The price charged by the vendor for the ancillary. If the fare does not allow for the VCC pass-through or BYOA payment, this information will be`null`."}},"required":["ancillaryCode","canPurchasePostTicket","canPurchaseWithTicket","categoryCode","currency","maxQty","minQty","price","productCode","segmentIndex","vendorCurrency","vendorPrice"]},"AncillaryCategory":{"type":"string","enum":["StandardCheckInBaggage","CabinBaggage","CabinBaggageUnderSeat","CabinBaggageOverheadLocker"]}}}}
```
