KingTravel Shopping API
  1. Ticket Booking API
KingTravel Shopping API
ShoppingAPI
  • ShoppingAPI
  • Ticket Booking Process
    • Booking Process
  • Ticket Booking API
    • Search
      POST
    • Verify
      POST
    • Booking
      POST
    • Cancel
      POST
    • Pay
      POST
    • Query
      POST
  • Ticket Booking Notification
    • Notify
      POST
  • Error Codes
    • Search
    • Verify
    • Booking
  • Attachment
    • About Booking AES Encryption
  1. Ticket Booking API

Booking

POST
/ndc/v1/book
After completing the price verification, enter the booking stage, select the flight and provide the passenger and contact information for ticket booking. Once the booking is successful, the final booking price will be returned.
Note: The Booking requires AES encryption of the requestBody for both input and output parameters. Click to view details

Request

Authorization
API Key
Add parameter in header
appKey
Example:
appKey: ********************
API Key
Add parameter in header
appSecret
Example:
appSecret: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200成功
application/json
success
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:9002/api/ndc/v1/book' \
--header 'appKey: <api-key>' \
--header 'appSecret: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "platFormOrderId": "AF19987663562124",
    "tripType": 1,
    "sessionId": "656ed53a-9f5c-b691-f5f8-00e04256f40d",
    "routing": {
        "data": "04:aadd233dsfad3dsfdsafesafetkgkfdlgfojgiojgslfdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsssssssssssssssssssssssssssssssssssssssssssdddddddddddddddddddddddfffffffffffffffffffffffffff",
        "fromSegments": [
            {
                "marketingCarrier": "CA",
                "depAirport": "PVG",
                "depTime": "201203100300",
                "arrAirport": "NRT",
                "arrTime": "201203101305",
                "seatGrade": "Y",
                "seatClass": "J",
                "flightNumber": "CA123",
                "codeShare": false,
                "aircraftCode": "string",
                "operatingCarrier": "string",
                "operatingFlightNo": "string",
                "segmentNo": 1,
                "stopCities": "string"
            }
        ],
        "retSegments": [
            {
                "marketingCarrier": "CA",
                "depAirport": "PVG",
                "depTime": "201203100300",
                "arrAirport": "NRT",
                "arrTime": "201203101305",
                "seatGrade": "Y",
                "seatClass": "J",
                "flightNumber": "CA123",
                "codeShare": false,
                "aircraftCode": "string",
                "operatingCarrier": "string",
                "operatingFlightNo": "string",
                "segmentNo": 1,
                "stopCities": "string"
            }
        ]
    },
    "passengers": [
        {
            "name": "XU/JIPENG",
            "ageType": 0,
            "birthday": "20001120",
            "gender": "M",
            "cardNum": "E34255664",
            "cardType": "PP",
            "cardIssuePlace": "CN",
            "cardExpired": "20501120",
            "nationality": "CN",
            "ffpNo": {
                "cardNo": "string",
                "carrier": "string"
            }
        }
    ],
    "contact": {
        "name": "Mr. WANG",
        "address": "string",
        "postcode": "string",
        "email": "marry@google.com",
        "mobile": "string",
        "useGuestContact": false
    },
    "passengerBaggages": [
        {
            "passengerName": "XU/JIPENG",
            "payBaggages": [
                {
                    "productCode": "CHECKINBAGGAGE20KG",
                    "flightNumber": "CA123",
                    "depAirport": "PVG",
                    "arrAirport": "NRT",
                    "depTime": "201203100300",
                    "seatClass": "J",
                    "baggagePrices": [
                        {
                            "pkgNumber": 0,
                            "weight": 0,
                            "bookSalePrice": 0,
                            "ticketSalePrice": 0,
                            "airportSalePrice": 0,
                            "refundFee": 0
                        }
                    ]
                }
            ]
        }
    ]
}'
Response Response Example
{
    "status": 0,
    "msg": "success",
    "cerrorCode": "string",
    "cerrorMsg": "string",
    "sessionId": "string",
    "platFormOrderId": "AF19987663562124",
    "recordNo": "AEDFAC",
    "maxSeats": 9,
    "orderContact": {
        "name": "Mr. WANG",
        "address": "string",
        "postcode": "string",
        "email": "marry@google.com",
        "mobile": "string",
        "useGuestContact": false
    },
    "routing": {
        "data": "string",
        "fromSegments": [
            {
                "marketingCarrier": "CA",
                "depAirport": "PVG",
                "depTime": "201203100300",
                "arrAirport": "NRT",
                "arrTime": "201203101305",
                "seatGrade": "Y",
                "seatClass": "J",
                "flightNumber": "CA123",
                "codeShare": false,
                "aircraftCode": "string",
                "operatingCarrier": "string",
                "operatingFlightNo": "string",
                "segmentNo": 1,
                "stopCities": "string"
            }
        ],
        "retSegments": [
            {
                "marketingCarrier": "CA",
                "depAirport": "PVG",
                "depTime": "201203100300",
                "arrAirport": "NRT",
                "arrTime": "201203101305",
                "seatGrade": "Y",
                "seatClass": "J",
                "flightNumber": "CA123",
                "codeShare": false,
                "aircraftCode": "string",
                "operatingCarrier": "string",
                "operatingFlightNo": "string",
                "segmentNo": 1,
                "stopCities": "string"
            }
        ],
        "priceList": [
            {
                "passengerType": 0,
                "publishPrice": 0,
                "price": 0,
                "taxFeeAmount": 0,
                "ruleId": 0
            }
        ],
        "eligibility": "string",
        "validatingCarrier": "string",
        "productType": "string",
        "fareBasis": "string",
        "isUseOtaRule": true,
        "tariffNo": "string",
        "minAge": 0,
        "maxAge": 0,
        "nationality": "string",
        "planCategory": 0,
        "invoiceType": "string",
        "minPassengerCount": 0,
        "maxPassengerCount": 0,
        "formatBaggageDetailList": [
            {
                "segmentNo": 0,
                "flightSeq": 0,
                "passengerType": 0,
                "baggageType": 0,
                "baggagePiece": 0,
                "baggageWeight": 0
            }
        ],
        "refundInfoList": [
            {
                "passengerType": 0,
                "refundType": 0,
                "refundStatus": "string",
                "refundFee": 0,
                "refNoshow": "string",
                "refNoShowCondition": 0,
                "refNoshowFee": 0,
                "conditionList": [
                    {
                        "status": "string",
                        "endMinute": 0,
                        "amount": 0
                    }
                ]
            }
        ],
        "changesInfoList": [
            {
                "passengerType": 0,
                "changesType": 0,
                "changesStatus": "string",
                "changesFee": 0,
                "revNoshow": "string",
                "revNoShowCondition": 0,
                "revNoshowFee": 0,
                "conditionList": [
                    {
                        "status": "string",
                        "endMinute": 0,
                        "amount": 0
                    }
                ]
            }
        ],
        "currency": "string",
        "endorsement": 0,
        "extraInfo": {
            "property1": "string",
            "property2": "string"
        },
        "nationalityType": 0,
        "auxiliaryElements": [
            {
                "productCode": "CHECKINBAGGAGE20KG",
                "auxSegment": {
                    "flightNumber": "string",
                    "depAirport": "string",
                    "depTime": "string",
                    "arrAirport": "string"
                },
                "productType": 0,
                "bookSalePrice": 0,
                "ticketSalePrice": 0,
                "currency": "string",
                "maxLimit": 0,
                "minLimit": 0,
                "auxBaggageElement": {
                    "piece": "string",
                    "weight": "string",
                    "isAllWeight": true
                }
            }
        ]
    },
    "passengerBaggages": [
        {
            "passengerName": "XU/JIPENG",
            "payBaggages": [
                {
                    "productCode": "CHECKINBAGGAGE20KG",
                    "flightNumber": "CA123",
                    "depAirport": "PVG",
                    "arrAirport": "NRT",
                    "depTime": "201203100300",
                    "seatClass": "J",
                    "baggagePrices": [
                        {
                            "pkgNumber": 0,
                            "weight": 0,
                            "bookSalePrice": 0,
                            "ticketSalePrice": 0,
                            "airportSalePrice": 0,
                            "refundFee": 0
                        }
                    ]
                }
            ]
        }
    ]
}
Modified at 2025-12-03 04:24:53
Previous
Verify
Next
Cancel
Built with