PKFARE API Integration 2027: Flight Booking Step by Step
Travora Hub · November 15, 2026
Reviewed by Muhammad Uzair, Founder and CEO, Travora Hub
PKFARE flight API integration for 2027: shopping, precise pricing, booking, ticketing, webhooks, error codes such as B005 and sandbox testing.
A PKFARE API integration in 2027 connects your website to PKFARE's Flight Buyer API: you search fares, re-price the one the customer picks, read the fare rules, create the order, check the price again, and pay for the ticket from your PKFARE deposit. The order then moves to issued, and PKFARE sends the ticket numbers to your webhook. Two 30-minute windows and a strict rule about the solutionId shape the whole design. This guide walks through each call in order, with the error codes that catch most first integrations.
For how to open a PKFARE buyer account and where to log in, read our PKFARE guide for travel agencies. To compare PKFARE with Duffel, TBO and a GDS, see the flight API comparison. This article is for the developers who will build and test the flow. It is based on PKFARE's API documentation as we read it while building our own integration, and on what we learned testing it.
What you need before you start
- A PKFARE buyer account and a developer account. Your PKFARE business manager issues a partner ID and a partner key.
- A funded prepaid deposit. Tickets are paid from it. Ticketing fails with error B022 when the balance is too low.
- A public webhook URL for ticket issuance notices, registered with PKFARE.
- An operations mailbox for PKFARE's notice emails. Use your own team's address in the booking contact, never the passenger's.
Every request is JSON sent by POST to https://api.pkfare.com. Authentication goes in the body: your partner ID plus a sign, which is the lowercase MD5 hash of the partner ID followed by the partner key. Keep the key on your server only.
The PKFARE flight booking flow
| Step | Endpoint | What it does |
|---|---|---|
| 1. Search | /json/shoppingV10 | Returns fares for one-way or return trips. The response is gzip compressed |
| 2. Re-price | /json/precisePricing_V12 | Confirms the chosen fare, its price and seats |
| 3. Fare rules | /json/penaltyV4 | Returns the change and refund rules to show the customer |
| 4. Book | /json/preciseBooking_V8 | Creates the order and PNR |
| 5. Check price | /json/orderPricingV6 | Required check before you pay |
| 6. Ticket | /json/ticketing | Pays from your deposit and starts ticket issuance |
| 7. Track | /json/orderDetail/v14 and your webhook | Order status and ticket numbers |
| Cancel unpaid | /json/cancel | Cancels an order before ticketing |
| Void | /json/voiding/v2 | Cancels after ticketing, within the void window |
The two 30-minute windows
PreciseBooking must follow PrecisePricing within 30 minutes, and Ticketing must follow OrderPricing within 30 minutes. Miss the first and booking fails with B005. The same error appears if the booking parameters differ from the pricing ones, or if you call pricing and booking at the same time. Make every call in the chain one after the other and wait for each answer.
Customers can take longer than 30 minutes to pay. The safe pattern is to run a fresh PrecisePricing straight before booking, after the customer has paid, so the window starts again. If the new price is higher, stop and ask the customer before you book.
Step 1: Search with Shopping
Shopping accepts up to two journeys, so one-way and return trips. Multi-city needs separate handling. A search can carry up to nine seated passengers, with at least one adult and no more infants than adults. Departure dates run from today to about a year ahead. You can ask for non-stop flights only or for preferred airlines in the request.
Two practical details. The response is gzip compressed, so send Accept-Encoding: gzip and decompress it. And the segment list on a flight is named segmengtIds, with the typo. Read both spellings so a future fix on PKFARE's side does not break your parser.
Step 2: Re-price, and the solutionId rule
Each fare in the search results has a solutionId. Treat it as an opaque string. It can contain +, / and =, so never cut it, decode it or rebuild it. Store the whole value.
Send the search solutionId to PrecisePricing with the same journeys, booking code and passenger counts. The pricing response returns a new solutionId, and that is the one you book with, once only. Never book straight from a search result, and never reuse a solutionId that has been used for a booking.
If pricing returns B020 (no price) or B021 (no seats), PKFARE allows a fallback: send "direct pricing" as the solutionId. The answer is a new offer, so show the customer the new price before you continue.
Step 3: Show the real fare rules
Call PenaltyV4 straight after pricing and show its text in your checkout. The short rules in the search results are only a summary. Customers who are told a ticket is refundable when it is not will raise a chargeback, so the fare rules screen protects you as much as them.
Step 4: Book with clean passenger data
Most booking errors come from passenger details. Check them in your checkout before you take the customer's money:
- Names in English letters only. No accents, no hyphens, and no test names such as TEST or AAA. These fail with P008. Keep the full name within 40 characters.
- The right passenger type for the age. A 9-year-old sent as an adult or an 18-year-old sent as a child fails with B004.
- Passport details when required. Some routes and fares need document type, number, expiry date and nationality, and fail with B065 without them. We collect passports on every PKFARE booking, which avoids the problem.
- Passenger numbering. Number passengers 1, 2, 3 in order, and link each infant to a different adult.
- No duplicates. A second booking for the same passengers and flights while an unpaid one exists fails with B029. Block double clicks in your own code and cancel unpaid duplicates.
Send the net fares from the pricing response in the booking, not your marked-up price, and put your own reference in buyerOrder.
Step 5 and 6: OrderPricing, then Ticketing
OrderPricing is required before every Ticketing call. Straight after booking, the airline system may still be creating the PNR, so PKFARE suggests waiting about two minutes before OrderPricing, or retrying when you get B103. Then call Ticketing within 30 minutes. Ticketing takes the money from your deposit and moves the order into issuing.
Take the customer's payment before you call Ticketing, and refund them automatically if PKFARE later rejects the ticket. Your money is spent from the deposit at Ticketing, so this order of steps keeps you from paying for a ticket nobody paid you for.
Step 7: Ticket numbers, webhooks and polling
When the ticket is issued or rejected, PKFARE calls your webhook with the ticket issuance notice. Make the webhook public, quick and safe to receive twice. As a backup, poll OrderDetail for any order that is not yet final, every few minutes. Read the ticket numbers from the PNR list in the order detail. They are 13 digits long. If an order seems stuck in issuing, you can call RequestTicketing, but no more than once every 10 minutes per order.
PKFARE order statuses
| Path | Statuses in order |
|---|---|
| Issued | TO_BE_PAID, ISS_PRC, ISSED (final) |
| Cancelled before payment | TO_BE_PAID, CNCL (final) |
| Issue failed | ISS_PRC, CNCL_TO_BE_REIM, CNCL_REIMED (final, money back to deposit) |
| Refund | UNDER_REVIEW, REFD_PRC, REFD_TO_BE_REIM, REFD_REIMED (final) |
| Void | VOID_PRC, VOID_TO_BE_REIM, VOID_REIMED (final) |
| Booking failed | RSV_FAIL (final) |
Treat only the final statuses as the end of an order. HOLD needs a person at PKFARE, so alert your team when you see it.
Pricing and your markup
PKFARE returns net fares. For each passenger type the price is fare plus tax plus ticket fee, multiplied by the number of passengers of that type. With prepaid deposit there is no merchant fee; PKFARE lists a 0.1% fee for Alipay top-ups. Add your markup in your own server code and keep the net price, markup and selling price on every booking. Our markup guide explains how agencies set it.
Testing in the sandbox
PKFARE's test environment lets you run the full chain with test credentials. A sandbox-only endpoint, /json/buyer/fake/modifyOrder, forces an order to issued so you can test ticket numbers, webhooks and vouchers without a real ticket. Test these paths before you ask for go-live:
- One-way and return bookings through to issued.
- A price change at pricing, shown to the customer and accepted.
- Cancelling an unpaid order.
- Voiding an issued ticket.
- A ticket rejection, with the customer refunded.
- Infants, children and passport details.
What to add in 2027: schedule changes, refunds and extras
The flow above sells and issues tickets. Before you rely on it for real customers, plan the after-sale side. Airlines change schedules, and PKFARE sends schedule change notices that you must acknowledge and accept or act on. Refunds and changes have their own pricing, request and result notices. Bags and seats are sold through separate ancillary endpoints. For low-cost carriers, PKFARE also has cached shopping endpoints on a separate host. PKFARE ticketing runs 24 hours a day, but its reissue and refund desk works set hours on UTC+8 time, so time-sensitive changes need a plan.
Build it yourself or use a platform?
A team with flight experience can build this chain, but the error handling, webhooks, refunds and schedule changes take more time than the happy path. If you want to sell PKFARE fares on your own site without building it, Travora Hub's PKFARE integration connects your own PKFARE account. You set the markup, customers pay you, and tickets are issued from your deposit. You can sell Duffel NDC fares and hotels from RateHawk on the same site. Our travel API integration guide covers the general steps for any supplier.
Frequently asked questions
How does PKFARE API authentication work?
Each request body includes your partner ID and a sign, which is the lowercase MD5 hash of your partner ID followed by your partner key. Your PKFARE business manager issues both.
Does PKFARE have a sandbox?
Yes. You test with test credentials, and a sandbox-only endpoint forces an order to issued so you can test the full ticketing flow without a real ticket.
What does PKFARE error B005 mean?
Booking happened more than 30 minutes after pricing, the booking details differed from the pricing request, or pricing and booking ran at the same time. Re-price and book again in sequence.
How do I pay for PKFARE tickets?
From a prepaid deposit held with PKFARE. Ticketing takes the cost from that balance, so keep it funded. PKFARE also offers an Alipay top-up with a 0.1% fee.
Do I need IATA accreditation to use PKFARE?
PKFARE sells to registered travel businesses. Whether you also need your own IATA accreditation depends on your country and your account terms, so ask your PKFARE business manager before you launch.
Can PKFARE send ticket numbers automatically?
Yes. Register a webhook URL and PKFARE posts the ticket issuance result to it. Poll order detail as a backup for any order that is not yet final.
To see a flight and hotel booking flow from the customer's side, open the live demo.