example-data.com

food-orders / #222

userId
Cruz Okuneva @cruz.okuneva
restaurantId
O'Hara and Sons · New Eloisaboro · ★ 4.4
items
[
  {
    "menuItemId": 5,
    "quantity": 2,
    "unitPrice": 16.36,
    "lineTotal": 32.72
  }
]
subtotal
32.72
deliveryFee
3.51
tip
8.12
total
44.35
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

curl -sS \
  "https://example-data.com/api/v1/food-orders/222" \
  -H "Accept: application/json"
const res = await fetch(
  "https://example-data.com/api/v1/food-orders/222"
);
const foodOrder = await res.json();
import type { FoodOrder } from "https://example-data.com/types/food-orders.d.ts";

const res = await fetch(
  "https://example-data.com/api/v1/food-orders/222"
);
const foodOrder = (await res.json()) as FoodOrder;
import requests

res = requests.get(
    "https://example-data.com/api/v1/food-orders/222"
)
food_order = res.json()
{
  "id": 222,
  "userId": 239,
  "restaurantId": 1,
  "items": [
    {
      "menuItemId": 5,
      "quantity": 2,
      "unitPrice": 16.36,
      "lineTotal": 32.72
    }
  ],
  "subtotal": 32.72,
  "deliveryFee": 3.51,
  "tip": 8.12,
  "total": 44.35,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-12-01T09:01:51.219Z",
  "deliveredAt": null
}
Draftbit