1. OrderPricing
PKFARE Flight Buyer API
  • Guides
    • Quick Start
    • Tricks for Playing with PKFARE API
    • Book air tickets with ancillaries
    • Raise refund requests
    • Raise change requests
    • Receive flight rescheduled notification
    • Add Paid Bags after the Booking
    • Branded Fare Integration Guide
  • API Reference
    • Air ticket booking APIs
      • TicketIssuanceNotify_V2
      • Shopping V10
      • PrecisePricing V12
      • Penalty V4
      • PreciseBooking V8
      • CancelOrder
      • OrderPricing V6
      • Ticketing
      • OrderDetail V14
      • RequestTicketing
      • ModifyOrderStatus
    • Ancillary booking APIs
      • AncillaryStatusPush
      • AncillaryPricing V6
      • AncillaryBooking
      • CancelAncillaryOrder
      • AncillaryTicketing
      • AncillaryOrderDetail
    • Flight schedule change APIs
      • ScheduleChangeNotify
      • GetScheduleChangeReply
      • GetScheduleChangeList
      • AcknowledgeScheduleChange
      • AcceptScheduleChange
    • Refund APIs
      • RefundResultNotify
      • ReimbursedResultNotify
      • Refund Pricing
      • CheckRefundPricing
      • RefundRequest
      • CheckRefund
      • CheckReimbursed
      • DownloadAttachmentFile API
      • UploadAttachmentFile API
    • Change APIs
      • ChangeResultPush
      • Change Reshop
      • Change Request
      • Change Passenger Info
      • Change Reprice
      • ChangeRepricePush
    • Void APIs
      • ReimbursedResultPush
      • VoidRequest
    • Cache APIs
      • CacheShopping
      • ValidateItinerary API
    • APIs with all versions
      • CheckInInfoPush
      • Raise change requests Copy
      • Shopping
        • Shopping
        • Shopping_V2
        • Shopping_V4
        • Shopping V7
        • Shopping V9
        • Shopping V8
      • PrecisePricing
        • PrecisePricing
        • PrecisePricing_V2
        • PrecisePricing_V6
        • PrecisePricing V9
        • PrecisePricing V10
        • PrecisePricing V11
      • Penalty
        • Penalty
        • Penalty V2
        • Penalty V3
      • PreciseBooking
        • PreciseBooking
        • PreciseBooking_V2
        • PreciseBooking_V5
        • PreciseBooking V6
        • PreciseBooking V7
      • OrderPricing
        • OrderPricing_V2
        • OrderPricing V4
          POST
        • OrderPricing V5
          POST
      • Ticketing
        • Ticketing
      • TicketNumPush
        • TicketingNumPush
        • TicketingNumPush_V2
        • TicketingNumPush_V3
        • TicketIssuanceNotify
      • CancelOrder
        • CancelOrder
      • OrderDetail
        • OrderDetail_V2
        • OrderDetail_V3
        • OrderDetail_V4
        • OrderDetail_V5
        • Json_OrderDetail_V7
        • Json_OrderDetail_V8
        • OrderDetail V9
        • OrderDetail V13
      • AncillaryPricing
        • AncillaryPricing
        • AncillaryPricing V5
      • AncillaryBooking
        • AncillaryBooking
      • CancelAncillaryOrder
        • CancelAncillaryOrder
      • AncillaryTicketing
        • AncillaryTicketing_V2
      • AncillaryStatusPush
        • AncillaryStatusPush
      • AncillaryOrderDetail
        • AncillaryOrderDetail
      • RequestTicketing
        • RequestTicketing
      • ScheduleChangeNotify
        • ScheduleChangeNotify
      • GetScheduleChangeList
        • GetScheduleChangeList
      • AcknowledgeScheduleChange
        • AcknowledgeScheduleChange
      • AcceptScheduleChange
        • AcceptScheduleChange
      • GetScheduleChangeReply
        • GetScheduleChangeReply
      • RefundPricing
        • RefundPricing
      • CheckRefundPricing
        • CheckRefundPricing
      • RefundRequest
        • RefundRequest
      • RefundResultNotify
        • RefundResultNotify
      • CheckRefund
        • CheckRefund
      • ReimbursedResultNotify
        • ReimbursedResultNotify
      • CheckReimbursed
        • CheckReimbursed
      • UploadAttachmentFile
        • UploadAttachmentFile
      • DownloadAttachmentFile
        • DownloadAttachmentFile
      • ChangeReshop
        • ChangeReshop
      • ChangeRequest
        • ChangeRequest
      • ChangePassengerInfo
        • ChangePassengerInfo
      • VoidRequest
        • VoidRequest
        • VoidRequest_V2
      • ReimbursedResultPush
        • ReimburseResultPush_V2
  • Development Instructions
    • Signature
    • Order Status Explanation
    • Booking errors explanation and suggestions
    • Price Breakdown Explanation
    • Airlines available from PKFARE
    • PKFARE Operation Notice
    • How to retrieve airlines'PNR and ticket numbers
    • PKFARE Buyer API solutionId Usage Guide
  • Notice
    • Release Note
  • Schemas
    • Schemas
      • ShoppingReq
      • Result«ShoppingResult»
      • Authentication
      • SearchDTO
      • JourneysDTO_1
      • PassengersDTO
      • ShoppingResult
      • SegmentsDTO
      • SolutionsDTO
      • BaggageDTO
      • ConditionsDTO
      • ChangeDTO
      • OtherDTO
      • RefundDTO
      • JourneysDTO
      • SegmentInfoDTO
  1. OrderPricing

OrderPricing_V2

1 Document Description#

1.1 Function Description#

Through OrderPricing_v2 API, users can check if the PNR and order price are available before doing the payment to ensure the validity of order price and PNR. It is mandatory to invoke OrderPricing before Ticketing. If there is no OrderPricing record before Ticketing, system would call OrderPricing service automatically.
Ticketing need to be done within 30 minutes after OrderPricing.
Note: The difference from the OrderPricing interface is the ability to check the ancillary price.

1.2 Target Reader#

The OrderPricing_V2 API document targets people who work in the fields of network development, maintenance as well as management, and they should have the knowledge of at least one of following programming languages: ASP, PHP, JAVA, ASP.NET or SQL.

1.3 Character Encoding#

The character code of this API is UTF-8.

1.4 Invoking Address#

Address in test environment: https://api.pkfare.com/orderPricingV2
Address in production environment: https://pending.com/orderPricingV2

2 Request Parameter#

2.1 Parameter Construction#

2.1.1 Authentication#
NameTypeRequired or NotDescriptionSample
partnerIdStringYespartner ID-
signstringYessignature, refer to 4.1 and 4.2-
2.1.2 OrderPricing#
NameTypeRequired or NotDescriptionSample
orderNumLongYesorder Number1012694529

2.2 Request Sample#

2.2.1 JSON Format Sample#
Case 1 JSON format sample as below:
{
    "authentication": {
        "partnerId": "sVSX7PfZm1yF04adBWYsCD7M4:",
        "sign": "e707b5d9dae8459065dbb139e5f1bd"
    },
    "orderPricing": {
        "orderNum": 1012694529
    }
}
2.2.2 Base64 Encryption#
Use Base64 to encode results from 2.2.1 Case 1:
eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiJSa3NWU1g3UGZabTF5RjA0YWRCV1lzQ0Q3TTQ9Iiwic2lnbiI6IjE3ZTcwN2I1ZDlkYWNDU5MDY1ZGJiMTM5ZTVmMWJkIn0sIm9yZGVyUHJpY2luZyI6eyJpbmRpY2F0b3JCSUMiOjAsImlzUmVCb29rIjowLCJvcmRlck51bSI6MTAxMjY5NDUyOX19
2.2.3 Encryption Request Sample#
This sample is for reference only:
http://api.pkfare.com/orderPricing?param:eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiJSa3NWU1g3UGZabTF5RjA0YWRCV1lzQ0Q3TTQ9Iiwic2lnbiI6IjE3ZTcwN2I1ZDlkYWU4NDU5MDY1ZGJiMTM5ZTVmMWJkIn0sIm9yZGVyUHJpY2luZyI6eyJpbmRpY2F0b3JCSUMiOjAsImlzUmVCb29rIjowLCJvcmRlck51bSI6MTAxMjY5NDUyOX19

3 Response Parameter#

3.1 Response Parameter Construction#

The data returned is in JSON format. For specific fields, please refer to following charts.
3.1.1 Basic Parameter#
NameTypeDescriptionSample
errorCodeStringerror code0
errorMsgStringerror messageOK
dataObjectreturned data will not be null only if the errorCode returns "0". Data is in JSON format, which contains two collections: pricingResult (3.1.2), orderResult (3.1.6)-
3.1.2 PricingResult#
NameTypeDescriptionSample
solutionObjectrefer to 3.1.3-
flightsArrayrefer to 3.1.4-
segmentsArrayrefer to 3.1.5-
ancillaryObjectrefer to 3.1.7-
3.1.3 Solution#
NameTypeDescriptionSample
currencyStringcurrencyUSD
buyerExchRateBigDecimalbuyer exchange rate, not supported yet0
adtFareBigDecimalfare for adult139
adtTaxBigDecimaltaxes for adult166
chdFareBigDecimalfare for child[age 2-12]100
chdTaxBigDecimaltaxes for child[age 2-12]100
fareTypeStringfare type, refer to 5.2PUBLIC
qChargeBigDecimalQ Charge, for reference only0
tktFeeBigDecimalticketing Fee0
platformServiceFeeBigDecimalplatform Service Fee, for reference only0
journeysString[]Journeys. JSON format string array. Content: flight ID. The flight ID in journey is the specific one chose by users. Refer to 3.1.4-
merchantFeeBigDecimalpayment transaction fee7.39
3.1.4 Flights#
NameTypeDescriptionSample
flightIdStringflight ID, unique identification9ef88fd9dae30560c683911f534c6c49
journeyTimeLongjourney Time, unit: minute350
transferCountIntegernumber of Transfer1
lastTktTimeStringlatest ticketing time (GMT)2015-10-28 23:59:00
segmengtIdsString[]number of segment arrays (please note the segmengtIds is a typo due to history edition)-
3.1.5 Segments#
NameTypeParameter DescriptionSample
segmentIdStringsegment ID, unique identification4ee200cb7feab403d6babbf797ac92aa
airlineStringairline codeCA
flightNumStringflight number6509
equipmentStringequipment737
cabinClassStringcabin class, refer to 5.3 Cabin ClassEconomy
bookingCodeStringcabin codeE
availabilityCountIntegeravailable seats, for reference only7
departureStringdeparture airportPEK
arrivalStringarrival airportHKG
departureTerminalStringdeparture airport terminal3
arrivalTerminalStringarrival airport terminal1
departureDateLongdeparture date [unix time]1446009600000
arrivalDateLongarrival date [unix time]1446017400000
flightTimeIntegerflight time, unit: minute130
stayTimeIntegerstay time, valid with 'stopover' , unit: minute60
codeShareStringcode share or not: [Y-yes, N-no]Y
opFltNoStringflight number of operated carrier202
opFltAirlineStringoperated carrierKA
stopoverStringstopover airportPEK
strDepartureDateStringdeparture date[yyyy-mm-dd], local time2016-08-27
strDepartureTimeStringdeparture time[hh:mm], local time09:30
strArrivalDateStringarrival date[yyyy-mm-dd], local time2016-08-27
strArrivalTimeStringarrival time[hh:mm], local time11:50
3.1.6 OrderResult#
NameTypeDescriptionSample
orderNumLongorder number1012694529
pnrStringpnrEADADW
3.1.7 Ancillary#
NameTypeDescriptionSample
lastNameStringlast nameWANG
firstNameStringfirst nameJANGO
psgTypeStringpassenger type; ADT-Adult, CHD-Child[2-12 years old]ADT
ancillariesObjectancillary data-
3.1.8 Ancillaries#
NameTypeDescriptionSample
baggageObjectbaggage details-
3.1.9 Baggage#
NameTypeDescriptionSample
ancillaryTypeIntegerbaggage details; 1-baggage1
payBaggageTypeIntegerbaggage type; 1-checked baggage, 2-carry-on baggage1
baggagePieceIntegerbaggage piece; -1 - no limit to baggage piece1
baggageWeightStringbaggage weight20KG
baggageCurrencyStringcurrencyCNY
baggagePricebigDecimalprice198.00
descriptionStringbaggage description-
journeysObjectitinerary information-
buyerOrderStringbuyer ancillary order number-
3.1.10 Journey#
NameTypeDescriptionSample
airlineStringairline codeFD
departureStringorigin[IATA airport code]DMK
departureDateStringdeparture date[yyyy-MM-dd]2022-10-01
departureTimeStringdeparture time[hh:mm]09:55
arrivalStringdestination[IATA airport code]CNX
arrivalDateStringarrival date[yyyy-MM-dd]2022-10-01
arrivalTimeStringarrival time[hh:mm]11:25
flightNumStringflight number513
bookingCodeStringcabin codeN

3.2 Response Sample#

3.2.1 Normal Response#
{
    "data": {
        "orderResult": {
            "orderNum": 1014766841,
            "pnr": "SQFTQJ"
        },
        "pricingResult": {
            "flights": [
                {
                    "flightId": "1068c6e4c8051cfd4e9ea8072e3189e2",
                    "journeyTime": 450,
                    "segmengtIds": [
                        "b8ea011c2f09f69cfe9311ceef3e3a5b",
                        "43ee963d98ef57314e55677c10b86ca0"
                    ],
                    "transferCount": 1
                }
            ],
            "segments": [
                {
                    "airline": "MU",
                    "arrival": "PVG",
                    "arrivalDate": 1499383200000,
                    "arrivalTerminal": "1",
                    "availabilityCount": 1,
                    "bookingCode": "R",
                    "cabinClass": "ECONOMY",
                    "codeShare": "Y",
                    "departure": "KUL",
                    "departureDate": 1499364600000,
                    "departureTerminal": "M",
                    "equipment": "738",
                    "flightNum": "9862",
                    "flightTime": 310,
                    "opFltAirline": "FM",
                    "opFltNo": "862",
                    "segmentId": "b8ea011c2f09f69cfe9311ceef3e3a5b",
                    "strArrivalDate": "2017-07-07",
                    "strArrivalTime": "07:20",
                    "strDepartureDate": "2017-07-07",
                    "strDepartureTime": "02:10"
                },
                {
                    "airline": "MU",
                    "arrival": "HKG",
                    "arrivalDate": 1499399400000,
                    "arrivalTerminal": "1",
                    "availabilityCount": 1,
                    "bookingCode": "B",
                    "cabinClass": "ECONOMY",
                    "codeShare": "N",
                    "departure": "PVG",
                    "departureDate": 1499391000000,
                    "departureTerminal": "1",
                    "equipment": "320",
                    "flightNum": "501",
                    "flightTime": 140,
                    "opFltAirline": "",
                    "segmentId": "43ee963d98ef57314e55677c10b86ca0",
                    "strArrivalDate": "2017-07-07",
                    "strArrivalTime": "11:50",
                    "strDepartureDate": "2017-07-07",
                    "strDepartureTime": "09:30"
                }
            ],
            "solution": {
                "adtFare": 1330,
                "adtTax": 753.00,
                "buyerExchRate": 0,
                "chdFare": 0,
                "chdTax": 0,
                "currency": "CNY",
                "fareType": "PUBLIC",
                "journeys": {
                    "journey_0": [
                        "1068c6e4c8051cfd4e9ea8072e3189e2"
                    ]
                },
                "merchantFee": 2.08,
                "platformServiceFee": 0,
                "qCharge": 0,
                "tktFee": 0.00
            }
            "ancillary": [
                {
                    "lastName": "NING",
                    "firstName": "YAO",
                    "psgType": "ADT",
                    "ancillaries": {
                        "baggage": [
                            {
                                "journeys": [
                                    {
                                        "airline": "MU",
                                        "arrival": "PVG",
                                        "arrivalDate": "2017-07-07",
                                        "arrivalTime": "07:20",
                                        "bookingCode": "R",
                                        "departure": "KUL",
                                        "departureDate": "2017-07-07",
                                        "departureTime": "02:10",
                                        "flightNum": "9862"
                                    },
                                    {
                                        "airline": "MU",
                                        "arrival": "HKG",
                                        "arrivalDate": "2017-07-07",
                                        "arrivalTime": "11:50",
                                        "bookingCode": "B",
                                        "departure": "PVG",
                                        "departureDate": "2017-07-07",
                                        "departureTime": "09:30",
                                        "flightNum": "501"
                                    }
                                ],
                                "ancillaryType": 1,
                                "baggageCurrency": "CNY",
                                "baggagePiece": 1,
                                "baggagePrice": 663,
                                "baggageWeight": "50KG",
                                "description": "extra 1 piece baggage",
                                "payBaggageType": 1,
                            }
                        ]
                    },
                }
            ],
        }
    },
    "errorCode": "0",
    "errorMsg": "ok"
}
3.2.2 Error Response#
{
    "errorCode": "B010",
    "errorMsg": "Order number not exist",
    "data": null
}

4 Signature#

4.1 Parameters for Signature#

partnerId, partnerKey

4.2 Signature#

Combine partnerId and partnerKey to make an MD5 encryption on final value.
Sign = MD5 (partnerId + partnerKey).
e.g.
partnerId: abcdefg123456
partnerKey: jkHKhkikdhy258dffj
Sign = MD5(abcdefg123456jkHKhkikdhy258dffj) = d7e99ae9d5c3c7d7113aced071e3ca08

5 Appendix#

5.1 Error Code List#

errorCodeerrorMsgDescription
0okRequest has been processed successfully.
P001-Wrong parameter
S001System errorSystem error
310Retrieve PNR failed, please try again.Retrieve PNR failed
B002Partner is not existsPartnerID does not exist
B003Illegal signIllegal sign. Please check your signature
B009Order status is invalidOrder status is invalid
B010The order was not foundThe order was not found.
B026Latest_tkt_time will be expired within 1 hour.Latest ticketing time will be expired within 1 hour.
B101supplier status is invalidSupplier is offline.
B102Segment status is invalid.Segment status is invalid.
B103No airline PNR existed, please try again.No airline PNR exist.
B104Flight No. in PNR is not match with the one in the orderFlight No. in PNR is not match with the one in the order .
B105Passenger No. in PNR is not match with the one in the orderPassenger No. in PNR is not match with the one in the order.
B106No pricePNR has no filed fare.
B107Fare changed, and update order failed. Please try again.Fare changed, and update order failed.
B108Supplier has cross the day, fare is not guaranteed.Supplier had crossed the day, fare is not guaranteed.
B109Supplier has cross the day, and price has changedSupplier had crossed the day, and price has changed.
B112The order has been paid before, please update status accordingly.The order had been paid before.
B113Filed fare in PNR is not match with the price in the order, and price has changed.Filed fare in PNR is not match with the price in the order, and price had changed.
B114Flight changedFlight changed
B115Latest_tkt_time has expired.Latest ticketing time is expired.
B116Price changedPrice had changed
B117Order Pricing failedCaused by other reasons, please connect administrator
B118PNR status is invalidPNR status is invalid
B119Order Pricing failed, please try againLCC content: Pre-check before payment failed. Please try again
B120Order Pricing failedSupplier saved booking failed.

5.2 Fare Type#

EnumDescription
PUBLICpublic fare
PRIVATEprivate fare

5.3 Cabin Class#

EnumDescription
ECONOMYeconomy class
PREMIUM ECONOMYpremium economy class
BUSINESSbusiness class
FIRSTfirst class
Top
Modified at 2024-05-06 01:22:44
Previous
PreciseBooking V7
Next
OrderPricing V4