> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.etera.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.etera.dev/_mcp/server.

# Get all bookings from Experience, Restaurant, and Hotel verticals

GET https://api.etera.dev/account/bookings/


Aggregates bookings from Experience, Restaurant, and Hotel APIs and returns them in a unified format.

## Features
- **Multi-Vertical Support**: Fetches bookings from Restaurant, Experience, and Hotel services
- **Unified Response**: Standardized format across all booking types
- **Filtering & Pagination**: Support for status, dataType, date range, and pagination
- **Sorting**: Configurable sorting by various fields
- **Metadata**: Counts of bookings by type

## Query Parameters
- **status**: Filter by booking status (confirmed, pending, cancelled, completed, active, inactive, expired, refunded, processing)
- **dataType**: Filter by booking type (RESTAURANT, EXPERIENCE, HOTEL) - defaults to all types if not specified
- **page**: Page number for pagination (default: 1)
- **limit**: Number of items per page (1-100, default: 20)
- **sortBy**: Field to sort by (optional) - defaults to booking date:
  - Hotel: bookingDetails.checkinDate
  - Experience: startDateTime
  - Restaurant: date
  - Falls back to createdAt if booking date not available
- **sortOrder**: Sort direction (asc/desc, default: desc)
- **dateFrom**: Start date filter (ISO format) - if no end date provided, treats as single day
- **dateTo**: End date filter (ISO format) - if not provided with start date, treats start date as single day

## Response Structure
Each booking includes:
- **id**: User ID associated with the booking
- **dataType**: Type of booking (RESTAURANT, EXPERIENCE, HOTEL)
- **data**: Raw booking data from the respective service
- **metadata**: Counts by booking type
        

Reference: https://docs.etera.dev/platform/account/account-api/bookings/get-all-bookings

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.etera.dev/account` (Production, default)
- `https://api-stage.etera.dev/account` (Staging)
- `https://api-dev.etera.dev/account` (Development)

## Request

### Query parameters

- `status` (BookingsGetParametersStatus, optional)
- `dataType` (BookingsGetParametersDataType, optional)
- `page` (BookingsGetParametersPage, optional)
- `limit` (BookingsGetParametersLimit, optional)
- `sortBy` (string, optional)
- `sortOrder` (BookingsGetParametersSortOrder, optional)
- `dateFrom` (string, optional)
- `dateTo` (string, optional)

## Response

### 200

Successfully retrieved bookings

- `success` (boolean, optional)
- `data` (BookingsGetResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Invalid query parameters

- `any`

### 401 Unauthorized Error

Authorization token required

- `any`

### 502 Bad Gateway Error

External API error

- `any`

### 503 Service Unavailable Error

Service unavailable

- `any`

## Types

### BookingsGetParametersStatus

- "confirmed"
- "pending"
- "cancelled"
- "completed"
- "active"
- "inactive"
- "expired"
- "refunded"
- "processing"

### BookingsGetParametersDataType

- "RESTAURANT"
- "EXPERIENCE"
- "HOTEL"

### BookingsGetParametersPage

- string
- double

### BookingsGetParametersLimit

- string
- double

### BookingsGetParametersSortOrder

- "asc"
- "desc"

### BookingsGetResponsesContentApplicationJsonSchemaData

- `bookings` (list of BookingsGetResponsesContentApplicationJsonSchemaDataBookingsItems, optional)
- `metadata` (BookingsGetResponsesContentApplicationJsonSchemaDataMetadata, optional)

### BookingsGetResponsesContentApplicationJsonSchemaDataBookingsItems

- `id` (string, optional)
- `dataType` (enum, optional)
  - Allowed values: `RESTAURANT`, `EXPERIENCE`, `HOTEL`
- `data` (BookingsGetResponsesContentApplicationJsonSchemaDataBookingsItemsData, optional)

### BookingsGetResponsesContentApplicationJsonSchemaDataMetadata

- `restaurants` (double, optional)
- `hotels` (double, optional)
- `experiences` (double, optional)

### BookingsGetResponsesContentApplicationJsonSchemaDataBookingsItemsData

## Examples

**Response**

```json
{
  "success": true,
  "data": {
    "bookings": [
      {
        "id": "string",
        "dataType": "RESTAURANT",
        "data": {}
      }
    ],
    "metadata": {
      "restaurants": 1.1,
      "hotels": 1.1,
      "experiences": 1.1
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.etera.dev/account/bookings/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.etera.dev/account/bookings/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.etera.dev/account/bookings/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.etera.dev/account/bookings/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.etera.dev/account/bookings/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.etera.dev/account/bookings/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.etera.dev/account/bookings/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/account/bookings/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```