Table of Contents

Ports file

GET /portsmarket not required (this is global data; the market parameter has no effect).

A JSON array mapping port/location codes to a country and a display name. Use it to resolve the DeparturePort and ArrivalPort codes in the voyages file. This is static reference data that changes rarely.

curl --location 'https://bookings.sw.travelhx.com/ports' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Fields

Field Type Description
code string Port/location code; the join key to voyages[].DeparturePort / voyages[].ArrivalPort. Mostly UN/LOCODE-style 5-character codes, but some legacy 3-character codes remain (^[A-Z0-9]{3,5}$). E.g. USOME, SJLYR, ZZATS, PUQ.
country string ISO 3166-1 alpha-2 country code (^[A-Z]{2}$). ZZ is the placeholder for the non-country "At Sea" entry. E.g. IS, SJ, EC, AQ, ZZ.
description string Human-readable port/location name. E.g. Heimaey, Longyearbyen, At Sea.
Warning

Some entries are deactivation markers, not real port names. Their description may be DO NOT USE IT, TO DELETE, or a name suffixed with - old code. Filter these out before showing the list to end users — but keep them in your lookup so you can still resolve historical codes that may appear in older data.

Note

Only DeparturePort / ArrivalPort in the voyages file are port codes. The itinerary[].location field is free-text day copy and does not join here.

Example

[
  { "code": "USOME", "country": "US", "description": "Nome" },
  { "code": "SJLYR", "country": "SJ", "description": "Longyearbyen" },
  { "code": "ZZATS", "country": "ZZ", "description": "At Sea" }
]