Skip to main content

First Request

This guide takes you from client credentials to your first filtered cruise search in the development environment.

Prerequisites​

Required​

  • Client ID
  • Client Secret
  • A POSIX-compatible shell, such as bash or zsh
  • curl
  • jq

1. Get a token​

Exchange your credentials for an access token, as described in Authentication.

Set your Client ID and request a token:

export CLIENT_ID="your_client_id"

export ACCESS_TOKEN=$(curl -s -u "$CLIENT_ID" \
-d grant_type=client_credentials \
https://connect-dev.tstllc.net/oauth2/token | jq -r .access_token)

When prompted by curl, enter your Client Secret.

The token is valid for one hour and will be used in the requests below. If you receive a 4XX error at any point, see When something is rejected.

The most basic search request sends an empty JSON body ({}), which applies no filters:

curl https://connect-dev.tstllc.net/shop/v1/cruise \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Results are sorted by ascending price, so the first result is the cheapest sailing available. An abridged response looks like this:

{
"searchDeeplink": "https://travel.tstllc.net/cruise/cruises?...",
"results": [
{
"inventoryName": "Vancouver to Seattle",
"inventoryId": "5c6269d1d1f70ee9bb5ee4eb8b209045",
"resultDeeplink": "https://travel.tstllc.net/cruise/cruises/5c6269d1d1f70ee9bb5ee4eb8b209045/sailings?...",
"price": { "amount": 109, "currency": "USD" },
"vendor": { "code": "NC", "name": "Norwegian Cruise Line" },
"origin": "Vancouver, British Columbia, Canada",
"destinations": ["Vancouver, Canada", "Seattle, Washington"],
"duration": 1,
"departures": { "count": 1, "dates": ["2028-04-15"] }
}
]
}
  • resultDeeplink: Sends a traveler directly to book that specific sailing.
  • searchDeeplink: Sends a traveler to the full search results page on the TST-hosted site.

3. Apply filters​

To narrow down your search, first call the /meta endpoint to retrieve the list of currently available filter options:

curl https://connect-dev.tstllc.net/shop/v1/cruise/meta \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

An abridged /meta response returns the valid filter parameters and their allowedValues:

{
"parameters": [
{
"name": "destinations",
"label": "Port of Call",
"kind": "enum",
"multiSelect": true,
"allowedValues": [
{ "value": "Aalborg, Denmark", "label": "Aalborg, Denmark" },
{ "value": "Boston, Massachusetts", "label": "Boston, Massachusetts" },
{ "value": "San Diego, California", "label": "San Diego, California" }
]
},
{
"name": "vendors",
"label": "Cruise Line",
"kind": "enum",
"multiSelect": true,
"allowedValues": [
{ "value": "CV", "label": "Carnival" },
{ "value": "RC", "label": "Royal Caribbean" },
{ "value": "SB", "label": "Seabourn" },
{ "value": "VO", "label": "Viking Ocean Cruises" },
{ "value": "VR", "label": "Viking River Cruises" }
]
},
{ "name": "duration", "label": "Duration", "kind": "range", "min": "1", "max": "181" }
],
"productSpecificFilters": [
{
"name": "ships",
"label": "Ship",
"kind": "enum",
"multiSelect": true,
"allowedValues": [
{ "value": "RC:AD", "label": "Adventure of the Seas" },
{ "value": "RC:AL", "label": "Allure of the Seas" }
]
}
]
}

Using values from that response, we can search for "Any Royal Caribbean or Carnival cruises that visit Boston":

curl https://connect-dev.tstllc.net/shop/v1/cruise \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vendors": ["RC", "CV"],
"destinations": [{
"type": "named",
"name": "Boston, Massachusetts"
}]
}'

Congrats! You have successfully run your first filtered cruise search.

Next steps​