example-data.com
Menu
Browse docs and collections

Overview

food-orders / #366

food-orders #366

userId
Whitney O'Reilly @whitney.oreilly
restaurantId
Auer, Franey and Nicolas · Lake Kacey · ★ 4.1
items
              [
  {
    "menuItemId": 399,
    "quantity": 3,
    "unitPrice": 25.49,
    "lineTotal": 76.47
  },
  {
    "menuItemId": 396,
    "quantity": 3,
    "unitPrice": 31.8,
    "lineTotal": 95.4
  },
  {
    "menuItemId": 397,
    "quantity": 4,
    "unitPrice": 11.75,
    "lineTotal": 47
  }
]
            
subtotal
218.87
deliveryFee
7.14
tip
0.59
total
226.6
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 366,
  "userId": 99,
  "restaurantId": 26,
  "items": [
    {
      "menuItemId": 399,
      "quantity": 3,
      "unitPrice": 25.49,
      "lineTotal": 76.47
    },
    {
      "menuItemId": 396,
      "quantity": 3,
      "unitPrice": 31.8,
      "lineTotal": 95.4
    },
    {
      "menuItemId": 397,
      "quantity": 4,
      "unitPrice": 11.75,
      "lineTotal": 47
    }
  ],
  "subtotal": 218.87,
  "deliveryFee": 7.14,
  "tip": 0.59,
  "total": 226.6,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-15T14:18:16.753Z",
  "deliveredAt": "2025-02-15T17:56:21.063Z"
}