Booking | SetPaymentToBooking

Set payment method to a booking.

Notice:

  • Product Scope: TechHub, FareMarket
  • Please set the paymentCode retrieved from GetBookingPayments.

POST

/flight/booking

Parameter

Field Mandatory Type Scope Description
action required String SetPaymentToBooking
key required String API security key applied from AeroHub
signature required String Refer to Guideline to generate
timestamp required Int The ‘timestamp’ field should be a 10-digit Unix timestamp in seconds, used for encryption and data verification
version optional String API version information, e.g. 3.0.0
request required Object
  paymentCode required String Payment code get from GetBookingPayments
AAG: AeroHub payment account
CAG: customized account set up by customer
CC: Credit / Debt card
  sessionId required String Generated from AirPricing
  timeout optional int timeout in seconds
  ccFields optional Object TechHub Credit / Debt card information
    cardNumber optional String TechHub Credit / Debt card information
    expiration optional String TechHub Card expiration time, format: MM/YY
    holderName optional String TechHub Credit / Debt Card holder name
    cvv optional String TechHub Card Verification Value
    cardType optional int TechHub Card type
0: VISA
1: MasterCard
2: American Express
3: UnionPay
4: JCB
5: Diners Club
6: UATP

Request_Example:

{
    "action": "SetPaymentToBooking",
    "key": "n93mPT7WzN6cLKC2",
    "signature": "YhQ2EoBQOfOnf/EOnuuuK5i+K+ncydeQhjFpoXYiEMo=",
    "timestamp": 1685116516,
    "request": {
        "sessionId": "e7b9e00ee26a8df4b5e6840d1869bfda",
        "paymentCode": "AAG",
        "timeout": 200
    }
}

Response

Notes

The price included in the API response comprises the total price of both the ticket and ancillary products when purchased together with the ticket. When purchasing ancillary products separately, it only includes the price of the ancillary products.

Field Type Description
status int 0 for success, others for failure, refer to status error appendix for details
msg String Return message, maximum 64 char
contentStatus int Return the original code from airlines or suppliers
contentMsg String Return the original message from airlines or suppliers, maximum 64 char
amount Float Total cost for payment
currency String Currency information, 3_letter code e.g. USD
originalAmount Float Total cost for payment
originalCurrency String Currency information, 3_letter code e.g. USD
balanceDue Float Amount to be paid
paymentDetails Object[] Details of the payment amount.
  type int Type of amount.
1: Flight order amount.
2: Airline payment fee.
  desc String Description of the payment.
  originalAmount Float Amount in the original currency.
  originalCurrency String The original currency code.
  amount Float Amount in the customer’s quoted currency.
  currency String The customer’s currency code.

Success-Response:

{
    "status": 0,
    "originalAmount": 13320.00,
    "balanceDue": 13320.00,
    "originalCurrency": "TWD",
    "msg": "Success",
    "amount": 59805.02,
    "currency": "JPY",
    "contentStatus": 0,
    "contentMsg": "Success",
    "paymentDetails": [
        {
            "type": 1,
            "desc": "orderPrice",
            "originalAmount": 211.08,
            "originalCurrency": "SGD",
            "amount": 146.52,
            "currency": "EUR"
        },
        {
            "type": 2,
            "desc": "CreditCard PaymentFee",
            "originalAmount": 4.07,
            "originalCurrency": "SGD",
            "amount": 2.83,
            "currency": "EUR"
        }
    ]
}

Status Code

Name Description
1000 General system error
1001 Request parameters or part of parameters missing
1002 Invalid Action
1003 API request timeout, please request again
1004 Invalid request parameter
1005 Service system error
1006 System busy, please try again
1101 Authentication fail, wrong signature
1102 Account disabled, please contact with account administrator
2301 Invalid payment methods
2024 Set payment failed

Error-Response

{
    "status": 1000,
    "msg": "Letslfy flight internal error"
}
Author:admin  Create time:2023-05-24 16:08
Last editor:AeroHub  Update time:2025-04-22 14:25