example-data.com
Menu
Browse docs and collections

Overview

food-orders / #462

food-orders #462

userId
Cayla Farrell @cayla_farrell
restaurantId
Hayes - McDermott · Lake Tanya · ★ 2.5
items
              [
  {
    "menuItemId": 1025,
    "quantity": 4,
    "unitPrice": 16.73,
    "lineTotal": 66.92
  },
  {
    "menuItemId": 1028,
    "quantity": 2,
    "unitPrice": 52.79,
    "lineTotal": 105.58
  },
  {
    "menuItemId": 1013,
    "quantity": 2,
    "unitPrice": 6.63,
    "lineTotal": 13.26
  },
  {
    "menuItemId": 1014,
    "quantity": 2,
    "unitPrice": 31.24,
    "lineTotal": 62.48
  }
]
            
subtotal
248.24
deliveryFee
7.75
tip
10.32
total
266.31
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 462,
  "userId": 4,
  "restaurantId": 68,
  "items": [
    {
      "menuItemId": 1025,
      "quantity": 4,
      "unitPrice": 16.73,
      "lineTotal": 66.92
    },
    {
      "menuItemId": 1028,
      "quantity": 2,
      "unitPrice": 52.79,
      "lineTotal": 105.58
    },
    {
      "menuItemId": 1013,
      "quantity": 2,
      "unitPrice": 6.63,
      "lineTotal": 13.26
    },
    {
      "menuItemId": 1014,
      "quantity": 2,
      "unitPrice": 31.24,
      "lineTotal": 62.48
    }
  ],
  "subtotal": 248.24,
  "deliveryFee": 7.75,
  "tip": 10.32,
  "total": 266.31,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2025-02-01T00:59:40.503Z",
  "deliveredAt": null
}