---
title: "Search bookings by text"
method: POST
path: "/bookings/search"
tags: ["Analytics"]
---

# Search bookings by text

`POST /bookings/search`

## Request

- Base URL: `https://da.liteapi.travel`
- URL: `https://da.liteapi.travel/bookings/search`
- Auth: API key in header `X-Api-Key`

## Overview

Search for bookings by free-text query. Matches guest names, booking IDs, hotel names, and other booking-related fields. Results are paginated.

## When to Use

- **Admin or support lookup** - Find bookings by guest name, hotel name, or partial ID
- **Text search** - Search across multiple fields with a single query string
- **Paginated results** - Control page size and page index via request body

## What You Get

- **Matching bookings** - List of bookings matching the query with key fields
- **Pagination** - `page`, `rowsPerPage`, and the search `query` echoed back
- **Credit line billing** - When applicable, billing info (credit line ID, billed amount USD, billed at date, payment ID)

## Request Body

- **query** (required) - Text to search for (e.g. guest name, hotel name, booking ID)
- **page** - Zero-based page index (default 0)
- **rowsPerPage** - Number of results per page (e.g. 5)
- **sand_box** - Filter by environment (e.g. "false" for production)

## Quick Start

POST a JSON body with `query`, `page`, and `rowsPerPage`. Response includes `data` array, `success`, and pagination fields.

## Request body

- object
  - `query` string, required: Text to search for (guest name, hotel name, booking ID, etc.).
  - `page` integer: Zero-based page index for pagination.
  - `rowsPerPage` integer: Number of results per page.
  - `sand_box` string: Filter by sandbox environment (e.g. "true" or "false").

## Response `200`

OK

- object
  - `success` boolean: Whether the request succeeded.
  - `data` object[]
    - `booking_id` string: The unique identifier for the booking.
    - `first_name` string: Guest first name.
    - `last_name` string: Guest last name.
    - `created_at` string, date-time: When the booking was created (ISO 8601).
    - `hotel_name` string: Name of the hotel.
    - `credit_line_billing` object, nullable: Credit line billing details when the booking is billed to a credit line.
      - `credit_line_id` integer: ID of the credit line.
      - `billed_at` string, date-time: Date the booking was billed (ISO 8601).
      - `amount_usd` number: Amount billed in USD.
      - `payment_id` integer, nullable: ID of the payment if paid.
  - `page` integer: Zero-based page index returned.
  - `rowsPerPage` integer: Number of results per page returned.
  - `query` string: The search query echoed back.

---

[API](https://skmtc.dev/liteapi/apis/api-analytics.md) - [All operations](https://skmtc.dev/liteapi/apis/api-analytics/llms.txt) - [OpenAPI document](https://skmtc.dev/liteapi/apis/api-analytics/revisions/fcd6660a264d?raw)
