example-data.com
Menu
Browse docs and collections

Overview

food-orders / #491

food-orders #491

userId
Filiberto Fay @filiberto.fay59
restaurantId
Howe, Kunde and Ortiz · Rosemead · ★ 4.9
items
              [
  {
    "menuItemId": 1169,
    "quantity": 2,
    "unitPrice": 34.34,
    "lineTotal": 68.68
  },
  {
    "menuItemId": 1157,
    "quantity": 1,
    "unitPrice": 3.82,
    "lineTotal": 3.82
  },
  {
    "menuItemId": 1171,
    "quantity": 2,
    "unitPrice": 79.93,
    "lineTotal": 159.86
  }
]
            
subtotal
232.36
deliveryFee
6.77
tip
10.6
total
249.73
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 491,
  "userId": 92,
  "restaurantId": 79,
  "items": [
    {
      "menuItemId": 1169,
      "quantity": 2,
      "unitPrice": 34.34,
      "lineTotal": 68.68
    },
    {
      "menuItemId": 1157,
      "quantity": 1,
      "unitPrice": 3.82,
      "lineTotal": 3.82
    },
    {
      "menuItemId": 1171,
      "quantity": 2,
      "unitPrice": 79.93,
      "lineTotal": 159.86
    }
  ],
  "subtotal": 232.36,
  "deliveryFee": 6.77,
  "tip": 10.6,
  "total": 249.73,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2025-02-03T13:07:31.558Z",
  "deliveredAt": null
}