example-data.com
Menu
Browse docs and collections

Overview

food-orders / #492

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 492,
  "userId": 11,
  "restaurantId": 44,
  "items": [
    {
      "menuItemId": 657,
      "quantity": 1,
      "unitPrice": 78.36,
      "lineTotal": 78.36
    }
  ],
  "subtotal": 78.36,
  "deliveryFee": 4.22,
  "tip": 1.6,
  "total": 84.18,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-10-08T04:14:41.220Z",
  "deliveredAt": "2025-10-08T06:46:22.751Z"
}