example-data.com
Menu
Browse docs and collections

Overview

food-orders / #256

food-orders #256

userId
Darian Schaden @darian_schaden36
restaurantId
Klocko, Gusikowski and Lockman · Lake Vern · ★ 2.9
items
              [
  {
    "menuItemId": 1337,
    "quantity": 3,
    "unitPrice": 7.45,
    "lineTotal": 22.35
  },
  {
    "menuItemId": 1338,
    "quantity": 3,
    "unitPrice": 24.18,
    "lineTotal": 72.54
  },
  {
    "menuItemId": 1333,
    "quantity": 3,
    "unitPrice": 40.39,
    "lineTotal": 121.17
  }
]
            
subtotal
216.06
deliveryFee
7.26
tip
9.81
total
233.13
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 256,
  "userId": 53,
  "restaurantId": 92,
  "items": [
    {
      "menuItemId": 1337,
      "quantity": 3,
      "unitPrice": 7.45,
      "lineTotal": 22.35
    },
    {
      "menuItemId": 1338,
      "quantity": 3,
      "unitPrice": 24.18,
      "lineTotal": 72.54
    },
    {
      "menuItemId": 1333,
      "quantity": 3,
      "unitPrice": 40.39,
      "lineTotal": 121.17
    }
  ],
  "subtotal": 216.06,
  "deliveryFee": 7.26,
  "tip": 9.81,
  "total": 233.13,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-10-13T06:38:13.720Z",
  "deliveredAt": null
}