example-data.com
Menu
Browse docs and collections

Overview

food-orders / #468

food-orders #468

userId
Jennifer Stoltenberg @jennifer_stoltenberg
restaurantId
Simonis, Reynolds and Harber · Dahliastead · ★ 3.5
items
              [
  {
    "menuItemId": 263,
    "quantity": 1,
    "unitPrice": 23.3,
    "lineTotal": 23.3
  },
  {
    "menuItemId": 260,
    "quantity": 3,
    "unitPrice": 36.04,
    "lineTotal": 108.12
  },
  {
    "menuItemId": 270,
    "quantity": 1,
    "unitPrice": 50.72,
    "lineTotal": 50.72
  },
  {
    "menuItemId": 251,
    "quantity": 4,
    "unitPrice": 4.22,
    "lineTotal": 16.88
  }
]
            
subtotal
199.02
deliveryFee
0.52
tip
9.9
total
209.44
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 468,
  "userId": 25,
  "restaurantId": 17,
  "items": [
    {
      "menuItemId": 263,
      "quantity": 1,
      "unitPrice": 23.3,
      "lineTotal": 23.3
    },
    {
      "menuItemId": 260,
      "quantity": 3,
      "unitPrice": 36.04,
      "lineTotal": 108.12
    },
    {
      "menuItemId": 270,
      "quantity": 1,
      "unitPrice": 50.72,
      "lineTotal": 50.72
    },
    {
      "menuItemId": 251,
      "quantity": 4,
      "unitPrice": 4.22,
      "lineTotal": 16.88
    }
  ],
  "subtotal": 199.02,
  "deliveryFee": 0.52,
  "tip": 9.9,
  "total": 209.44,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-04-11T02:34:57.938Z",
  "deliveredAt": "2025-04-11T04:27:05.018Z"
}