Skip to main content

Checkout Endpoint

Builds the cart, re-validates the priced flight and returns the totals the customer should review before confirming. Nothing is booked at this stage.

  • Endpoint: /api/v1/unified-booking/checkout
  • Method: POST

A flight can be sent alone or alongside other Onlynx products in the same products array — they will share one booking and one payment.

:::danger solution_id at checkout products[].solution_id must be the session_id returned by Pricing — not the solutionId from Search. Sending the search value fails with Flight pricing details not found or expired. Please search again. :::

Headers

HeaderValueRequiredDescription
Partner-Access-TokenBase64 StringYesYour encrypted AES-256 time-sensitive token.
X-CurrencyCurrency CodeOptionalDisplay currency. Defaults to your partner currency, then THB.
Accept-LanguageLanguage CodeOptionale.g. en, th, my.
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes

Payload Parameters

ParameterTypeRequiredDescription
productsArrayYesAt least one product.
products[].product_typeStringYespd9 for flights, all providers.
products[].solution_idStringYesThe pricing session_id.
products[].session_idStringOptionalProvider session reference, when supplied by pricing.
products[].passengersArrayOptionalIf sent, each entry must carry a valid passenger_type.
products[].passengers[].passenger_typeStringConditionalADT, CHD or INF. Required when passengers is present.
products[].order_noteStringOptionalFree-text note stored on the booking item.
checkout_session_idStringOptionalReturned in meta by a previous checkout call. Pass it back to reuse the same session instead of re-pricing.
payment_methodStringOptionalSee the payment table below. Defaults to two_c2p for fee calculation.
payment_optionStringOptionalMust be valid for the chosen payment_method.
coupon_codeStringOptionalCampaign coupon to preview a discount.

:::note Passengers at checkout Full passenger details are only required at Checkout Confirm. At checkout you may send a minimal passengers array (just passenger_type per traveller) to preview add-on pricing, or omit it entirely. :::

Payment methods and options

payment_methodValid payment_option values
two_c2pcard_payment, qr_payment, online_payment, two_c2p, and other configured options
gb_prime_paycard_payment, qr_payment
ktc_paycard_payment, alipay
tcc_paywechat_pay, alipay
ksherqr_payment, online_payment
mm_qrmm_qr
aya_mm_qraya_mm_qr
kbz_paykbz_pay_pgw
pay_laterpay_later
custom_guaranteecustom_guarantee

Bank fee

A 3% bank fee is added to the payable amount, except for these combinations, which are fee-free:

  • pay_later
  • two_c2p + qr_payment
  • ksher + qr_payment
  • mm_qr + mm_qr
  • aya_mm_qr + aya_mm_qr
  • kbz_pay + kbz_pay_pgw

Sample Payload

{
"products": [
{
"product_type": "pd9",
"solution_id": "HITIT_67f4c0a91e2b8d3a5c60f7b4",
"order_note": "Window seat preferred",
"passengers": [
{ "passenger_type": "ADT" }
]
}
],
"payment_method": "two_c2p",
"payment_option": "card_payment"
}

With add-ons

To have baggage, meals and seats reflected in the checkout total, include them on the passengers exactly as you will at confirm:

{
"products": [
{
"product_type": "pd9",
"solution_id": "HITIT_67f4c0a91e2b8d3a5c60f7b4",
"passengers": [
{
"passenger_type": "ADT",
"ancillary": {
"ancillary_id": "BAG_XBAG_20",
"session_id": "HITIT_67f4c0b21e2b8d3a5c60f7c9"
},
"ancillaries": { "0-0": "BAG_XBAG_20" },
"selected_seats": [
{
"seatNumber": "12A",
"segmentId": "0-0",
"session_id": "HITIT_67f4c0d31e2b8d3a5c60f8a2"
}
]
}
]
}
],
"payment_method": "two_c2p",
"payment_option": "card_payment"
}

Response

:::warning Keys are snake_cased here All three /unified-booking/* endpoints pass their response through a snake-case converter. Fields that are camelCase on the flight endpoints arrive snake_cased here:

On /flights/*On /unified-booking/*
solutionIdsolution_id
journeyListjourney_list
segmentListsegment_list
pricingDetailspricing_details
flightDetailsflight_details
segmentBaggageMappingListsegment_baggage_mapping_list
departureAirportdeparture_airport

All-uppercase keys (ADT, CHD) and keys containing punctuation or spaces ("0-0", "Checked Baggage") are left untouched. :::

data is an array with one entry per product. A flight entry is the full pricing snapshot plus these cart fields:

FieldTypeDescription
puidStringProduct unique ID within this cart.
product_typeStringpd9.
sub_totalFloatFlight total in display currency, including selected add-ons.
grand_totalFloatSame as sub_total for a flight line.
display_sub_total / display_grand_totalFloatExplicit display-currency totals.
display_currencyStringDisplay currency code.
session_idStringThe pricing session.
solutionObjectFull itinerary.
pricing_detailsObjectPrice breakdown, display and THB. See Pricing.
flight_detailsArrayPre-formatted journey summaries.

meta

FieldTypeDescription
currency_codeStringDisplay currency.
sub_totalFloatSum of all product totals.
grand_totalFloatsub_total minus discount, before bank fee.
discount_amountFloatCoupon discount applied.
bank_fee_typeString|nullpercentage when a fee applies, otherwise null.
bank_fee_amountFloatFee percentage, e.g. 3.
bank_fee_priceFloatCalculated fee.
bank_fee_sub_totalFloatPayable before fee.
bank_fee_grand_totalFloatFinal amount payable, including bank fee.
payableFloatSame as bank_fee_grand_total.
coupon_codeString|nullEcho of the submitted coupon.
payment_method / payment_optionString|nullEcho of the submitted payment selection.
checkout_session_idStringPass back on the next checkout call to reuse this session.
expires_atStringISO-8601 expiry of the checkout session.

Sample Response

Truncated.

{
"result": 1,
"message": "Checkout updated. Please review your details before continuing",
"data": [
{
"puid": "0G7KY9KNb6",
"product_type": "pd9",
"session_id": "HITIT_67f4c0a91e2b8d3a5c60f7b4",
"sub_total": 9830.00,
"grand_total": 9830.00,
"display_sub_total": 9830.00,
"display_grand_total": 9830.00,
"display_currency": "THB",
"solution": { },
"pricing_details": {
"adults": {
"count": 1,
"fare": 7200.00,
"tax": 1250.00,
"total": 8450.00,
"total_thb": 8450.00
},
"grand_total": 8450.00,
"grand_total_thb": 8450.00,
"currency_code": "THB"
},
"flight_details": [ ]
}
],
"meta": {
"currency_code": "THB",
"sub_total": 9830.00,
"grand_total": 9830.00,
"discount_amount": 0,
"bank_fee_type": "percentage",
"bank_fee_amount": 3,
"bank_fee_price": 294.90,
"bank_fee_sub_total": 9830.00,
"bank_fee_grand_total": 10124.90,
"payable": 10124.90,
"coupon_code": null,
"payment_method": "two_c2p",
"payment_option": "card_payment",
"checkout_session_id": "01JQ8R3V7K2M9XPD4T6Z0YHB5C",
"expires_at": "2026-08-26T09:15:00+07:00"
}
}

Errors

MessageCause
Flight pricing details not found or expired. Please search again.solution_id is not a valid pricing session, or the session expired.
Unsupported product type: {type}product_type is not a recognised product.
HTTP 422 with errorsValidation failed — e.g. missing solution_id, invalid passenger_type.

Next Step

Call Checkout Confirm with full passenger and buyer details.