example-data.com
Menu
Browse docs and collections

Overview

food-orders / #98

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 98,
  "userId": 28,
  "restaurantId": 98,
  "items": [
    {
      "menuItemId": 1424,
      "quantity": 4,
      "unitPrice": 65.44,
      "lineTotal": 261.76
    }
  ],
  "subtotal": 261.76,
  "deliveryFee": 3.59,
  "tip": 7.52,
  "total": 272.87,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2026-01-15T03:25:34.478Z",
  "deliveredAt": "2026-01-15T06:24:00.485Z"
}