example-data.com
Menu
Browse docs and collections

bookings

bookings

Page 7 of 21.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/bookings?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/bookings?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/bookings.d.ts https://example-data.com/types/bookings.d.ts
import type { Booking, ListEnvelope } from "./types/bookings";

const res = await fetch(
  "https://example-data.com/api/v1/bookings?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Booking>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/bookings",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 145,
      "userId": 81,
      "kind": "hotel",
      "referenceId": 78,
      "checkInAt": "2027-04-04T23:09:44.040Z",
      "checkOutAt": "2027-04-13T23:09:44.040Z",
      "status": "completed",
      "totalAmount": 7568.57,
      "currency": "USD",
      "createdAt": "2027-03-16T23:09:44.040Z"
    },
    {
      "id": 146,
      "userId": 78,
      "kind": "property",
      "referenceId": 109,
      "checkInAt": "2027-02-10T03:56:32.777Z",
      "checkOutAt": "2027-02-19T03:56:32.777Z",
      "status": "cancelled",
      "totalAmount": 8201.79,
      "currency": "GBP",
      "createdAt": "2027-01-16T03:56:32.777Z"
    },
    {
      "id": 147,
      "userId": 12,
      "kind": "hotel",
      "referenceId": 40,
      "checkInAt": "2025-06-06T12:12:59.534Z",
      "checkOutAt": "2025-06-09T12:12:59.534Z",
      "status": "pending",
      "totalAmount": 7939.54,
      "currency": "AED",
      "createdAt": "2025-04-18T12:12:59.534Z"
    }
  ],
  "meta": {
    "page": 7,
    "limit": 24,
    "total": 500,
    "totalPages": 21
  },
  "links": {
    "self": "/api/v1/bookings?page=7&limit=24",
    "first": "/api/v1/bookings?page=1&limit=24",
    "last": "/api/v1/bookings?page=21&limit=24",
    "next": "/api/v1/bookings?page=8&limit=24",
    "prev": "/api/v1/bookings?page=6&limit=24"
  }
}