example-data.com
Menu
Browse docs and collections

Overview

food-orders / #123

food-orders #123

userId
Darian Schaden @darian_schaden36
restaurantId
Walker - Botsford · Zulaufburgh · ★ 3.7
items
              [
  {
    "menuItemId": 480,
    "quantity": 3,
    "unitPrice": 66.92,
    "lineTotal": 200.76
  },
  {
    "menuItemId": 477,
    "quantity": 2,
    "unitPrice": 68.24,
    "lineTotal": 136.48
  },
  {
    "menuItemId": 481,
    "quantity": 3,
    "unitPrice": 32.94,
    "lineTotal": 98.82
  }
]
            
subtotal
436.06
deliveryFee
5.6
tip
3.43
total
445.09
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 123,
  "userId": 53,
  "restaurantId": 32,
  "items": [
    {
      "menuItemId": 480,
      "quantity": 3,
      "unitPrice": 66.92,
      "lineTotal": 200.76
    },
    {
      "menuItemId": 477,
      "quantity": 2,
      "unitPrice": 68.24,
      "lineTotal": 136.48
    },
    {
      "menuItemId": 481,
      "quantity": 3,
      "unitPrice": 32.94,
      "lineTotal": 98.82
    }
  ],
  "subtotal": 436.06,
  "deliveryFee": 5.6,
  "tip": 3.43,
  "total": 445.09,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-03T22:55:49.182Z",
  "deliveredAt": "2025-02-04T02:14:28.995Z"
}