UTAs Examples

A Hub Backwards Compatible (UTAs and UPAs) endpoint request comprises a request header, a request parameter, and a request body. The request header contains information for partner authentication, API version, and language specification. It also specifies the host name for the application server, the endpoint name and the resources that represent the specific data sets to be returned by the request. The request parameter lists the categories to be returned. The request body contains information regarding the particular flight requested.

Request Header Example

(actual code text is below with explanations as # comments)

Copy
Copied
curl \
    # programming language used
"https://<ENDPOINT_URL?include=RESOURCES>" \
    # this URL includes the host server, the name of the endpoint and the // resources requested(See “Constructing Request URL” below)
-X POST \
    # should be POST, not GET
-H "x-api-key: <YOUR_API_KEY>" \
    # partner’s unique API key (for subscribed partners who do not yet
    # have an API key, please contact your ATPCO Sales Channel // Retailing manager)
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    # your access token, obtained within the last 60 minutes from the
    # Access Token API - see the "Authorization" documentation for 
    # more details
-H "Content-Type: application/vnd.routehappy+json" \
    # current version of the API
-H "Accept: application/vnd.routehappy+json" \
    # current version of the API
-H "Accept-language: <lc>" \
    # lc is the 2-character language code (ex. ‘en’ for English)
    # See Language section 4.1.5 for a full list of language codes 

Constructing Request URL

Your request URL (shown above as ENDPOINT_URL?include=RESOURCES) consists of the endpoint URL followed by a single query parameter: include.

The ENDPOINT_URL was communicated to you by ATPCO when you registered for the Routehappy API.

Resources

The include parameter accepts a comma-separated list of resources, as shown below. Your request can include any combination of these resources.

To access the most comprehensive and granular UTA data, all four of the below resources should be included in each UTA request.

Resource Purpose ATPCO Data Source
legs.change_policy Returns most granular possible data for Advance change category Fare Rules
legs.cancellation_policy Returns most granular possible data for Cancellation category Fare Rules
legs.leg_fares.utas Returns available branded fare data for all 10 UTA categories Branded Fares
legs.leg_fares.fare Returns branded fare name and/or brand code associated with provided fare basis code if legs.leg_fares.utas is also included in the request Branded Fares
attention

Since Fare Rules provide the most granular and specific data that is available, the data returned for the two “policy” resources should always be used even if data for any of those two categories is also returned from the legs.leg_fares.utas resource.


For example:

Copy
Copied
include=legs.change_policy,legs.cancellation_policy

Constructing Request Body

Requests to the Hub Backwards Compatible endpoint require a request body. The following example shows the parameters that can be included in the request body along with explanations for each parameter:

Copy
Copied
{
  "data":{
    "type":"legs_search",
    "attributes":{
      "fare_source": "<IC>",     
          // IC is IATA Code for the fare source/GDS (ex.‘1S’ for Sabre)
      "categories": "<CATEGORY-ID>",
          // CATEGORY-ID is an optional category ID to limit responses to a
          // specific category
      "legs":[
        {
          "segments": [
            {
              "dep": "<ADC>",  
                  // ADC is Airport Departure Code (ex.‘IAD’ for Dulles, VA)
                  // City code (ex. ‘NYC’ for all New York City airports)
                  // can be used, but airport-specific codes are preferable   
              "arr": "<AAC>",  
                  // AAC is Airport Arrival Code (ex.‘ATL’ for Atlanta, GA)
              "carrier": "<CC>",  
                  // CC is airline’s IATA Carrier Code (ex.‘DL’ for Delta)
              "flt_no": "<FN>",   
                  // FN is the Flight Number (ex.‘74’)
              "dep_date": "<YYYY-MM-DD>",  
                  // Date of Departure (ex.‘2019-08-16’ for August 16, 2019)
              "cabin_id": <C>,  
                  // C is Cabin ID, where 1=ECON 2=PREMECON 3=BUSINESS and 
                  // 4=FIRST
              "fare_basis_code": "<FAREBCOD>" 
                  // fare basis code (up to 8 characters)
            }
          ]
        }
      ]
    }
  }
}

Accessing content for all 10 UTA Categories

To access all UTA categories' data, list all four resources within the include parameter.

Copy
Copied
https://retailing.apis.atpco.net/routehappy/hub/legs_searches?include=legs.leg_fares.utas,legs.leg_fares.fare,legs.cancellation_policy,legs.change_policy

The example below shows a sample request and response sent to the above URL. The request body is included in the -d curl parameter. We’ve used a TAP Air Portugal flight in this example for illustration purposes.

Note: Please see notes included in the below UTA response, which highlight which data should ultimately take precedence, as outlined in the “Data Hierarchy” section above

attention

Click response below to see what this request might return.

requestresponse
Copy
Copied
curl \
"retailing.apis.atpco.net/routehappy/hub/legs_searches?include=legs.leg_fares.utas,legs.leg_fares.fare,legs.cancellation_policy,legs.change_policy" \
-X POST \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/vnd.routehappy+json" \
-H "Accept: application/vnd.routehappy+json" \
-H "Accept-language: en" \

-d ‘{
  "data":{
    "type":"legs_search",
    "attributes":{
      "fare_source": "1S",     
      "legs":[
        {
          "segments": [
            {
              "dep": "EWR",  
              "arr": "OPO",  
              "carrier": "TP",  
              "flt_no": "214",   
              "dep_date": "2020-07-15",  
              "cabin_id": 1,  
              "fare_basis_code": "UUSDSI0A" 
            }
          ]
        }
      ]
    }
  }
}
Copy
Copied
{
    "meta": {
        "not_matched_leg_indexes": []
    },
    "data": {
        "type": "legs_search",
        "id": "5625e6f8-3d9c-4b5a-a32e-ff467b9d5e0a",
        "relationships": {
            "legs": {
                "data": [
                    {
                        "type": "leg",
                        "id": "1",
                        "meta": {
                            "index": 0
                        }
                    }
                ]
            }
        }
    },
    "included": [
        {
            "type": "leg",
            "id": "1",
            "relationships": {
                "leg_fares": {
                    "data": [
                        {
                            "type": "leg_fare",
                            "id": "1|648"
                        }
                    ]
                },
                "cancellation_policy": {
                    "data": {
                        "type": "cancellation_policy",
                        "id": "1"
                    }
                },
                "change_policy": {
                    "data": {
                        "type": "change_policy",
                        "id": "1"
                    }
                }
            }
        },
        {
            "type": "cancellation_policy",
            "id": "1",
            "attributes": {
                "headline": "Non-refundable",
                "description": "Non-refundable",
                "assessment_code": "R",
                "fee": null
//PLEASE NOTE that the “cancellation_policy” data here is the data returned
//from ATPCO Fare Rules and therefore should take
//precedence over any other cancellation data in the Response
            }
        },
        {
            "type": "change_policy",
            "id": "1",
            "attributes": {
                "headline": "For $275",
                "description": "Change allowed for $275",
                "assessment_code": "R",
                "fee": {
                    "amount": 275,
                    "currency_code": "USD"
//PLEASE NOTE that the “change_policy” data here is the data returned
//from ATPCO Fare Rules and therefore should take
//precedence over any other advance change data in the Response
                }
            }
        },
        {
            "type": "uta",
            "id": "1|28141",
            "attributes": {
                "headline": "Not allowed",
                "description": "Change not allowed",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/913588b4-2fc8-4b87-833b-51660888de73/small/advance-change.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/913588b4-2fc8-4b87-833b-51660888de73/large/advance-change.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "advance-change"
//PLEASE NOTE that in this example, this data should be disregarded. This 
//data is sourced from Branded Fares, whereas the data returned for 
//“change_policy” is sourced from ATPCO Fare Rules and is therefore more 
//granular and includes fee data.
//The data returned for “advance-change” in this example is more restrictive 
//than the data returned for “change_policy”. This is because 
//“advance-change” returns the most restrictive rule associated with a group 
//of fares. “Change_policy” returns the rules associated with the exact fare 
//basis code that you provide in the request. “Advance-change” will not 
//always return more restrictive data, but “change-policy” (where available) 
//will always return the most specific and granular data.
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "2|508648",
            "attributes": {
                "headline": "Standard",
                "description": "Standard boarding",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/439acd24-dcd4-47d0-9c20-8b8c5f8e7b42/small/boarding-priority.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/439acd24-dcd4-47d0-9c20-8b8c5f8e7b42/large/boarding-priority.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "neutral",
                "categories": [
                    "boarding-priority"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "3|28143",
            "attributes": {
                "headline": "Non-refundable",
                "description": "Non-refundable",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/b4fdfb6b-c42e-4512-b7c1-4d8afdad3e67/small/cancellation.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/b4fdfb6b-c42e-4512-b7c1-4d8afdad3e67/large/cancellation.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "cancellation"
//PLEASE NOTE that in this example, this data should be disregarded. This 
//data is sourced from Branded Fares, whereas the data returned for 
//“cancellation_policy” is sourced from Fare Rules and 
//is therefore more granular and includes fee data.
//In this case, the data that is returned for “cancellation” is actually the 
//same as the data returned for “cancellation_policy”. However, this may not 
//always be the case. Data from “cancellation_policy” (where available) 
//should always take precedence over data from “cancellation”.
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "4|28132",
            "attributes": {
                "headline": "1 free & personal item",
                "description": "1 carry on bag & personal item",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/a27bfd4f-af60-415d-8b97-92b085383ced/small/carry-on-allowance.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/a27bfd4f-af60-415d-8b97-92b085383ced/large/carry-on-allowance.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "benefit",
                "categories": [
                    "carry-on-allowance"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "5|462983",
            "attributes": {
                "headline": "Standard",
                "description": "Standard check-in priority",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/be2de780-d07f-450d-ba1b-c99c8d3d7662/small/check-in-priority.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/be2de780-d07f-450d-ba1b-c99c8d3d7662/large/check-in-priority.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "neutral",
                "categories": [
                    "check-in-priority"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "6|28133",
            "attributes": {
                "headline": "For a fee",
                "description": "1st checked bag for a fee per passenger",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/611c8f26-5009-43b4-8fdb-d77ab81e592f/small/checked-bag-allowance.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/611c8f26-5009-43b4-8fdb-d77ab81e592f/large/checked-bag-allowance.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "fee",
                "categories": [
                    "checked-bag-allowance"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "7|28138",
            "attributes": {
                "headline": "For a fee",
                "description": "Lounge access for a fee",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/35139cf6-37da-4039-961c-7d19a7061fa8/small/lounge-access.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/35139cf6-37da-4039-961c-7d19a7061fa8/large/lounge-access.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "fee",
                "categories": [
                    "lounge-access"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "8|28142",
            "attributes": {
                "headline": "Not allowed",
                "description": "Same day change not allowed",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/cb7acfac-8a01-4139-88a9-f8873b2a29b1/small/same-day-change.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/cb7acfac-8a01-4139-88a9-f8873b2a29b1/large/same-day-change.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "same-day-change"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "9|28139",
            "attributes": {
                "headline": "Assigned or for a fee",
                "description": "Seat assigned or select anytime for a fee",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/f395409e-82c6-455b-9a6b-d538f3e990ad/small/seat-selection.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/f395409e-82c6-455b-9a6b-d538f3e990ad/large/seat-selection.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "seat-selection"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "uta",
            "id": "10|28144",
            "attributes": {
                "headline": "For a fee",
                "description": "Upgrade for a fee",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/07287ff1-30c5-43a4-b180-87474cbd2b48/small/upgrade-eligibility.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/07287ff1-30c5-43a4-b180-87474cbd2b48/large/upgrade-eligibility.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "fee",
                "categories": [
                    "upgrade-eligibility"
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "fare",
            "id": "648",
            "attributes": {
                "brand_name": "Discount",
                "brand_codes": [
                    "DISCOUNT"
                ]
            }
        },
        {
            "type": "leg_fare",
            "id": "1|648",
            "relationships": {
                "fare": {
                    "data": {
                        "type": "fare",
                        "id": "648"
                    }
                },
                "utas": {
                    "data": [
                        {
                            "type": "uta",
                            "id": "1|28141"
                        },
                        {
                            "type": "uta",
                            "id": "2|508648"
                        },
                        {
                            "type": "uta",
                            "id": "3|28143"
                        },
                        {
                            "type": "uta",
                            "id": "4|28132"
                        },
                        {
                            "type": "uta",
                            "id": "5|462983"
                        },
                        {
                            "type": "uta",
                            "id": "6|28133"
                        },
                        {
                            "type": "uta",
                            "id": "7|28138"
                        },
                        {
                            "type": "uta",
                            "id": "8|28142"
                        },
                        {
                            "type": "uta",
                            "id": "9|28139"
                        },
                        {
                            "type": "uta",
                            "id": "10|28144"
                        }
                    ]
                }
            }
        }
    ]
}

Accessing content for a single UTAs Category

You can specify Category ID in your request, which will limit which UTA categories are returned. Below, we list all Resources to include for each category type, which data to prioritize within each, as well as the Category ID that should be included to ensure that data for only the relevant category is returned.

For the Advance Change and Cancellation Categories

These two UTA categories are sourced from two different data sources within ATPCO: Fare Rules and Branded Fare data. Where available, the data from Fare Rules should take precedence over the data from Branded Fares.

In some cases, the data returned from Branded Fares will be more restrictive than data returned from Fare Rules. The data from Branded Fares reflects the most restrictive rules associated with a group of fares, whereas the data from Fare Rules reflects the rules associated with the exact fare basis code provided in the request.

Please see Implementation Notes below for guidance on which data to prioritize.

Advance Change

  • Resources: legs.change_policy,legs.leg_fares.utas,legs.leg_fares.fare
  • Category ID: advance-change

Implementation Notes: If data is returned for both legs.change_policy and advance-change, use the legs.change_policy data. If legs.change_policy does not return data, then use the data returned from advance-change.

Cancellation

  • Resources: legs.cancellation_policy,legs.leg_fares.utas,legs.leg_fares.fare
  • Category ID: cancellation

Implementation Notes: If data is returned for both legs.cancellation_policy and cancellation, use the legs.cancellation_policy data. If legs.cancellation_policy does not return data, then use the data returned from cancellation.

For the remaining 8 UTAs Categories

Data from these 8 categories is sourced only from Branded Fares data. Airlines are not required to file data for all categories when filing Branded Fares, so category coverage will vary by airline. To see a full breakdown of coverage by category by airline, please see our Coverage page.

Listed below are the resources that should be included in your request URL. We also provide Category ID, which should be included in the body of your request to ensure that you only receive data back for the categories relevant to your use case.

UTA Category Resources Category ID
Same-day change legs.leg_fares.utas,legs.leg_fares.fare same-day-change
Seat selection legs.leg_fares.utas,legs.leg_fares.fare seat-selection
Check-in priority legs.leg_fares.utas,legs.leg_fares.fare check-in-priority
Boarding priority legs.leg_fares.utas,legs.leg_fares.fare boarding-priority
Upgrade eligibility legs.leg_fares.utas,legs.leg_fares.fare upgrade-eligibility
Lounge access legs.leg_fares.utas,legs.leg_fares.fare lounge-access
Checked baggage legs.leg_fares.utas,legs.leg_fares.fare checked-bag-allowance
Carry-on baggage legs.leg_fares.utas,legs.leg_fares.fare carry-on-allowance

Example 1: Advance Change

The example below shows a full UTA Request and Response pair for the Advance Change category. We’ve used a TAP Air Portugal flight in this example for illustration purposes.

attention

Click response below to see what this request might return.

requestresponse
Copy
Copied
curl \
"retailing.apis.atpco.net/routehappy/hub/legs_searches?include=legs.leg_fares.utas,legs.leg_fares.fare,legs.change_policy” \
-X POST \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/vnd.routehappy+json" \
-H "Accept: application/vnd.routehappy+json" \
-H "Accept-language: en" \

-d ‘{
  "data":{
    "type":"legs_search",
    "attributes":{
      "fare_source": "1S",
  “categories”: “advance-change”,     
      "legs":[
        {
          "segments": [
            {
              "dep": "EWR",  
              "arr": "OPO",  
              "carrier": "TP",  
              "flt_no": "214",   
              "dep_date": "2020-07-15",  
              "cabin_id": 1,  
              "fare_basis_code": "UUSDSI0A" 
            }
          ]
        }
      ]
    }
  }
}
Copy
Copied
{
    "meta": {
        "not_matched_leg_indexes": []
    },
    "data": {
        "type": "legs_search",
        "id": "be8eb1ac-3f2a-4c30-ad92-9126acc1b056",
        "relationships": {
            "legs": {
                "data": [
                    {
                        "type": "leg",
                        "id": "1",
                        "meta": {
                            "index": 0
                        }
                    }
                ]
            }
        }
    },
    "included": [
        {
            "type": "leg",
            "id": "1",
            "relationships": {
                "leg_fares": {
                    "data": [
                        {
                            "type": "leg_fare",
                            "id": "1|648"
                        }
                    ]
                },
                "change_policy": {
                    "data": {
                        "type": "change_policy",
                        "id": "1"
                    }
                }
            }
        },
        {
            "type": "change_policy",
            "id": "1",
            "attributes": {
                "headline": "For $275",
                "description": "Change allowed for $275",
                "assessment_code": "R",
                "fee": {
                    "amount": 275,
                    "currency_code": "USD"
//PLEASE NOTE that the “change_policy” data here is the data returned
//from ATPCO Fare Rules and therefore should take
//precedence over any other advance change data in the Response
                }
            }
        },
        {
            "type": "uta",
            "id": "1|28141",
            "attributes": {
                "headline": "Not allowed",
                "description": "Change not allowed",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/913588b4-2fc8-4b87-833b-51660888de73/small/advance-change.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/913588b4-2fc8-4b87-833b-51660888de73/large/advance-change.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "advance-change"
//PLEASE NOTE that in this example, this data should be disregarded. This 
//data is sourced from Branded Fares, whereas the data returned for 
//“change_policy” is sourced from ATPCO Fare Rules and is therefore more 
//granular and includes fee data.
//The data returned for “advance-change” in this example is more restrictive 
//than the data returned for “change_policy”. This is because 
//“advance-change” returns the most restrictive rule associated with a group 
//of fares. “Change_policy” returns the rules associated with the exact fare 
//basis code that you provide in the request. “Advance-change” will not 
//always return more restrictive data, but “change-policy” (where available) 
//will always return the most specific and granular data
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "fare",
            "id": "648",
            "attributes": {
                "brand_name": "Discount",
                "brand_codes": [
                    "DISCOUNT"
                ]
            }
        },
        {
            "type": "leg_fare",
            "id": "1|648",
            "relationships": {
                "fare": {
                    "data": {
                        "type": "fare",
                        "id": "648"
                    }
                },
                "utas": {
                    "data": [
                        {
                            "type": "uta",
                            "id": "1|28141"
                        }
                    ]
                }
            }
        }
    ]
}

Example 2: Seat Selection

The example below shows a full UTA Request and Response pair for the Seat Selection category. We’ve used a TAP Air Portugal flight in this example for illustration purposes.

attention

Click response below to see what this request might return.

requestjson
Copy
Copied
curl \
"retailing.apis.atpco.net/routehappy/hub/legs_searches?include=legs.leg_fares.utas,legs.leg_fares.fare” \
-X POST \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/vnd.routehappy+json" \
-H "Accept: application/vnd.routehappy+json" \
-H "Accept-language: en" \

-d ‘{
  "data":{
    "type":"legs_search",
    "attributes":{
      "fare_source": "1S",
  “categories”: “seat-selection”,     
      "legs":[
        {
          "segments": [
            {
              "dep": "EWR",  
              "arr": "OPO",  
              "carrier": "TP",  
              "flt_no": "214",   
              "dep_date": "2020-07-15",  
              "cabin_id": 1,  
              "fare_basis_code": "UUSDSI0A" 
            }
          ]
        }
      ]
    }
  }
}
Copy
Copied
{
    "meta": {
        "not_matched_leg_indexes": []
    },
    "data": {
        "type": "legs_search",
        "id": "4c608ab0-b129-4ee6-9bf9-55bab6d7d805",
        "relationships": {
            "legs": {
                "data": [
                    {
                        "type": "leg",
                        "id": "1",
                        "meta": {
                            "index": 0
                        }
                    }
                ]
            }
        }
    },
    "included": [
        {
            "type": "leg",
            "id": "1",
            "relationships": {
                "leg_fares": {
                    "data": [
                        {
                            "type": "leg_fare",
                            "id": "1|648"
                        }
                    ]
                }
            }
        },
        {
            "type": "uta",
            "id": "1|28139",
            "attributes": {
                "headline": "Assigned or for a fee",
                "description": "Seat assigned or select anytime for a fee",
                "small_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/f395409e-82c6-455b-9a6b-d538f3e990ad/small/seat-selection.png?channel_id=ot5j870v",
                "large_icon_url": "https://d13cihc9138cdj.cloudfront.net/icons/f395409e-82c6-455b-9a6b-d538f3e990ad/large/seat-selection.png?channel_id=ot5j870v",
                "cta_text": null,
                "cta_url": null,
                "assessment": "restriction",
                "categories": [
                    "seat-selection"
//PLEASE NOTE: This is the Seat Selection data to display. There is no 
//hierarchy in the data to be aware of since the data in this case comes only 
//from Branded Fares data.
                ],
                "fees": [],
                "bag_limits": {
                    "weight_kg": null,
                    "size_lcm": null
                }
            }
        },
        {
            "type": "fare",
            "id": "648",
            "attributes": {
                "brand_name": "Discount",
                "brand_codes": [
                    "DISCOUNT"
                ]
            }
        },
        {
            "type": "leg_fare",
            "id": "1|648",
            "relationships": {
                "fare": {
                    "data": {
                        "type": "fare",
                        "id": "648"
                    }
                },
                "utas": {
                    "data": [
                        {
                            "type": "uta",
                            "id": "1|28139"
                        }
                    ]
                }
            }
        }
    ]
}