1. RefundPricing
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. RefundPricing

RefundPricing

1 Document Description#

1.1 Function#

This API is used for price inquiries for refunded tickets. The purchaser request initiates an application according to the order number and the ticket number for which the refund is to be processed. After the application and verification is successful, the system will generate a Refund Pricing inquiry record in the system.

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 Charater Encoding#

The character code of this API is UTF-8 .

1.4 URL#

|Environment |URL |
| :--- | :---: | ---: |
|Test environment |http://open.pkfare.com/refundPricing/generate |
|Prod environment |http://{{apiHost}}/refundPricing/generate |
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 mehtod#

POST

1.6 Request Header#

|key |value |
| :--- | :---: | ---: |
|Content-Type |application/x-www-form-urlencoded |

2 Request#

2.1 Schema#

nametypedescription
paramThe value after Base64 encoding the Basic Request. The Basic Request is a JSON-structured data, and the detailed explanation is provided in the following text.Text

2.1.1 Basic Request#

sample
{
    "authentication": {
        "partnerId": "sIxxcsRCtssslnHt+BiT4bwONbMw=",
        "sign": "234f554590789459af1e610e872896a3c6"
    },
    "data": {
        "allPaxOfOrder": 0,
        "refundReason": "2",
        "refundType": "1",
        "uploadedFileIds": [
            "d0asisuddfjasld",
            "asdfasdasdas158"
        ],
        "orderNum": "916783592892089401",
        "pnrList": [
            {
                "arrival": "SEA",
                "bookingCode": "string",
                "cabinClass": "string",
                "departure": "LAX",
                "flightNum": "DL1473",
                "segmentNo": 1,
                "ticketNums": [
                    {
                        "birthday": "2003-05-11",
                        "cardNum": "string",
                        "cardType": "string",
                        "firstName": "Joshua",
                        "pnr": "AB8SED",
                        "airPnr": "AB8SED",
                        "lastName": "Perez",
                        "sex": "M",
                        "ticketNum": "123456"
                    }
                ]
            }
        ]
    }
}
|name |type |required |description |
| :--- | :---: | ---: |
|authentication |Object |yes |Identity information, refer to 2.1.2. |
|data |Object |yes |File information,refer to 2.1.3 |

2.1.2 Authentication#

|name |type |required |description |
| :--- | :---: | ---: |
|partnerId |String |yes |partnerID |
|sign |String |yes |Signature, refer to sections 4.1 and 4.2 for the signature method. |

2.1.3 Data#

|name |type |required |description |
| :--- | :---: | ---: |
|allPaxOfOrder |Integer |yes |tag for all passengers,0-No,1-Yes。If the value is “1”, system will check whether pnrlist includes all passengers. |
|orderNum |String |yes |order number |
|refundType |Integer |yes |Refund Type:0-Voluntary, 1-Involuntary |
|refundReason|String|Yes|Refund reason:0-Personal Reason, 1-Illness Reason, 2-Schedule Change Reason, 3-Crisis Reason, 4-Visa Refusal|
|uploadedFlieIds |Array(String) |no |File ID, At most 99 files are supported. |
|pnrList |Array |yes |PNR list and ticket number list. |
|canceledReservationBeforeDeparture|Integer|No|PNR 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#

|name |type |required |description |
| :--- | :---: | ---: |
|segmentNo |Integer |yes |segment sequence |
|departure |String |yes |departure airport |
|arrival |String |yes |arrival airport |
|flightNum |String |yes |flight number |
|cabinClass |String |yes |cabin code |
|bookingCode |String |yes |booking code |
|pnr |String |no |PNR |
|airPnr |String |no |airlines PNR |
|ticketNums |Array |yes |passengers and ticket numbers |

2.1.5 ticketNums#

nametyperequireddescription
ticketNumStringnoticket number
lastNameStringyeslast name
firstNameStringyesfirst name
cardTypeStringnoID type
cardNumStringnoID number
sexStringyessex
birthdayStringyesdate of birth,format[YYYY-MM-DD]

2.2 Sample of Request Construction Process#

2.2.1 Request Sample#

{
    "authentication": {
        "partnerId": "sIxxcsRCtSIlnHt+BiT4bwONbMw=",
        "sign": "234f55459079289af1e610e872896a3c6"
    },
    "data": {
        "allPaxOfOrder": 0
        "refundReason": "2",
        "refundType": "1",
        "uploadedFileIds": [
            "d0asisuddfjasld",
            "asdfasdasdas158"
        ],
        "orderNum": "916783592892089401",
        "pnrList": [
            {
                "arrival": "SEA",
                "bookingCode": "string",
                "cabinClass": "string",
                "departure": "LAX",
                "flightNum": "DL1473",
                "segmentNo": 1,
                "ticketNums": [
                    {
                        "birthday": "2003-05-11",
                        "cardNum": "string",
                        "cardType": "string",
                        "firstName": "Joshua",
                        "lastName": "Perez",
                        "sex": "M",
                        "ticketNum": "123456"
                    }
                ]
            }
        ]
    }
}

2.2.2 Base64 Encryption#

eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiJzSXh4Y3NSQ3RTSWxuSHQrQmlUNGJ3T05iTXc9Iiwic2lnbiI6IjIzNGY1NTQ1OTA3OTI4OWFmMWU2MTBlODcyODk2YTNjNiJ9LCJkYXRhIjp7ImFsbFBheE9mT3JkZXIiOjAsInJlZnVuZFJlYXNvbiI6IjIiLCJyZWZ1bmRUeXBlIjoiMSIsInVwbG9hZGVkRmlsZUlkcyI6WyJkMGFzaXN1ZGRmamFzbGQiLCJhc2RmYXNkYXNkYXMxNTgiXSwib3JkZXJOdW0iOiI5MTY3ODM1OTI4OTIwODk0MDEiLCJwbnJMaXN0IjpbeyJhcnJpdmFsIjoiU0VBIiwiYm9va2luZ0NvZGUiOiJzdHJpbmciLCJjYWJpbkNsYXNzIjoic3RyaW5nIiwiZGVwYXJ0dXJlIjoiTEFYIiwiZmxpZ2h0TnVtIjoiREwxNDczIiwic2VnbWVudE5vIjoxLCJ0aWNrZXROdW1zIjpbeyJiaXJ0aGRheSI6IjIwMDMtMDUtMTEiLCJjYXJkTnVtIjoic3RyaW5nIiwiY2FyZFR5cGUiOiJzdHJpbmciLCJmaXJzdE5hbWUiOiJKb3NodWEiLCJsYXN0TmFtZSI6IlBlcmV6Iiwic2V4IjoiTSIsInRpY2tldE51bSI6IjEyMzQ1NiJ9XX1dfX0=

2.2.3 Post Request#

POST http://open.pkfare.com/refundPricing/generate
Content-Type: application/x-www-form-urlencoded


param=eyJhdXRoZW50aWNhdGlvbiI6eyJwYXJ0bmVySWQiOiJzSXh4Y3NSQ3RTSWxuSHQrQmlUNGJ3T05iTXc9Iiwic2lnbiI6IjIzNGY1NTQ1OTA3OTI4OWFmMWU2MTBlODcyODk2YTNjNiJ9LCJkYXRhIjp7ImFsbFBheE9mT3JkZXIiOjAsInJlZnVuZFJlYXNvbiI6IjIiLCJyZWZ1bmRUeXBlIjoiMSIsInVwbG9hZGVkRmlsZUlkcyI6WyJkMGFzaXN1ZGRmamFzbGQiLCJhc2RmYXNkYXNkYXMxNTgiXSwib3JkZXJOdW0iOiI5MTY3ODM1OTI4OTIwODk0MDEiLCJwbnJMaXN0IjpbeyJhcnJpdmFsIjoiU0VBIiwiYm9va2luZ0NvZGUiOiJzdHJpbmciLCJjYWJpbkNsYXNzIjoic3RyaW5nIiwiZGVwYXJ0dXJlIjoiTEFYIiwiZmxpZ2h0TnVtIjoiREwxNDczIiwic2VnbWVudE5vIjoxLCJ0aWNrZXROdW1zIjpbeyJiaXJ0aGRheSI6IjIwMDMtMDUtMTEiLCJjYXJkTnVtIjoic3RyaW5nIiwiY2FyZFR5cGUiOiJzdHJpbmciLCJmaXJzdE5hbWUiOiJKb3NodWEiLCJsYXN0TmFtZSI6IlBlcmV6Iiwic2V4IjoiTSIsInRpY2tldE51bSI6IjEyMzQ1NiJ9XX1dfX0=

3 Response#

3.1 Response Sample#

{
    "errorCode": "0",
    "errorMsg": "ok",
    "data": {
        "needUploadFileId": 0,
        "orderNum": "916777559161841201",
        "refundPriceId": "16786066309484323",
        "refundPricingStatus": "refund pricing",
        "refundReason": 0,
        "refundType": 0,
        "lastComfirmTime": "2022-02-03 13:00:00"
        "passengerPriceList": [
            {
                "birthday": "2003-06-05",
                "cardNum": "G47350571",
                "cardType": "P",
                "firstName": "Justin",
                "lastName": "Lopez",
                "sex": "M",
                "ticketNum": "123456",
                "solutions": {
                    "currency": "USD",
                    "paidAmount": 1.00,
                    "usedAmount": 1.00,
                    "nonRefundableAmount": 1.00,
                    "refundServiceFee": 1.00,
                    "refundAmount": 1.00,
                    "FormOfPayment": "PrePay"
                },
                "segmentList": [
                    {
                        "arrival": "SIN",
                        "bookingCode": "Z",
                        "cabinClass": "ECONOMY",
                        "departure": "KUL",
                        "flightNum": "AK703",
                        "pnr": "YMERBD",
                        "airPnr": "YMERBD",
                        "segmentNo": 1,
                        "ticketNum": "1677755872384"
                    }
                ]
            }
        ]
    }
}

3.2 Response Parameters#

nametyperequireddescription
errorCodeStringYeserror code,refer to error code list
errorMsgStringNoerror message
warningMsgStringNowarning message
dataObjectNoThe returned data, this parameter is not empty only when the error code returns "0", refer to section 3.2.1.

3.2.1 data#

nametyperequireddescription
refundPriceIdStringyesrefund price ID
refundPricingStatusStringyesrefund status: 1-Refund Pricing和Supplier Pricing,2-Refund Priced, 3-Canceled
orderNumStringyesPKFARE order number
lastComfirmTimeStringnolast mintue to confirm refund; YYYY-MM-DD HH:MM (UTC+0)
passengerPriceListArrayyesthe flight segments that are refunded and price information
refundTypeStringyesrefund type:0-Voluntary, 1-Involuntary -
refundReasonIntegeryesreasons for refund:0-Personal Reason, 1-Illness Reason, 2-Schedule Change Reason, 3-Crisis Reason, 4-Visa Refusal
needUploadFileIdIntegeryesWhen submit refund request, sometimes the supporting documents are needed, including passport photo and so on; 0-no need; 1-need

3.2.2 passengerPriceList#

nametyperequireddescription
segmentListArrayyessegment information,refer to 3.2.4
lastNameStringyeslast name
firstNameStringyesfirst name
cardTypeStringnoidentification type
cardNumStringnoID number
sexStringyessex
birthdayStringyesbirthday, format [yyyy-MM-dd]
solutionsObjectnoRefund amount details, refer to 3.2.4

3.2.3 segmentList#

nametyperequireddescription
segmentNoIntegeryessegment sequence
departureStringyesdeparture airport
arrivalStringyesarrival airport
flightNumStringyesflight number
cabinClassStringyescabin class
bookingCodeStringyesbooking code
pnrStringnoPNR
airPnrStringnoairlines PNR
ticketNumStringnoticket number

3.2.4 solutions#

nametyperequireddescription
currencyStringyescurrency
paidAmountBigDecimalyespaid amount
usedAmountBigDecimalyesused amount
nonRefundableAmountBigDecimalyesnon-refundable amount(Includes airline penalties, non-refundable taxes, and supplier refund service fees)
refundServiceFeeBigDecimalyesrefund service fees(PKFARE)
refundAmountBigDecimalyesrefundable amount
FormOfPaymentStringyespayment method:Depends on payment method, Airline voucher, Depends on refund result, EMD

4 sign#

4.1 Parameters#

partnerId,partnerKey

4.2 sign#

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

5 Appendix#

5.1 Error Code List#

error codeerror messagedescription
0Oksuccess
P001xxx is illegalinvalid parameters
B002Partner is not existsinvalid partner
B003Illegal signIllegal sign
B048Invalid buyerInvalid buyer
B037Order is not existOrder is not exist
S001System errorsystem error
B134Refund is not applicable for passenger [pax name]The passenger and ticket in the application already have an associated voided ticket or refund order and the status of the voided ticket or refund order is valid, and it is not allowed to initiate another refund offer application.
B142Passenger or ticket number is not in the orderThe order number in the request does not match the passenger or ticket number
B143Involuntary Refund is not applicable to check refundable price, please request refund request directly.Refund Pricing does not provide quotes for Involuntary Refund.
B136This is not all passengers and routings of the order, please kindly check.The parameter "allPaxOfOrder" is 1, but part of the ticket information is missing from the pnrList.
B146Order#[Order number] is not applicable for refund.The order in the request is not a ticket issuance or change order and cannot be requested for a refund.
B140Refund is not applicable for ticket number [ticket number]The ticket in the application is found to have a status of USED for all segments after the ticket is extracted, and it is not allowed to initiate a refund offer request again.
B147Ticket(s) [ticket number] is No-show, refund is not applicable.The ticket in the application has exceeded the No-show time limit and no refunds are allowed.
B145Passenger(s) must request to refund same routing for one time. If routing is varies, please request per passenger.In the case of multiple passengers, the itineraries for which refunds are requested must be the same. If the itineraries are not identical, the itinerary must be as requested by the passenger
B148UploadFileId is not exist.The Upload Filed ID in the request does not exist
B150This order was changed, please kindly use change order number.The order number specified in the request is the original order, and the passenger+segment specified in the PnrList already has a change order
B152pnrList information is not same as order, please kindly check.In the request, the journey of the order number and the information of the pnrList do not match
Modified at 2024-05-06 02:20:53
Previous
GetScheduleChangeReply
Next
CheckRefundPricing