1. RefundRequest
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
        • OrderPricing V5
      • 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. RefundRequest

RefundRequest

1 Document Description#

1.1 Function Description#

Through RefundRequest API, you are able to request with the passenger who wuold like to make a refund on which segment. System will create a refund request(which is refund order). If you have got a refund pricing ID, which is still valid, you can request with refund pricing ID. If you don't have refund pricing ID, you can make a refund request directly withou refund pricing ID. System will create refund request accordingly.
Note This API provides Postman examples, which you can obtain by contacting your account manager.

1.2 Target Reader#

The RefundRequest interface documentation is intended for web developers, maintenance and managers with some web development skills, an understanding of one of the major development languages such as Java, Python, ASP.NET, PHP, Node.js, and a basic knowledge of HTTP network protocols.

1.3 Character Encoding#

The character code of this API is UTF-8.

1.4 URLs#

EnvironmentURL
Test environmenthttp://api.pkfare.com/refund-api/refundRequest
Prod environmenthttp://{{apiHost}}/refund-api/refundRequest
Notes The production environment call address is provided after you finish the API development and testing, and before the official launch. You can replace the {{apiHost}} in the production environment call address with the provided domain name.

1.5 Http Method#

POST

1.6 Request Header#

keyvalue
Content-Typeapplication/x-www-form-urlencoded

1.7 Response Header#

keyvalue
Content-Typeapplication/json

2 Request#

2.1 Request Parameter#

KeyParameter DescritpionType
paramThe value of Basic Request which is encoded by Base64. Basic Request is JSON data structure, please refer to details as following text.Text

2.1.1 Basic Request#

Sample
{
    "authentication": {
        "partnerId": "GuLC2tDO2iox9partnerId",
        "sign": "994209932dd37a81csign"
    },
    "data": {
        "refundPricingId": "16783330658156729",
        "allPaxOfOrder": 1,
        "orderNum": "916783298501993901",
        "pnrList": [
            {
                "airPnr": "EDTCZP",
                "arrival": "SIN",
                "bookingCode": "E",
                "cabinClass": "ECONOMY",
                "departure": "HKG",
                "flightNum": "CX635",
                "pnr": "EDTCZP",
                "segmentNo": "1",
                "ticketNums": [
                    {
                        "birthday": "2003-01-09",
                        "cardNum": "P1234567",
                        "cardType": "P",
                        "firstName": "CHUN",
                        "lastName": "XIN",
                        "sex": "M",
                        "ticketNum": "EDTCAA"
                    }
                ]
            }
        ],
        "refundReason": 0,
        "refundType": 0,
        "uploadFilesIds": [
            "7a570c0877099e1faaaa"
        ]
    }
}
NameTypeRequried or NotParameter Description
authenticationObjectYesPartner ID and signature, refer to 2.1.2
dataObjectYesRequest, refer to 2.1.3

2.1.2 Authentication#

NameTypeRequired or NotParameter Description
partnerIdStringYesPartner ID
signStringYesSignature, refer to 4.1 and 4.2

2.1.3 Data#

NameTypeRequired or notParameter Description
allPaxOfOrder
IntegerYesIdentifier for all passengers of the order, 0-No,1-Yes. If request with "1", system will validate whether the request contains all passengers and routings of the order.
refundPricingIdStringNoRefund Pricing ID which is returned in Refund Pricing API or Check Refund Pricing API.
orderNumStringYesPKFARE order number, issued order and change order are supported.
refundTypeStringYesRefund request type:0-Voluntary, 1-Involuntary.
refundReasonStringYesRefund reason:0-Personal Reason, 1-Illness Reason, 2-Schedule Change Reason, 3-Crisis Reason, 4-Visa Refusal
contactPersonStringNoContact person for refund order. The contact information from Origin Order will be used if contactPerson is not in the request.
emailStringNoEmail for refund order. The email from Origin Order will be used if email is not in the request.
telNumStringNoContact telephone number for refund order. The contact information from Origin Order will be used if telNum is not in the request.
uploadedFlieIdsArray(String)NoFile Id, support 99 files per request
pnrListArrayYesPNR and ticket information
canceledReservationBeforeDepartureIntegerNoPNR has been canceled. 0-PNR has not yet been canceled. 1-PNR has been canceled before departure. If the element was not indicated, it will be consider as 0-PNR has not yet been canceled.

2.1.4 pnrList#

NameTypeRequried or NotParameter Description
segmentNoIntegerYesSegment sequence, start from "1"
departureStringYesDeparture airport code
arrivalStringYesArrival airport code
flightNumStringYesFlight number
cabinClassStringYesCabin calss
bookingCodeStringYesBooking code
pnrStringNoPNR
airPnrStringNoAirline PNR
ticketNumsArrayYesPassenger and ticket information

2.1.5 ticketNums#

NameTypeRequired or NotParameter Description
ticketNumStringNoTicket Number
lastNameStringYesLast Name
firstNameStringYesFirst Name
cardTypeStringNoTravel document type
cardNumStringNoTravel document number
sexStringYesGender
birthdayStringYesBirthday, format[yyyy-MM-dd]

2.2 Request Parameter Construction#

2.2.1 Basic Request as JSON data structure#

{
    "authentication": {
        "partnerId": "GuLC2tDO2iox9iusign",
        "sign": "994209932dd37sign"
    },
    "data": {
        "refundPricingId": "16783330658156729",
        "allPaxOfOrder": 1,
        "orderNum": "916783298501993901",
        "pnrList": [
            {
                "airPnr": "EDTCZP",
                "arrival": "SIN",
                "bookingCode": "E",
                "cabinClass": "ECONOMY",
                "departure": "HKG",
                "flightNum": "CX635",
                "pnr": "EDTCZP",
                "segmentNo": "1",
                "ticketNums": [
                    {
                        "birthday": "2003-01-09",
                        "cardNum": "P1234567",
                        "cardType": "P",
                        "firstName": "CHUN",
                        "lastName": "XIN",
                        "sex": "M",
                        "ticketNum": "EDTCAA"
                    }
                ]
            }
        ],
        "refundReason": 0,
        "refundType": 0,
        "uploadFilesIds": [
            "7a570c0877099e1faaaa"
        ]
    }
}

2.2.2 Encoding Basic Request by Base64#

eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiIyY0d1TEMydERPMmlveDlpdTQ1REtZU3I5bVE9Iiwic2lnbiI6ImM0OTk0MjA5OTMyZGQzN2E4MWM5NTFmMDA0YzcwYmU3In0sImRhdGEiOnsicmVmdW5kUHJpY2luZ0lkIjoiMTY3ODMzMzA2NTgxNTY3MjkiLCJhbGxQYXhPZk9yZGVyIjoxLCJvcmRlck51bSI6IjkxNjc4MzI5ODUwMTk5MzkwMSIsInBuckxpc3QiOlt7ImFpclBuciI6IkVEVENaUCIsImFycml2YWwiOiJTSU4iLCJib29raW5nQ29kZSI6IkUiLCJjYWJpbkNsYXNzIjoiRUNPTk9NWSIsImRlcGFydHVyZSI6IkhLRyIsImZsaWdodE51bSI6IkNYNjM1IiwicG5yIjoiRURUQ1pQIiwic2VnbWVudE5vIjoiMSIsInRpY2tldE51bXMiOlt7ImJpcnRoZGF5IjoiMjAwMy0wMS0wOSIsImNhcmROdW0iOiJQMTIzNDU2NyIsImNhcmRUeXBlIjoiUCIsImZpcnN0TmFtZSI6IkNIVU4iLCJsYXN0TmFtZSI6IlhJTiIsInNleCI6Ik0iLCJ0aWNrZXROdW0iOiJFRFRDQUEifV19XSwicmVmdW5kUmVhc29uIjowLCJyZWZ1bmRUeXBlIjowLCJ1cGxvYWRGaWxlc0lkcyI6WyI3YTU3MGMwODc3MDk5ZTFmYWFhYSJdfX0=

2.2.3 Request Sample#

POST http://open.pkfare.com/refund-api/refundRequest
Content-Type: application/x-www-form-urlencoded

param=eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiIyY0d1TEMydERPMmlveDlpdTQ1REtZU3I5bVE9Iiwic2lnbiI6ImM0OTk0MjA5OTMyZGQzN2E4MWM5NTFmMDA0YzcwYmU3In0sImRhdGEiOnsicmVmdW5kUHJpY2luZ0lkIjoiMTY3ODMzMzA2NTgxNTY3MjkiLCJhbGxQYXhPZk9yZGVyIjoxLCJvcmRlck51bSI6IjkxNjc4MzI5ODUwMTk5MzkwMSIsInBuckxpc3QiOlt7ImFpclBuciI6IkVEVENaUCIsImFycml2YWwiOiJTSU4iLCJib29raW5nQ29kZSI6IkUiLCJjYWJpbkNsYXNzIjoiRUNPTk9NWSIsImRlcGFydHVyZSI6IkhLRyIsImZsaWdodE51bSI6IkNYNjM1IiwicG5yIjoiRURUQ1pQIiwic2VnbWVudE5vIjoiMSIsInRpY2tldE51bXMiOlt7ImJpcnRoZGF5IjoiMjAwMy0wMS0wOSIsImNhcmROdW0iOiJQMTIzNDU2NyIsImNhcmRUeXBlIjoiUCIsImZpcnN0TmFtZSI6IkNIVU4iLCJsYXN0TmFtZSI6IlhJTiIsInNleCI6Ik0iLCJ0aWNrZXROdW0iOiJFRFRDQUEifV19XSwicmVmdW5kUmVhc29uIjowLCJyZWZ1bmRUeXBlIjowLCJ1cGxvYWRGaWxlc0lkcyI6WyI3YTU3MGMwODc3MDk5ZTFmYWFhYSJdfX0=

3 Response#

3.1 Response Sample#

{
    "errorCode": "0",
    "errorMsg": "ok",
    "data": {
        "orderNum": "916777559161841202",
        "parentOrderNum": "916777559161841201",
        "refOrderNum": "9167775591618412",
        "createTime": "2023-03-12 17:45:28",
        "passengerPriceList": [
            {
                "segmentList": [
                    {
                        "segmentNo": 1,
                        "departure": "KUL",
                        "arrival": "SIN",
                        "flightNum": "AK703",
                        "cabinClass": "Economy",
                        "bookingCode": "Z",
                        "pnr": "YMERBD",
                        "ticketNum": "1677755872385"
                    }
                ],
                "lastName": "King",
                "firstName": "Vickie",
                "cardType": "PP",
                "cardNum": "G47321571",
                "cardExpiredDate": "2025-05-05",
                "nationality": "CN",
                "psgType": "CHD",
                "sex": "M",
                "birthday": "2015-05-08"
            }
        ],
        "refundType": "0",
        "refundReason": "0",
        "orderStatus": "Refund request",
        "pnr": "YMERBD",
        "platingCarrier": "AK",
        "journeys": [
            {
                "journeyTime": 75,
                "departureDate": "2023-11-20",
                "arrivalDate": "2023-11-20",
                "departureTime": "07:05",
                "arrivalTime": "08:20",
                "segments": [
                    {
                        "airline": "AK",
                        "flightNum": "703",
                        "equipment": "320",
                        "cabinClass": "Economy",
                        "bookingCode": "Z",
                        "departure": "KUL",
                        "arrival": "SIN",
                        "departureDate": "2023-11-20",
                        "arrivalDate": "2023-11-20",
                        "departureTime": "07:05",
                        "arrivalTime": "08:20",
                        "flightTime": 75,
                        "codeShare": "0",
                        "opFltNo": "",
                        "opFltAirline": ""
                    }
                ]
            }
        ]
    }
}

3.2 Response Parameter#

NameTypeRequired or NotParamter Description
errorCodeStringYesError Code, 0-Success,Others-Failed
errorMsgStringNoError reason
warningMsgStringNoWarning Message
dataObjectNoReturn data, will not be empty when error code is "0". Refer to3.2.1

3.2.1 data#

NameTypeRequired or NotParameter Description
orderNumStringYesPKFARE refund order number
parentOrderNumStringNoPKFARE Parent Order number of this refund order, it could be issued order number or change order number
refOrderNumStringYesPKFARE general order number, it may include more orders
createTimeStringYesOrder creation time, format yyyy-MM-dd HH:mm:ss,Beijing time(UTC+0)
passengerPriceListArrayYesPassenger and refund pricing information, refer to 3.2.2
refundTypeIntegerYesRefund type:0-Voluntary, 1-Involuntary
refundReasonIntegerYesRefund reason:0-Personal Reason, 1-Illness Reason, 2-Schedule Change Reason, 3-Crisis Reason, 4-Visa Refusal
orderStatusStringYesOrder status
pnrStringNoPNR of order
airPnrStringNoAirline PNR of order
platingCarrierStringYesPlating carrier
journeysArrayYesJourney information, refer to 3.2.3

3.2.2 passengerPriceList#

NameTypeRequired or notParameter Description
segmentListArrayYesSegment information, refer to 3.2.4
lastNameStringYesLast Name
firstNameStringYesFirst Name
cardTypeStringNoTravel document type
cardNumStringNoTravel document number
cardExpiredDateStringNoTravel document expired date
nationalityStringYesNationality【Country 2 letters code】
psgTypeStringYesPassenger Type
sexStringYesGender
birthdayStringYesBirthday,Format[yyyy-MM-dd]
solutionsArrayNoRefund Pricing information, refer to 3.2.5

3.2.3 journeys#

NameTypeRequried or NotParameter Description
journeyTimeLongYesJourney Time, Unit:minutes
transferCountIntegerNoTransfer count
departureDateStringYesDeparture date, format [yyyy-mm-dd](local time)
arrivalDateStringYesArrival data, format [yyyy-mm-dd](local time)
departureTimeStringYesDeparture time, format[hh:mm](local time)
arrivalTimeStringYesArrival time, format[hh:mm](local time)
segmentsArrayYesSegment information, refer to 3.2.6

3.2.4 segmentList#

NameTypeRequired or NotParameter Description
segmentNoIntegerYesSegment sequency, start from "1"
departureStringYesDeparture airport code
arrivalStringYesArrival airport code
flightNumStringYesFlight number
cabinClassStringYesCabin class
bookingCodeStringYesBooking code
pnrStringNoPNR
airPnrStringNoAirline PNR
ticketNumStringNoTicket number

3.2.5 solutions#

NameTypeRequired or NotParameter Description
currencyStringYesCurrency
paidAmountBigDecimalYesPaid amount
usedAmountBigDecimalYesUsed fare and tax amount
nonRefundableAmountBigDecimalYesnonrefundable amount(Includes airline penalties, non-refundable taxes, and supplier ticketing service fees)
refundServiceFeeBigDecimalYesRefund service fee
refundAmountBigDecimalYesRefund amount
FormOfPaymentStringYesRefund form of payment:Depends on payment method, Airline voucher, Depends on refund result, EMD
voucherNumberStringNoVoucher number, for refund form of payment as Airline voucher or EMD
voucherFileIdStringNoVoucher File ID, for refund form of payment as Airline voucher. You can download this file by DownloadFile API
voucherCurrencyStringNoVoucher currency, for refund form of payment as Airline voucher or EMD
voucherAmountBigDecimalNoVoucher amount, for refund form of payment as Airline voucher or EMD
voucherValidFromStringNoVoucher valid date from, for refund form of payment as Airline voucher or EMD
voucherValidEndStringNoVoucher valid date to, for refund form of payment as Airline voucher or EMD
useForObject[Integer]NoUsage of Airline voucher or EMD:1-Issue ticket,2-Change ticket,3-Purchase ancillaries product
usageLimitationIntegerNoUsage limitation: 0 - Uncertain, 1-Passenger only, 2-No limitation

3.2.6 segments#

NameTypeRequired or NotParameter Description
airlineStringYesAirline code
flightNumStringYesFlight number
equipmentStringYesEquipment code
cabinClassStringYesCabin class
bookingCodeStringYesBooking code
departureStringYesDeparture airport code
arrivalStringYesArrival airport code
departureTerminalStringNoDeparture terminal
arrivalTerminalStringNoArrival terminal
departureDateStringYesDeparture Date, format [yyyy-mm-dd](local time)
arrivalDateStringYesArrival Date, format [yyyy-mm-dd](local time)
departureTimeStringYesDeparture time, format [hh:mm](local time)
arrivalTimeStringYesArrival time, format [hh:mm] (local time)
flightTimeIntegerYesFlying time, Unit: minutes
stayTimeIntegerNoStay time, Unit: minutes
codeShareStringYesCode-share flight identifier [Y-Yes, N-No]
opFltNoStringNoOperating flight number
opFltAirlineStringNoOperating airline
stopoverStringNoStopover airport code

4 Signature#

4.1 Parameters for Signature#

partnerId,partnerKey

4.2 Signature#

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

5 Appendix#

5.1 Error Code List#

errorCodeerrorMsgDescription
0okSuccess
S001System errorSystem error
P001xxx is illegalRequest parameter is illegal, xxx will display request parameter
P001xxx is missingRequest parameter is required, xxx will display request parameter
B002Partner is not existsPartner is not exists.
B003Illegal signSignature is illegal
B048Invalid buyerBuyer is invalid, please contact PKFARE account manager
B037Order is not existOrder is not exist
B035Concurrency limited. Please contact PKFARE API support team for assistant.Request is over the limiation of concurrency.
B134Refund is not applicable for passenger [passenger name]Passenger or segment in the request has already request for refund or void, which order status is processing or completed.
B135Passenger or ticket number is not in the orderPassenger or ticket number in the request is not same as order.
B136This is not all passengers and routings of the order, please kindly check"allPaxOfOrder" is 1,but pnrList does not contains all passenger and routings.
B137RefundPricing is not existRefund Pricing ID is not exist
B145Passenger(s) must request to refund same routing for one time. If routing is varies, please request per passenger.Multiple passengers request for refund different segments in this request. Please raise refund per passenger.
B146Order#[Order number] is not applicable for refund.Order number in the request is not issue order and not change order. Refund is not allowed.
B149Refund Pricing ID#(Refund Pricing ID) has been expired. Please check refund pricing again.Refund Pricing ID has been expired.
B150This order was changed, please kindly use change order number.Passenger and segment in PnrList has requested for change, please use change order number.
B152pnrList information is not same as order, please kindly check.pnrList in the request is not same as order.
B153Duplicated refund request, please kindly checkPassenger and segment in the request has already submit refund, and the refund is still in processing. System does not allow to request again.
B154pnrList information is not same as refund pricing ID, please kindly checkPnrList information in the request is not same as refund pricing ID, please kindly check.
Modified at 2025-02-24 02:19:17
Previous
CheckRefundPricing
Next
RefundResultNotify