example-data.com
Menu
Browse docs and collections

Overview

food-orders / #494

food-orders #494

userId
Simeon Robel @simeon_robel12
restaurantId
Weimann, Herzog and Wisoky · Grahamberg · ★ 3.2
items
              [
  {
    "menuItemId": 1286,
    "quantity": 1,
    "unitPrice": 64.02,
    "lineTotal": 64.02
  },
  {
    "menuItemId": 1281,
    "quantity": 2,
    "unitPrice": 71.22,
    "lineTotal": 142.44
  },
  {
    "menuItemId": 1284,
    "quantity": 2,
    "unitPrice": 66.71,
    "lineTotal": 133.42
  }
]
            
subtotal
339.88
deliveryFee
5.53
tip
4.24
total
349.65
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 494,
  "userId": 55,
  "restaurantId": 89,
  "items": [
    {
      "menuItemId": 1286,
      "quantity": 1,
      "unitPrice": 64.02,
      "lineTotal": 64.02
    },
    {
      "menuItemId": 1281,
      "quantity": 2,
      "unitPrice": 71.22,
      "lineTotal": 142.44
    },
    {
      "menuItemId": 1284,
      "quantity": 2,
      "unitPrice": 66.71,
      "lineTotal": 133.42
    }
  ],
  "subtotal": 339.88,
  "deliveryFee": 5.53,
  "tip": 4.24,
  "total": 349.65,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-21T16:31:11.631Z",
  "deliveredAt": "2025-01-21T18:20:06.507Z"
}