example-data.com
Menu
Browse docs and collections

Overview

food-orders / #487

food-orders #487

userId
Wallace Batz @wallace_batz
restaurantId
Hegmann - Daugherty · Dulcestad · ★ 4.6
items
              [
  {
    "menuItemId": 695,
    "quantity": 4,
    "unitPrice": 60.79,
    "lineTotal": 243.16
  },
  {
    "menuItemId": 687,
    "quantity": 1,
    "unitPrice": 41.74,
    "lineTotal": 41.74
  }
]
            
subtotal
284.9
deliveryFee
3.89
tip
4.01
total
292.8
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 487,
  "userId": 229,
  "restaurantId": 46,
  "items": [
    {
      "menuItemId": 695,
      "quantity": 4,
      "unitPrice": 60.79,
      "lineTotal": 243.16
    },
    {
      "menuItemId": 687,
      "quantity": 1,
      "unitPrice": 41.74,
      "lineTotal": 41.74
    }
  ],
  "subtotal": 284.9,
  "deliveryFee": 3.89,
  "tip": 4.01,
  "total": 292.8,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-01-27T21:41:41.403Z",
  "deliveredAt": null
}