example-data.com

food-orders / #2

userId
Clementine Nicolas @clementine_nicolas
restaurantId
Halvorson - Olson · Lake Angeloton · ★ 3.7
items
[
  {
    "menuItemId": 100,
    "quantity": 4,
    "unitPrice": 55.87,
    "lineTotal": 223.48
  },
  {
    "menuItemId": 105,
    "quantity": 4,
    "unitPrice": 22.74,
    "lineTotal": 90.96
  }
]
subtotal
314.44
deliveryFee
1.67
tip
6.13
total
322.24
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

curl -sS \
  "https://example-data.com/api/v1/food-orders/2" \
  -H "Accept: application/json"
const res = await fetch(
  "https://example-data.com/api/v1/food-orders/2"
);
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/2"
);
const foodOrder = (await res.json()) as FoodOrder;
import requests

res = requests.get(
    "https://example-data.com/api/v1/food-orders/2"
)
food_order = res.json()
{
  "id": 2,
  "userId": 164,
  "restaurantId": 8,
  "items": [
    {
      "menuItemId": 100,
      "quantity": 4,
      "unitPrice": 55.87,
      "lineTotal": 223.48
    },
    {
      "menuItemId": 105,
      "quantity": 4,
      "unitPrice": 22.74,
      "lineTotal": 90.96
    }
  ],
  "subtotal": 314.44,
  "deliveryFee": 1.67,
  "tip": 6.13,
  "total": 322.24,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-01-18T16:51:21.069Z",
  "deliveredAt": null
}
Draftbit