Skip to content

Penalty API

The Penalty API allows to retrieve fare rules (fare notes), along with penalty details for ticket refunds and reissues/revalidation, prior to creating a booking.

Please note that fare rules can be provided as free text.

Endpoint

Method: POST

URL: /json/penalty

Request Parameters

ParameterTypeRequiredDescription
authenticationObjectYesAuthentication details
  └ partnerIdStringYesPartner Id
  └ signStringYesSignature for the request
penaltyObjectYes
  └ searchKeyStringYesUnique search identification from Shopping API
  └ solutionIdStringYesUnique solution identification from Shopping API

Request Example

json
{
  "authentication": {
    "partnerId": "{{PARTNER_ID}}",
    "sign": "{{SIGN}}"
  },
  "penalty": {
    "searchKey": "ISTLON20260814YLONIST20260822Y1100",
    "solutionId": "rmm6MrVT9sqQd6BrNDONH2MLhoKdwGcddhXh9+Wwl8soDBwvLz7qDNm0hFcAay5m8Y5MXjGhKMbeM8hbDKZVZrjalM3U3ixzSpgiWMhbc0l54Wodx2d1VRrzJw3i39+IchK14mM4usIbL83NjLAsXqKS95fnSKUwlOA4V7tOTE6RALKScJ3jiJ4/quVebRmw1Smum12qAkec11m82wghahMq9NTfh0tXP1ZBnuCK/Yot3k/qX69k/gMOyQRG6KQT/KRnH1eB3yynOaiRtpWM7hh2AvrBwwZ9I0bDHzySwhJhGJtYc4SYrmIrH22lmw9XGjQ0ego+9NM0Z3RuRFxLVpB8FHLwKQ4PPJFEO+DpXWGKnjQI0keZrRRm6kg3B6oDcBToRtVU35VBDLAm+hp39w=="
  }
}

Response Parameters

ParameterTypeRequiredDescription
└ errorCodeStringYesError code, refer to Error Code List
└ errorMsgStringYesError message
penaltyObjectYes
  └ penalties[String]YesPenalties are ordered by trip part. Each element in the array corresponds to a trip part in sequential order

Response Example

json
{
  "errorCode": "0",
  "errorMsg": "ok",
  "penalty": {
    "penalties": [
      "Refer to structured rules for trip part 1",
      "Refer to structured rules for trip part 2"
    ]
  }
}

Error Code List

errorCodeerrorMsgDescription
0okRequest has been processed successfully
S001System errorSystem error
P001-Wrong parameter
B002Partner is not existsPartnerID does not exist
B003Illegal signIllegal sign. Please check your signature
B023Penalty failedCollecting fare rule failed

TTN Octo API documentation