API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

POST/contracts/{id}/flight_shopsOther

Create Flight Shop

https://fintech.staging.htsapis.com/flights-dafar/v2/contracts/{id}/flight_shops

Create a flight shop to find available rebook itineraries for a disrupted contract. Identify the segment to rebook with segment_id from the rebook eligibility response. By default HTS sources and filters the inventory. Partners that push their own inventory send inventory_source.type=partner_supplied with raw_itineraries; HTS then applies the same eligibility, filtering, and ranking to the supplied itineraries. Partner-supplied mode is gated per tenant.

Parameters

id
path · string
required

A unique identifier for a contract.

Request body application/json · required

segment_id
string
required

The segment to rebook, identified by the id returned in the rebook eligibility response (slices[].segments[].id). Must reference a rebook-eligible segment of this purchase; HTS derives the search origin/destination and date window from that segment.

checked_bags
boolean
required

Whether the customer has checked bags. If true, additional departure time filtering is applied to allow the customer enough time to retrieve their checked bags before the rebooked flight.

inventory_source
inventory_source · one of 2

Where to source the rebook inventory. Omit (or send type=hts) for standard HTS-sourced shopping. Send type=partner_supplied with raw_itineraries to shop the partner's own pushed inventory; this mode requires the tenant to be allowlisted.

Show fields

Where to source the rebook inventory. Omit (or send type=hts) for standard HTS-sourced shopping. Send type=partner_supplied with raw_itineraries to shop the partner's own pushed inventory; this mode requires the tenant to be allowlisted.

Exactly one of the following, selected by type:
hts (hts) hts
type
string
required

value: hts

partner_supplied (partner_supplied) partner_supplied
type
string
required

value: partner_supplied

raw_itineraries
array of shopped_itinerary
required

The partner-supplied itineraries to shop, in the same canonical shape HTS returns from this endpoint. The partner assigns each itinerary a unique id; that id is echoed back in the shop response and is the itinerary_id the partner sends when creating a flight price quote. Each itinerary must end at the final destination of the slice whose segment is disrupted: HTS rebooks through to the slice's final destination rather than replacing only the disrupted segment. For example, for an original slice A->B->C->D where the disrupted segment is B->C, rebook itineraries run from B to D, not B to C. Itineraries that do not end at the slice's final destination are rejected with 400 Bad Request. An empty list yields 204 No Content, the same as an empty HTS shop result. Each itinerary must carry a fare_price (amount and currency); HTS uses it to apply the rebook-allowance filter and to record the redemption amount.

Show fields
Array of shopped_itinerary · The partner-supplied itineraries to shop, in the same canonical shape HTS returns from this endpoint. The partner assigns each itinerary a unique id; that id is echoed back in the shop response and is the itinerary_id the partner sends when creating a flight price quote. Each itinerary must end at the final destination of the slice whose segment is disrupted: HTS rebooks through to the slice's final destination rather than replacing only the disrupted segment. For example, for an original slice A->B->C->D where the disrupted segment is B->C, rebook itineraries run from B to D, not B to C. Itineraries that do not end at the slice's final destination are rejected with 400 Bad Request. An empty list yields 204 No Content, the same as an empty HTS shop result. Each itinerary must carry a fare_price (amount and currency); HTS uses it to apply the rebook-allowance filter and to record the redemption amount.
id
string
required

Unique identifier for this itinerary.

slices
array of shopped_slice
required

The slices (legs) of this itinerary.

Items ≥ 1
Show fields
Array of shopped_slice · The slices (legs) of this itinerary.
Items ≥ 1
segments
array of shopped_segment
required

The segments in this slice.

Items ≥ 1
Show fields
…
fare_brand
string

Name of the fare brand for this slice, if the source provides one.

Length ≥ 1
fare_price
shopped_fare_price

Total price of the fare for this itinerary. Required on each partner-supplied raw itinerary: HTS uses it to apply the rebook-allowance filter and to record the redemption amount. Never present on itineraries in the shop response.

Show fields
amount
string
required

Total fare amount, including taxes. Must be greater than zero.

currency
string
required

Currency of the fare amount, as an ISO 4217 code.

Responses

201Available rebook itineraries. If no flights are available, a 204 No Content will be returned.
expires_at
string · date-time
required

Date and time at which the shop results expire, as a UTC RFC3339 formatted datetime.

itineraries
array of shopped_itinerary
required

Available itineraries for rebook.

Items ≥ 1
Show fields
Array of shopped_itinerary · Available itineraries for rebook.
Items ≥ 1
id
string
required

Unique identifier for this itinerary.

slices
array of shopped_slice
required

The slices (legs) of this itinerary.

Items ≥ 1
Show fields
Array of shopped_slice · The slices (legs) of this itinerary.
Items ≥ 1
segments
array of shopped_segment
required

The segments in this slice.

Items ≥ 1
Show fields
Array of shopped_segment · The segments in this slice.
Items ≥ 1
origin_airport
string
required

IATA code of the origin airport.

Pattern [A-Z]{3}
destination_airport
string
required

IATA code of the destination airport.

Pattern [A-Z]{3}
departure_date_time
string
required

Scheduled local departure date and time in ISO Local Date Time format.

arrival_date_time
string
required

Scheduled local arrival date and time in ISO Local Date Time format.

marketing_carrier_code
string
required

IATA marketing carrier code.

Pattern [A-Z0-9]{2}
marketing_flight_number
string
required

Marketing flight number.

Pattern [0-9]{1,4}
cabin
string enum
required

Cabin class.

Values economypremium_economybusinessfirst
operating_carrier_code
string

IATA operating carrier code, present when the flight is operated by a different carrier.

Pattern [A-Z0-9]{2}
operating_flight_number
string

Operating flight number, present when the flight is operated under a different number.

Pattern [0-9]{1,4}
reservation_booking_designator
string

Reservation Booking Designator (RBD) for this segment: the booking code the airline sold the seat under, one uppercase letter and an optional second letter or digit. Also known as booking class, booking code, class of service, or fare class (e.g. Y, B, M, Q, N, J, F, E1). Pass the code exactly as it appears on the ticket/PNR.

Pattern ^[A-Z][A-Z0-9]?$
fare_brand
string

Name of the fare brand for this slice, if the source provides one.

Length ≥ 1
fare_price
shopped_fare_price

Total price of the fare for this itinerary. Required on each partner-supplied raw itinerary: HTS uses it to apply the rebook-allowance filter and to record the redemption amount. Never present on itineraries in the shop response.

Show fields
amount
string
required

Total fare amount, including taxes. Must be greater than zero.

currency
string
required

Currency of the fare amount, as an ISO 4217 code.

204No rebook flights available
No body.
400Syntactic errors were encountered while handling the request
Array of error
message
string
required
code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
401The client could not be authenticated
No body.
403The authenticated client does not have permission to call this endpoint
No body.
404The requested resource could not be found
No body.
422Semantic errors were encountered while handling the request
Array of dafar_flight_shop_error · one of 6
Items ≥ 1
Exactly one of the following, selected by code:
contract_already_exercised (contract_already_exercised1) contract_already_exercised1
message
string
required

A human-readable message describing the error

code
string
required
contract_expired (contract_expired1) contract_expired1
message
string
required

A human-readable message describing the error

code
string
required
contract_not_confirmed (contract_not_confirmed1) contract_not_confirmed1
message
string
required

A human-readable message describing the error

code
string
required
contract_not_found (contract_not_found1) contract_not_found1
message
string
required

A human-readable message describing the error

code
string
required
partner_inventory_not_enabled (partner_inventory_not_enabled) partner_inventory_not_enabled
message
string
required

A human-readable message describing the error

code
string
required
segment_not_in_contract (segment_not_in_contract) segment_not_in_contract
message
string
required

A human-readable message describing the error

code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
499The client cancelled the request
No body.
500The server encountered an internal error
No body.
Request
curl -X POST "https://fintech.staging.htsapis.com/flights-dafar/v2/contracts/<id>/flight_shops" \
  -H "X-Api-Key: $HTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "segment_id": "seg_1",
  "checked_bags": true,
  "inventory_source": {
    "type": "string"
  }
}'
Response 201
{
  "expires_at": "2024-06-15T15:00:00Z",
  "itineraries": [
    {
      "id": "itin_1",
      "slices": [
        {
          "segments": [
            {
              "origin_airport": "YUL",
              "destination_airport": "YYZ",
              "departure_date_time": "2024-06-15T14:30",
              "arrival_date_time": "2024-06-15T16:00",
              "marketing_carrier_code": "AC",
              "marketing_flight_number": 123,
              "operating_carrier_code": "QK",
              "operating_flight_number": 456,
              "cabin": "Economy",
              "reservation_booking_designator": "F"
            }
          ],
          "fare_brand": "Economy Flex"
        }
      ],
      "fare_price": {
        "amount": "350.00",
        "currency": "USD"
      }
    }
  ]
}

Examples are generated from the schema where the spec publishes none; field values are illustrative.