example-data.com
Menu
Browse docs and collections

Overview

food-orders / #472

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/food-orders/472"
);
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/472"
);
const foodOrder = (await res.json()) as FoodOrder;

Python example

import requests

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

Response

{
  "id": 472,
  "userId": 121,
  "restaurantId": 85,
  "items": [
    {
      "menuItemId": 1238,
      "quantity": 3,
      "unitPrice": 76.13,
      "lineTotal": 228.39
    }
  ],
  "subtotal": 228.39,
  "deliveryFee": 6.13,
  "tip": 1.55,
  "total": 236.07,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2026-01-07T04:06:49.525Z",
  "deliveredAt": "2026-01-07T05:24:21.203Z"
}