example-data.com
Menu
Browse docs and collections

Overview

food-orders / #223

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 223,
  "userId": 246,
  "restaurantId": 7,
  "items": [
    {
      "menuItemId": 85,
      "quantity": 3,
      "unitPrice": 53.75,
      "lineTotal": 161.25
    }
  ],
  "subtotal": 161.25,
  "deliveryFee": 0.7,
  "tip": 11.62,
  "total": 173.57,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2026-02-03T21:42:01.591Z",
  "deliveredAt": "2026-02-03T23:14:04.511Z"
}