Getting Started with the Xeni Activities APIHow to Book an ActivityHow to Browse Activity Tags and CategoriesHow to Cancel an Activity BookingHow to Check Activity AvailabilityHow to Get Activity DetailsHow to Retrieve Activity Booking DetailsHow to Search for Activities with FiltersHow to Search for Activity DestinationsCar Rental API - Getting StartedCar Rental API - Understanding Response FieldsHow to Book a Car RentalHow to Get Rental Car Details and Equipment Add-OnsHow to Retrieve or Cancel a Car Rental BookingHow to Search for Available Rental CarsHow to Search for Pickup LocationsHow to Use Car Rental Search FiltersDeals API Best Practices for IntegrationDeals API Frequently Asked QuestionsGetting Started with the Xeni Deals APIDeals API Request Parameters and Headers ReferenceDeals API Supported Currencies and LocalizationHow to Display Deals in Your ApplicationHow to Fetch Hotel Deals by LocationFlights API Error Codes and TroubleshootingGetting Started with the Xeni Flights APIHow to Book a FlightHow to Check Flight Availability and PricingHow to Confirm or Cancel a Flight BookingHow to Retrieve Fare Rules for a FlightHow to Retrieve Flight Booking DetailsHow to Search for Airports Using AutocompleteHow to Search for FlightsHow to Use Flight Search Filters, Sorting, and PaginationHow to Check Room Availability and PricingHow to Filter Vacation Rental ResultsHow to Get Resort Property Details, Amenities, and AccessibilityHow to Hold and Confirm a Resort BookingHow to Release a Resort HoldHow to Retrieve Resort Booking DetailsHow to Search for Available ResortsHow to Search for Resort DestinationsHow to Search for Vacation Rental LocationsHow to Search for Vacation RentalsHow to Use Resort Search Filters and SortingGetting Started with the Xeni Resorts APIResorts API: Understanding Booking Statuses and PoliciesGetting Started with the Vacation Rentals APIVacation Rentals Frequently Asked QuestionsVacation Rentals Supported Property TypesUnderstanding Async Search for Vacation RentalsAuthentication & API SignaturesBooking Hotels — Direct API & SSO CheckoutError Handling, Rate Limits & Best PracticesGetting Started with the Xeni Hotels APIManaging Bookings: Status, Retrieval & CancellationPricing Confirmation & Token LifecycleRetrieving Hotel Details & Room AvailabilitySearching for Hotels: Locations, Filters & PaginationSearching for HotelsSession Management & Correlation IDsAPI authentication and getting your API keys

Getting Started with the Xeni Hotels API

Last updated: 2026-02-13

Getting Started with the Xeni Hotels API

The Xeni Hotels API gives you programmatic access to over 2 million hotel properties worldwide. With a single integration, you can search for hotels, check real-time availability and pricing, and complete bookings entirely via API — all through a clean, RESTful interface.

What You Can Do

The Hotels API v2 supports the full booking lifecycle:

  • Search locations — Autocomplete city, region, or specific hotel names and retrieve geographic coordinates.
  • Search hotels — Query available properties by location, dates, occupancy, star ratings, amenities, and price range.
  • Get hotel details — Retrieve full property information including photos, amenities, policies, and guest reviews.
  • Check room availability — View available room types with real-time pricing for specific dates and guest counts.
  • Confirm pricing — Lock in a rate for up to 10 minutes and receive a final pricing token.
  • Create bookings — Book programmatically via the API using your own payment processor, Xeni's merchant, or by redirecting guests to Xeni's hosted SSO checkout page.
  • Manage bookings — Retrieve booking details and process cancellations by booking ID.

Environments

EnvironmentBase URLPurpose
UAT (Sandbox)https://uat.travelapi.aiDevelopment and testing. No real bookings are created.
Productionhttps://api.travelapi.aiLive environment. Real bookings with real charges.

We recommend building and testing your integration against the UAT environment before switching to production. The API surface is identical across both environments.

API Versioning

All hotel endpoints use the v2 path prefix. For example:

GET  /hotels/api/v2/autocompletePOST /hotels/api/v2/propertiesGET  /hotels/api/v2/property/{propertyid}POST /hotels/api/v2/properties/availabilityGET  /hotels/api/v2/properties/pricePOST /hotels/api/v2/bookingsGET  /hotels/api/v2/bookings/{bookingid}PATCH /hotels/api/v2/bookings/{booking_id}

Prerequisites

Before you begin, you'll need:

  1. API Key — Your unique API key, provided during onboarding.
  2. API Secret — Your secret key, used alongside the API key to generate authentication signatures.

If you haven't received your credentials yet, contact your Xeni account representative.

Quick Start: Your First Hotel Search

Here's the minimum flow to search for hotels. Each step is covered in detail in subsequent articles.

Step 1 — Authenticate

Generate a signature by calling the authentication endpoint with your API key, secret, and a Unix timestamp.

POST /identity/v2/auth/generate

{ "api_key": "your-api-key", "secret": "your-api-secret", "timestamp": 1700000000}

// Response{ "signature": "eyJhbGciOi..."}

The signature is valid for 30 minutes. Include it in the Authorization header of all subsequent requests.

Step 2 — Search for a Location

Use the autocomplete endpoint to resolve a destination name to coordinates.

GET /hotels/api/v2/autocomplete?key=Miami

// Response{ "data": [ { "id": "12345", "name": "Miami", "full_name": "Miami, Florida, United States", "country": "United States", "state": "Florida", "location": { "lat": 25.7617, "long": -80.1918 } } ]}

Important: The response headers will include an x-correlation-id. Save this value — it must be passed in the headers of all subsequent API calls within this search session.

Step 3 — Search Hotels

Using the coordinates and correlation ID from the previous step, search for available hotels.

POST /hotels/api/v2/properties?page=1&limit=20

Headers: Authorization: {signature} x-correlation-id: {correlation_id}

{ "checkindate": "2025-03-15", "checkoutdate": "2025-03-18", "occupancy": [ { "adults": 2, "childs": 0, "childages": [] } ], "lat": 25.7617, "long": -80.1918, "countryofresidence": "US", "sort": [{ "key": "price", "order": "asc" }], "filters": { "ratings": [] }, "is_async": false}

// Response{ "data": { "total": 321, "hotels": [ { "propertyid": "XN00012345", "name": "Oceanview Resort & Spa", "ratings": { "starrating": 4, "userrating": 8.5 }, "rate": { "baserate": 189.00, "totalrate": 567.00, "currency": "USD", "taxandfees": 63.50 }, "amenities": ["Free WiFi", "Pool", "Spa"], "image": { "large": "https://..." }, "contact": { "address": { "line1": "123 Ocean Drive", "city": "Miami Beach", "state": "FL", "postal_code": "33139" } } } ] }}

What's Next?

From here, the typical flow continues with:

  1. Retrieving hotel details for a specific property
  2. Checking room availability to see room types and real-time pricing
  3. Confirming the price to lock in a rate
  4. Completing the booking — via direct API call (with your own or Xeni's payment processor) or by redirecting the guest to Xeni's SSO checkout page

Content Type & Headers

All requests should include the following headers:

HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationYour API signatureYes
x-correlation-idCorrelation ID from initial API responseAfter first call

Response Format

All API responses return JSON. Successful responses wrap their payload in a data property:

JSON
{  "data": { ... }}

Error responses follow a consistent structure:

JSON
{
  "message": "Description of the error",
  "status": 400
}

*
](#article-2)_

Was this article helpful?