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

Managing Bookings: Status, Retrieval & Cancellation

Last updated: 2026-02-13

Managing Bookings: Status, Retrieval & Cancellation

After a booking is created, you can retrieve its details and process cancellations through the Xeni Hotels API. This article covers the booking management endpoints and the booking statuses you'll encounter.

Retrieve Booking Details

Endpoint

GET /hotels/api/v2/bookings/{booking_id}

Path Parameters

ParameterTypeRequiredDescription
booking_idstringYesThe booking ID returned when the booking was created.

Headers

HeaderRequiredDescription
AuthorizationYesValid API signature.
x-correlation-idYesCorrelation ID from the session that created the booking.

Example Request

GET /hotels/api/v2/bookings/XENI-1700000000-ABC123DEFAuthorization: {signature}x-correlation-id: {correlation_id}Content-Type: application/json

Example Response

JSON
{
  "data": {
    "booking_id": "XENI-1700000000-ABC123DEF",
    "confirmation_number": "HTL-98765",
    "booking_status": "confirmed",
    "property": {
      "property_id": "XN00012345",
      "name": "Oceanview Resort & Spa"
    },
    "guest": {
      "title": "Mr",
      "first_name": "John",
      "last_name": "Smith",
      "email": "john.smith@example.com",
      "phone": {
        "country_code": "1",
        "number": "5551234567"
      }
    },
    "room": {
      "name": "Deluxe Ocean View King",
      "check_in": "2025-06-01",
      "check_out": "2025-06-05"
    },
    "pricing": {
      "total_price": 891.08,
      "base_price": 756,
      "taxes": 95.08,
      "fees": 40,
      "currency": "USD"
    },
    "cancellation_policy": "Free cancellation until 48 hours before check-in.",
    "created_at": "2025-05-20T14:30:00Z"
  }
}

*

Note: For full details on creating bookings (direct API and SSO checkout), see Booking Hotels — Direct API & SSO Checkout.

*

Cancel a Booking

Endpoint

PATCH /hotels/api/v2/bookings/{booking_id}

Request Body

FieldTypeRequiredDescription
booking_statusstringYesSet to "CANCELLED" to cancel the booking.

Example Request

PATCH /hotels/api/v2/bookings/XENI-1700000000-ABC123DEFAuthorization: {signature}x-correlation-id: {correlation_id}Content-Type: application/json

{ "booking_status": "CANCELLED"}

Example Response

JSON
{
  "status": "success",
  "message": "Booking cancelled successfully",
  "data": {
    "booking_id": "XENI-1700000000-ABC123DEF",
    "booking_status": "CANCELLED"
  }
}

Important: Cancellation fees may apply depending on the rate's cancellation policy. Always check the cancellation_policy and refundable fields from the availability response before cancelling. Non-refundable bookings may not be eligible for cancellation, or may incur a full charge.

*

Booking Statuses

The booking_status field indicates the current state of a booking:

StatusDescription
confirmedThe booking is confirmed and the reservation is active.
CANCELLEDThe booking has been cancelled.
pendingThe booking is being processed. Check back shortly.

*

Booking ID Format

When creating bookings via the direct API, you supply your own booking_id. We recommend a format that includes:

  • A recognizable prefix (e.g., XENI-)
  • A timestamp or sequential identifier
  • A random suffix for uniqueness

Example

XENI-1700000000-ABC123DEF

The API will also return a confirmation_number — this is a separate identifier generated by the hotel or supplier, and may be needed for check-in.

*

Best Practices

  • Store both IDs: Save both the bookingid and the confirmationnumber. The booking ID is for API lookups; the confirmation number may be needed at the hotel.
  • Check cancellation policy before booking: Display the cancellation terms to the guest during the booking flow. This sets expectations and reduces disputes.
  • Handle lookup failures gracefully: If a booking isn't found by ID, it may be because the session or correlation ID has expired. Prompt the user to verify the booking ID.
  • Keep a local record: For audit and support purposes, persist booking details in your own database alongside the Xeni booking data.
* ](#article-8)_

Was this article helpful?