Sample Communication
A ready-to-use Postman collection is provided so you can explore the SwOTA REST API and Flat File endpoints interactively. The collection includes automated test scripts that extract values from responses and pass them to subsequent requests, letting you run a full booking flow end-to-end.
Important
Download the Postman Collection — download this file first, then follow the import steps below.
Importing the Collection
- Download the collection file using the link above.
- Open Postman and click Import (top-left).
- Drag and drop the downloaded file or use Upload Files to select it.
- The collection SwOTA/Flat files will appear in your sidebar.
Collection Variables
The collection ships with variables that every request references. Before sending requests, open the collection's Variables tab and fill in the values provided to you during onboarding.
| Variable | Description |
|---|---|
AUTH0_TOKEN_URL |
Your Auth0 token endpoint |
AUTH0_CLIENT_ID |
OAuth client ID |
AUTH0_CLIENT_SECRET |
OAuth client secret |
AUTH0_AUDIENCE |
OAuth audience (e.g. https://partner.travelhx.com/api) |
API_BASE |
Base URL for the Partner API (e.g. https://partner.travelhx.com/api/v1) |
REST_BASE_URL |
Base URL for the SwOTA REST API (e.g. https://bookings.sw.travelhx.com/ota/rest/) |
AGENCY_ID |
Your agency identifier |
USER_KEY |
Your API user key |
POS_XML |
Point of Sale XML block injected into every SwOTA request (pre-filled, adjust ID to match your agency). See Point of Sale |
The remaining variables (BEARER_TOKEN, VOYAGE_ID, PRICED_CATEGORY_CODE, CABIN_NUMBER, CABIN_STATUS, etc.) are populated automatically by the test scripts as you execute requests.
Collection Structure
1. Get OAuth Token
Before calling any API, run the Get OAuth Token (client_credentials) request. It posts your client credentials to Auth0 and the test script automatically saves the returned access_token into the BEARER_TOKEN variable. All subsequent requests use this token via the Authorization: Bearer {{BEARER_TOKEN}} header. For more details on authentication setup, see API Protocols.
2. SwOTA REST API
The SwOTA folder contains a sequence of requests that walk through a typical booking flow as described in the Shopping Flow guide. They are designed to be executed in order — each step's test script extracts values needed by the next step.
| # | Request | Auto-extracted Variables |
|---|---|---|
| 1 | OTA_PingRQ | (none — connectivity check) |
| 2 | OTA_CruiseSailAvailRQ | VOYAGE_ID |
| 3 | OTA_CruiseCategoryAvailRQ | PRICED_CATEGORY_CODE |
| 4 | OTA_CruiseCabinAvailRQ | CABIN_NUMBER, CABIN_STATUS |
| 5 | OTA_CruisePriceBookingRQ | (none) |
| 6 | OTA_CruiseBookRQ | (none) |
How it works:
- Step 1 sends a simple ping to verify connectivity and authentication. No variables are extracted.
- Step 2 searches for available sailings in a date range and saves the first
VoyageIDfrom the response. See Sailing Availability. - Step 3 uses
{{VOYAGE_ID}}to query category availability and extracts thePricedCategoryCodefrom theBESTPRICEfare. See Category Availability. - Step 4 uses
{{VOYAGE_ID}}and{{PRICED_CATEGORY_CODE}}to list available cabins and saves the first cabin's number and status. See Cabin Availability. - Step 5 uses all previously collected variables to get detailed pricing. See Booking Pricing.
- Step 6 creates the booking with guest details. See Storing a Booking.
Tip
You can run the entire SwOTA folder at once with Postman's Collection Runner (Run collection button). It will execute all requests in order and show pass/fail results for each test script.
3. Flat Files
The Download Flatfiles request fetches flat-file data as a .zip archive. For details on flat file contents, see the Flat Files API. To save the response:
- Send the request.
- Click Save Response > Save to a file and give it a
.zipextension.
The pre-request script sets a CACHE_BUST timestamp parameter to bypass any CDN or proxy caching.
Customizing Requests
All SwOTA requests send XML bodies with the Content-Type: application/xml header. The {{POS_XML}} variable is injected into each request body to supply the Point of Sale block. To adjust it for your agency, edit the POS_XML collection variable — specifically the ID attribute on the RequestorID element.
Date ranges, guest counts, and other parameters can be modified directly in each request's body tab.
Related Documentation
- Sample Requests — XML request/response examples for each API message
- API Protocols — REST vs SOAP protocol details
- Seaware OTA Basics — Core API concepts