Skip to content

Getting Started

All API requests must be sent to the specified base host (BASE_HOST).

In the endpoint documentation, only relative URLs are provided; these should be appended to the base host when making requests.

INFO

For example, /json/shopping refers to BASE_HOST + /json/shopping.

All API requests require a SIGN field to verify the identity of the requester. The signature is generated using the PARTNER_ID and PARTNER_KEY fields. To calculate the signature, concatenate these two values and compute the MD5 hash of the resulting string.

Authentication Parameters Requirements

The PARTNER_ID and PARTNER_KEY are generated on the Partner’s side according to the rules described below. After being generated, these keys are provided to the TTN side to form requests.

PARTNER_ID Format

  • Length: Between 8 and 64 characters.
  • Allowed characters: Only alphanumeric characters from the English alphabet (a-z, A-Z, 0-9), as well as hyphens (-) and underscores (_). Spaces are strictly prohibited.
  • Example: - kL9-2PqX_7

PARTNER_KEY Format

  • Length: Minimum 32 and maximum 128 characters.
  • Complexity: The string must be cryptographically random and include at least one of each:
    • Uppercase English letter (A-Z)
    • Lowercase English letter (a-z)
    • Number (0-9)
    • Special character (e.g., !@#$%^&*()_+={}[]|:;<>,.?/~)
  • Example: - kR4*jT0_YbA7#xP9@qL2$wM5%vA1^zN8 сссс

TIP

Recommendation: Use reliable random string generators or cryptographic utilities (e.g., openssl rand -base64 32) to create the PARTNER_KEY value. Never expose this key in client-side code.

Example

Below is an example of generating the SIGN field using JavaScript:

javascript
const SIGN = md5(PARTNER_ID + PARTNER_KEY);
javascript
Concatenation = kL9-2PqX_7kR4*jT0_YbA7#xP9@qL2$wM5%vC1^zN8;
SIGN = f2300a43a4f802c63b06bcfb4f96e159;

The generated SIGN value must be included in the authentication object of every request body.

Request body example:

json
{
  "authentication": {
    "partnerId": "{{PARTNER_ID}}",
    "sign": "{{SIGN}}"
  },
  "...": "..."
  }
}

Workflow

Below is the workflow diagram illustrating the booking process between the TTN and Partner sides.

Workflow diagram

Order Status Explanation

EnumDescriptionFinal state
ISS_PRCTicket is issuingNo
CHG_PRCChange order is proceedingNo
REFD_PRCRefund order is proceedingNo
VOID_PRCTicket is voidingNo
TO_BE_PAIDTo be PaidNo
ISSUEDTicket issuedYes ⚠️
TO_BE_RSVTo be reservedNo
UNDER_REVIEWUnder reviewNo
HOLDOrder is holding manually, please contact customer service for further actionNo
RSV_FAILReservation failedYes ⚠️
CLOSEDOrder closedNo
CNCLOrder CancelledYes ⚠️
CNCL_TO_BE_REIMOrder Cancelled, and reimbursement is under processingNo
CNCL_REIMEDOrder Cancelled, and payment has been reimbursedYes ⚠️
CHG_RQChange Order is requestedNo
CHG_TO_BE_PAIDChange Order is to be paidNo
CHG_REJChange Order is rejectedYes ⚠️
CHGDChange Order is changedYes ⚠️
REFD_REJRefund Order is rejectedYes ⚠️
REFD_TO_BE_REIMRefunded to be reimbursedNo
REFD_REIMEDRefunded and reimbursedYes ⚠️
VOID_REJVoid request is rejectedYes ⚠️
VOID_TO_BE_REIMVoid to be reimbursedNo
VOID_REIMEDVoid and reimbursedYes ⚠️
VOIDVoidedNo

Scenarios :

  1. Issued success: TO_BE_PAID > ISS_PRC > ISSUED
  2. PNR cancelling: TO_BE_PAID > CNCL
  3. Issued Failed: TO_BE_PAID > ISS_PRC > CNCL_TO_BE_REIM > CNCL_REIMED
  4. Refund Rejected: UNDER_REVIEW > REFD_REJ
  5. Refund Success: UNDER_REVIEW > REFD_PRC > REFD_TO_BE_REIM > REFD_REIMED
  6. Change Rejected: CHG_RQ > UNDER_REVIEW > CHG_REJ
  7. Change Success: CHG_RQ > UNDER_REVIEW > CHG_TO_BE_PAID > CHG_PRC > CHGD

Price Breakdown Explanation

Individual Adult Price = Adult Ticket Fare [adtFare] + Adult Ticket Tax [adtTax] + Ticketing Fee [tktFee]

Individual Child Price = Child Ticket Fare [chdFare] + Child Ticket Tax [chdTax] + Ticketing Fee [tktFee]

Individual Infant Price = Infant Ticket Fare [infFare] + Infant Ticket Tax [infTax] + Ticketing Fee [tktFee]

Total Price = Individual Adult Price * adult passenger number [adults] + Individual Child Price * child passenger number [children] + Individual Infant Price * Infant passenger number [infant]

TTN Octo API documentation