example-data.com
Menu
Browse docs and collections

Overview

food-orders / #215

food-orders #215

userId
Beau Stiedemann @beau.stiedemann
restaurantId
Price LLC · Aspen Hill · ★ 2.9
items
              [
  {
    "menuItemId": 1236,
    "quantity": 2,
    "unitPrice": 42.06,
    "lineTotal": 84.12
  },
  {
    "menuItemId": 1232,
    "quantity": 1,
    "unitPrice": 4.21,
    "lineTotal": 4.21
  },
  {
    "menuItemId": 1231,
    "quantity": 4,
    "unitPrice": 64.87,
    "lineTotal": 259.48
  },
  {
    "menuItemId": 1235,
    "quantity": 1,
    "unitPrice": 11.65,
    "lineTotal": 11.65
  },
  {
    "menuItemId": 1233,
    "quantity": 3,
    "unitPrice": 53.6,
    "lineTotal": 160.8
  }
]
            
subtotal
520.26
deliveryFee
7.9
tip
2.73
total
530.89
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 215,
  "userId": 64,
  "restaurantId": 84,
  "items": [
    {
      "menuItemId": 1236,
      "quantity": 2,
      "unitPrice": 42.06,
      "lineTotal": 84.12
    },
    {
      "menuItemId": 1232,
      "quantity": 1,
      "unitPrice": 4.21,
      "lineTotal": 4.21
    },
    {
      "menuItemId": 1231,
      "quantity": 4,
      "unitPrice": 64.87,
      "lineTotal": 259.48
    },
    {
      "menuItemId": 1235,
      "quantity": 1,
      "unitPrice": 11.65,
      "lineTotal": 11.65
    },
    {
      "menuItemId": 1233,
      "quantity": 3,
      "unitPrice": 53.6,
      "lineTotal": 160.8
    }
  ],
  "subtotal": 520.26,
  "deliveryFee": 7.9,
  "tip": 2.73,
  "total": 530.89,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-24T21:08:15.152Z",
  "deliveredAt": "2025-01-24T23:07:34.922Z"
}