example-data.com
Menu
Browse docs and collections

Overview

food-orders / #118

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/food-orders/118" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/food-orders/118"
);
const foodOrder = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/food-orders.d.ts https://example-data.com/types/food-orders.d.ts
import type { FoodOrder } from "./types/food-orders";

const res = await fetch(
  "https://example-data.com/api/v1/food-orders/118"
);
const foodOrder = (await res.json()) as FoodOrder;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/food-orders/118"
)
food_order = res.json()

Response

{
  "id": 118,
  "userId": 107,
  "restaurantId": 34,
  "items": [
    {
      "menuItemId": 511,
      "quantity": 2,
      "unitPrice": 75.99,
      "lineTotal": 151.98
    }
  ],
  "subtotal": 151.98,
  "deliveryFee": 0.11,
  "tip": 0.49,
  "total": 152.58,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2025-09-23T16:56:26.327Z",
  "deliveredAt": null
}