example-data.com
Menu
Browse docs and collections

Overview

food-orders / #481

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 481,
  "userId": 128,
  "restaurantId": 3,
  "items": [
    {
      "menuItemId": 33,
      "quantity": 3,
      "unitPrice": 28.94,
      "lineTotal": 86.82
    }
  ],
  "subtotal": 86.82,
  "deliveryFee": 6.79,
  "tip": 11.31,
  "total": 104.92,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-10-01T07:25:20.478Z",
  "deliveredAt": "2025-10-01T08:30:12.755Z"
}