Skip to main content

Overview

The Stays API provides a unified interface to search, book and manage accommodation bookings across millions of properties worldwide. This guide will walk you through integrating our search and booking flow into your product.

Prerequisites

Before you begin, you’ll need to:
Contact your account manager to request access to the Tripedge API. If you don’t have a contact at Tripedge, reach out to us at https://tripedge.com/contact.
Create a test access token from the “Access tokens” page in your Dashboard. These are your Sandbox credentials.

Integration Steps

There are five main steps to search and book accommodation with the Stays API:

1. Search for a Destination

First, search for your desired destination to get location details. When you subsequently search for accommodation results, you’ll use the destinationId returned in the response.

2. Search for Accommodation

Once you have the destination details, search for available properties by providing:
  • Number of guests
  • Number of rooms
  • Check-in and check-out dates
  • Search location (coordinates + radius) or specific property IDs
The search response includes a sessionId that caches your search results. This enables:
  • Instant redisplay of results when users refresh their page
  • Server-side filtering and sorting of results by passing the sessionId in subsequent requests

3. Get Hotel Details

Retrieve detailed information about a hotel from your search results. You’ll display hotel images, name, address, amenities, available room types and rates, and other details to the user.

4. Create Prebook

Create a pre-booking to verify availability and rates before final booking. Here, you’ll need to display the rate remarks present in the response to the user, in addition to cancellation policy details and dates. At this stage, you’ll need to specify the payment method:
  • creditCard: The end user will pay directly with their credit card
  • account: The booking amount will be deducted from your deposit balance with us

5. Create Booking

Complete the booking process by confirming the pre-booking details. The payment will be processed according to the payment method specified in the pre-booking step - either charging the user’s credit card or deducting from your account balance.