This endpoint is compliant with version 1.0 of the JSON API spec. To fully understand the structure of the data and relationships between resources, refer to the official specification: http://jsonapi.org/format/1.0/
Request
Endpoint
POST /legs_searches
Headers
Name | Required | Description |
---|---|---|
Auth |
Yes | Your API key |
Content-Type |
Yes | Must be application/vnd.routehappy+json |
Accept |
Yes | Must be application/vnd.routehappy+json |
Accept-Language |
No | Used for translation of the properties. The use of this header is documented under RFC 3282. |
Accept-Encoding |
No | Support for gzip HTTP compression. To receive compressed response bodies, send `gzip. |
Parameters
Name | Required | Description |
---|---|---|
include |
No | Comma-delimited list of related resources to include. By default, this endpoint does not return any related resources. |
Body Structure
A JSON object must be at the top level. It must contain a data
member. The data
member must contain type
and attributes
members.
{
"data": {
"type": "legs_search",
"attributes": {
// ... This leg_search's attributes
}
}
}
Available attributes:
Name | Type | Required | Description |
---|---|---|---|
legs |
array |
Yes | One or more leg objects |
categories |
array |
No | One or more category IDs. Used for filtering UPAs and UTAs. For example, to return only UPAs/UTAs having the standard category seat and custom category children , send: ["seat", "children"] |
pcc |
string |
No | A single pseudo city code associated with the request, used for determining data access privileges. |
fare_source |
string |
No | A code identifying the fare provider for the legs requested, e.g. 1A (Amadeus), 1S (Sabre), etc. The attribute is used to determine which UTAs to provide. |
leg
Name | Type | Required | Description |
---|---|---|---|
key |
string |
No | [DEPRECATED] Use the segments property instead. |
segments |
array |
Yes | One or more segment objects |
fare_basis_code |
string |
No | [DEPRECATED] Fare basis codes should be provided per segment (see below). |
governing_segment_index |
string |
No | The zero-based position of the segment in the leg. E.g. 0 is the first segment, 1 is the second segment, etc. Used to specify the governing segment for a leg. |
segment
Name | Type | Required | Description |
---|---|---|---|
key |
string |
No | [DEPRECATED] Use the following properties instead. |
dep |
string |
Yes | The departure airport code |
arr |
string |
Yes | The arrival airport code |
carrier |
string |
Yes | The marketing carrier code |
flt_no |
string |
Yes | The marketing flight number |
dep_date |
string |
Yes | The departure date in YYYY-MM-DD format |
cabin_id |
integer |
Yes | The cabin ID |
fare_basis_code |
string |
Yes/No | Required for fetching cancellation/change policies and fare identification. Not required otherwise. The code representing the fare for the leg being requested. See integration requirements for supported limitations. |
Available Related Resources
Note: UTA/UPA fare types are filtered based on the requested cabins. For example, consider a UPA associated with Economy and Business fare types. If only Economy legs are requested, the UPA will be related only with the Economy fare type in the response.
legs
legs.cancellation_policy
legs.change_policy
legs.leg_fares
legs.leg_fares.fare
legs.leg_fares.utas
legs.leg_fares.utas.optional_service_identifier
legs.leg_fares.leg_fare_segments
legs.leg_fares.leg_fare_segments.upas
legs.leg_fares.leg_fare_segments.upas.optional_service_identifier
legs.leg_fares.leg_fare_segments.upas.photo_attachments
legs.leg_fares.leg_fare_segments.upas.video_attachments
legs.leg_fares.leg_fare_segments.upas.tour_attachments
legs.leg_fares.leg_fare_segments.upas.photo_attachments.photo
legs.leg_fares.leg_fare_segments.upas.video_attachments.video
legs.leg_fares.leg_fare_segments.upas.tour_attachments.tour
Response
Body Structure
The response body is a JSON object. Successful responses have the following top-level members:
data
: the document’s “primary data”included
: an array of resource objects that are related to the primary data and/or each other (“included resources”).meta
: a meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship. Thenot_matched_leg_indexes
member contains the indexed position of requested legs that were not matched, and thus not included in the response. For example, if 3 legs were requested and the second leg was not included in the response,not_matched_leg_indexes
would be[1]
, since1
is the index of the requested leg that was not matched.
Unsuccessful responses have errors
as a top-level member. This is an array of error objects.
Resource Attributes
leg
none
leg_fare
none
fare
Name | Type | Description |
---|---|---|
brand_name |
string |
The name of the branded fare as defined by the airline |
brand_codes |
array |
One or many 1-10 digit alphanumeric codes indicating the Brand Name. Values may include a slash (/), dash (-), and/or period (.). |
cancellation_policy
Name | Type | Description |
---|---|---|
headline |
string |
Headline, up to 40 characters |
description |
string |
Description, up to 140 characters |
assessment_code |
string |
Possible values: N (neutral), B (benefit), R (restriction) |
fee |
object |
amount (number )currency_code (string ) |
change_policy
Name | Type | Description |
---|---|---|
headline |
string |
Headline, up to 40 characters |
description |
string |
Description, up to 140 characters |
assessment_code |
string |
Possible values: N (neutral), B (benefit), R (restriction) |
fee |
object |
amount (number )currency_code (string ) |
uta
Name | Type | Description |
---|---|---|
headline |
string |
Headline, up to 40 characters |
description |
string |
Description, up to 140 characters |
small_icon_url |
string |
URL for the 42x42 icon |
large_icon_url |
string |
URL for the 84x84 icon |
cta_text |
string |
Link text for cta_url |
cta_url |
string |
External URL where the end user can learn more |
assessment |
string |
Possible values: neutral , benefit , restriction , fee |
categories |
array |
Elements are standard category IDs and/or custom category IDs |
fees |
array |
Additional fees. Elements are objects with members:currency_code (string )amount_min (string )amount_max (string or null ) |
bag_limits |
object |
Members: For checked bag allowance and carry on allowance, weight_kg is the maximum allowable weight in Kilograms and size_lcm is the maximum allowable size as a linear measurement in centimeters |
leg_fare_segment
none
upa
Name | Type | Description |
---|---|---|
headline |
string |
Headline, up to 25 characters |
description |
string |
Description, up to 125 characters |
small_icon_url |
string |
URL for the 42x42 icon |
large_icon_url |
string |
URL for the 84x84 icon |
cta_text |
string |
Link text for cta_url |
cta_url |
string |
External URL where the end user can learn more |
categories |
array |
Elements are standard category IDs and/or custom category IDs |
fees |
array |
Additional fees. Elements are objects with members:currency_code (string )amount_min (string )amount_max (string or null ) |
photo_attachment
Name | Type | Description |
---|---|---|
caption |
string |
Photo caption |
video_attachment
Name | Type | Description |
---|---|---|
caption |
string |
Video caption |
tour_attachment
Name | Type | Description |
---|---|---|
caption |
string |
Tour caption |
photo
Name | Type | Description |
---|---|---|
thumb_url |
string |
URL to the 150x150 image |
medium_square_url |
string |
URL to the 350x350 image |
large_url |
string |
URL to the large image (no wider than 800px and or taller than 600px, scaled proportionately) |
url |
string |
URL to the original image |
video
Name | Type | Description |
---|---|---|
image_thumb_url |
string |
URL to the 150x150 image |
image_medium_square_url |
string |
URL to the 350x350 image |
embed_url |
string |
Used for construction of the embed code. |
tour
Name | Type | Description |
---|---|---|
image_thumb_url |
string |
URL to the 150x150 image |
image_medium_square_url |
string |
URL to the 350x350 image |
embed_url |
string |
Used for construction of the embed code. |
optional_service_identifier
Name | Type | Description |
---|---|---|
code |
string |
The ATPCO optional services industry sub code associated with the UPA or UTA |
group_code |
string |
The ATPCO optional services industry group code associated with the sub code |
sub_group_code |
string |
The ATPCO optional services industry sub group code associated with the sub group |
Related articles