Skip to content

Recalculate ​

Re-prices a chosen trip and fare for specific passengers — for example, to apply per-passenger discounts before creating an order. Returns the per-passenger price breakdown.

Endpoint ​

Method: POST

URL: /v1/recalculate

Request Headers ​

ParameterTypeRequiredDescription
AuthorizationStringYesBearer <token> from Login

Request Parameters ​

ParameterTypeRequiredDescription
└ trip_idStringYesTrip id from a Search / Trip Details result
└ fare_classStringNoChosen fare class
└ currencyStringNoRequested pricing currency
└ passengers[Object]YesPassengers to price
  └ indexIntegerNoPassenger position
  └ typeStringNoPassenger type, refer to Passenger Types
  └ discount_idStringNoChosen discount id (from Trip Details)
  └ discount_codeStringNoChosen discount code

Request Example ​

json
{
  "trip_id": "trip_8f21",
  "fare_class": "adult",
  "currency": "UAH",
  "passengers": [
    { "index": 0, "type": "adult" },
    { "index": 1, "type": "adult" },
    { "index": 2, "type": "child", "discount_id": "d_child", "discount_code": "child" }
  ]
}

Response Parameters ​

ParameterTypeRequiredDescription
└ currencyStringYesCurrency of the returned prices
└ passengers[Object]YesPer-passenger price breakdown
  └ indexIntegerNoPassenger position (echo of request)
  └ typeStringNoPassenger type
  └ priceNumberNoPrice for this passenger
  └ currencyStringNoCurrency for this passenger
  └ discount_idStringNoApplied discount id
  └ discount_codeStringNoApplied discount code
  └ discount_percentNumberNoApplied discount percentage

Response Example ​

json
{
  "currency": "UAH",
  "passengers": [
    { "index": 0, "type": "adult", "price": 650.0, "currency": "UAH" },
    { "index": 1, "type": "adult", "price": 650.0, "currency": "UAH" },
    { "index": 2, "type": "child", "price": 325.0, "currency": "UAH", "discount_id": "d_child", "discount_code": "child", "discount_percent": 50 }
  ]
}

Error Code List ​

codemessageDescription
UNAUTHORIZEDInvalid tokenThe bearer token is missing, invalid, or expired (401).
NOT_FOUNDTrip not foundThe trip_id is unknown or has expired.

TTN Octo API documentation