Getting Started
This section will introduce you to all the information that you are going to need in order to start your integration. You will be given access to all the resources detailed in this section as soon as your registration has been completed.
Information you will need
Test environment URL: https://testapijson.stuba.com/
Live environment URL: Live URL will be provided once the certification process has been successfully completed.
Credentials:
Login details for an agency user – these have 2 parts: an AuthApiKey and IP address .
- AuthApiKey: <AuthApiKey>
- Your whitelisted IP address.
Note: If not already shared with Stuba, please email to a list of your IP addresses to techsupport@stuba.com
Currency
The currency configured for your agency will be displayed in each response. Integrators should note that all rates will appear in the default currency associated with your Stuba account.
How to send JSON requests
To communicate with the Stuba API Service, use an HTTP POST request. The JSON payload should be sent in the body, while the authentication key (AuthApiKey) must be included in the header.
POST https://{{URL}}/ [Endpoint]
Headers:
Content-Type: application/json
AuthApiKey: <Your AuthApiKey>
Accept-Encoding: gzip,br
Body:
{JSON payload}
Supported Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| POST | /HotelSearch | Hotel-wise search |
| POST | /RegionSearch | Region-wise search |
| POST | /BookingPrepare | Re-fresh quote |
| POST | /BookingConfirm | Booking Create |
| POST | /BookingCancel | Booking Cancel |
| POST | /BookingQuery | Retrieval of an existing booking |
| POST | /BookingHCNQuery | Customer to retrieve the Hotel Confirmation Number for their bookings |
HTTP compression
The Stuba API Service Interface supports HTTP 1.1 compression.
Clients must take advantage of compression by ensuring that requests to the interface specify the HTTP header: Accept-Encoding: gzip, br. If this is specified on any request, then the corresponding response will be returned in a compressed format.
This header must be specified for all requests, as it is mandatory. Enabling this header provides significant performance improvements, particularly for large availability searches.
API key tokenization
Stuba uses API key tokenization for authorization. Every request must include a valid API key in the request header.
Request Format
Here is the general structure of an authorized HTTP POST request:
POST [API Endpoint]
Content-Type: application/json
AuthApiKey: [Your AuthApiKey]
Accept-Encoding: gzip,br
[API Endpoint] – Replace with the specific endpoint for the operation you are calling (e.g., RegionSearch, HotelSearch, etc.).
Ensure that the Content-Type header is always set to application/json, and the request body has the proper JSON payload for the selected operation.