example-data.com
Menu
Browse docs and collections

Overview

bookings / #229

Feb
12
Fri

flight booking #229

5:50 AM – 5:50 AM

From SGD 453.20

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/bookings/229" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/bookings/229"
);
const booking = 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 } from "./types/bookings";

const res = await fetch(
  "https://example-data.com/api/v1/bookings/229"
);
const booking = (await res.json()) as Booking;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/bookings/229"
)
booking = res.json()

Response

{
  "id": 229,
  "userId": 161,
  "kind": "flight",
  "referenceId": 367,
  "checkInAt": "2027-02-12T05:50:44.213Z",
  "checkOutAt": "2027-02-12T05:50:44.213Z",
  "status": "confirmed",
  "totalAmount": 453.2,
  "currency": "SGD",
  "createdAt": "2027-01-28T05:50:44.213Z"
}