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

Pricing Confirmation & Token Lifecycle

Last updated: 2026-02-13

Pricing Confirmation & Token Lifecycle

Hotel prices are dynamic — they can change between the time a guest views availability and the time they decide to book. The pricing confirmation step locks in a rate and returns a new token that's valid for booking. This article explains the two-token flow, why it matters, and how to handle token expiration.

Why Two Tokens?

The booking flow uses two sequential tokens:

  1. Availability Token — Obtained from the Check Availability endpoint. Identifies a specific room, rate, and bed configuration. This token is not a price guarantee.
  2. Pricing Token — Obtained from the Confirm Price endpoint (this article). Locks in the exact price for up to 10 minutes. This is the token you use for booking.

Important: You must not use the availability token directly for booking. Always call the pricing confirmation endpoint first to get a pricing token. Attempting to book with an availability token will fail.

Token Flow Diagram

Check Availability    ↓availabilitytoken  (identifies room/rate — price may change)    ↓Confirm Price    ↓pricingtoken  (locked price — valid for 10 minutes)    ↓SSO Checkout / Create Booking

*

Confirm Price Endpoint

Endpoint

GET /hotels/api/v2/properties/price?availability_token={token}&currency={currency}

Query Parameters

ParameterTypeRequiredDescription
availabilitytokenstringYesThe availabilitytoken from rates[].beds[].availability_token in the availability response.
currencystringNoCurrency for the quoted price. Default: USD.

Example Request

GET /hotels/api/v2/properties/price?availabilitytoken=eyJhbGciOiJIUzI1NiJ9.room101...&currency=USDAuthorization: {signature}x-correlation-id: {correlationid}Content-Type: application/json

Example Response

JSON
{
  "data": {
    "total_price": 891.08,
    "base_price": 756,
    "taxes": 95.08,
    "fees": 40,
    "currency": "USD",
    "pricingtoken": "eyJhbGciOiJIUzI1NiJ9.pricingfinal..."
  }
}

Response Fields

FieldTypeDescription
totalpricenumberFinal total price including all taxes and fees.
basepricenumberRoom rate before taxes and fees.
taxesnumberTax amount.
feesnumberService and booking fees.
currencystringCurrency code for the quoted price.
pricing_tokenstringThe token to use for booking. This is a new token, different from the availability token you sent in.

Key point: The pricingtoken in the response is a new, different token from the availabilitytoken you provided in the request. You must use this new pricing_token for the SSO checkout or booking step.

*

Token Lifecycle & Expiration

Availability Token

  • Source: rates[].beds[].availability_token from the availability response.
  • Validity: Short-lived. Availability and prices can change at any time.
  • Usage: Pass to the pricing confirmation endpoint only.
  • Recommendation: Confirm pricing as soon as the guest selects a room. Don't cache availability tokens for extended periods.

Pricing Token

  • Source: pricing_token from the pricing confirmation response.
  • Validity: 10 minutes from the time it was issued.
  • Usage: Pass to the SSO checkout URL or the booking creation endpoint.
  • On expiration: If the token expires before the guest completes checkout, you must repeat the availability check and pricing confirmation to obtain a new token.

Handling Expired Tokens

If a pricing token has expired (more than 10 minutes since confirmation), the booking or checkout will fail. Handle this gracefully:

  1. Track when the pricing token was issued (store a timestamp alongside it).
  2. Before generating a checkout URL, check whether the token is still within its 10-minute window.
  3. If expired, transparently re-run the availability check and price confirmation before presenting the checkout link.
  4. Inform the guest if the price has changed between confirmations.

Example: Token Expiry Check (JavaScript)

function isPricingTokenValid(tokenIssuedAt) {  const TENMINUTESMS = 10  60  1000;  return (Date.now() - tokenIssuedAt) < TENMINUTESMS;}

// Before booking:if (!isPricingTokenValid(session.priceLockedAt)) { // Re-run availability check → confirm price → get new token const availability = await checkAvailability(hotelId, dates, occupancy); const pricing = await confirmPrice(availability.token); session.pricingToken = pricing.pricingToken; session.priceLockedAt = Date.now();}

*

Price Changes Between Steps

It's possible for the confirmed price to differ from the initial rate shown during the hotel search or availability check. This can happen due to:

  • Dynamic pricing — Rates adjust based on real-time demand.
  • Currency fluctuations — If displaying prices in a non-default currency.
  • Limited inventory — The originally shown rate may have sold out, resulting in a different rate tier.

Always display the confirmed price from the pricing endpoint as the final price the guest will pay. The pricing confirmation response is the source of truth.

*

Summary: What to Store at Each Step

StepValues to Store
Check Availabilityroom.id, rates[].beds[].availabilitytoken, propertyid
Confirm Pricepricingtoken, totalprice, timestamp of when the token was issued
SSO CheckoutUse the pricingtoken + room.id + propertyid to build the URL

*
](#article-6)_

Was this article helpful?