example-data.com
Menu
Browse docs and collections

Overview

food-orders / #500

food-orders #500

userId
Marcelina Grady @marcelina_grady19
restaurantId
Heathcote Inc · Schmidtfield · ★ 2.7
items
              [
  {
    "menuItemId": 792,
    "quantity": 4,
    "unitPrice": 13.23,
    "lineTotal": 52.92
  },
  {
    "menuItemId": 786,
    "quantity": 1,
    "unitPrice": 8.76,
    "lineTotal": 8.76
  },
  {
    "menuItemId": 791,
    "quantity": 4,
    "unitPrice": 56.64,
    "lineTotal": 226.56
  }
]
            
subtotal
288.24
deliveryFee
6.17
tip
12
total
306.41
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 500,
  "userId": 241,
  "restaurantId": 53,
  "items": [
    {
      "menuItemId": 792,
      "quantity": 4,
      "unitPrice": 13.23,
      "lineTotal": 52.92
    },
    {
      "menuItemId": 786,
      "quantity": 1,
      "unitPrice": 8.76,
      "lineTotal": 8.76
    },
    {
      "menuItemId": 791,
      "quantity": 4,
      "unitPrice": 56.64,
      "lineTotal": 226.56
    }
  ],
  "subtotal": 288.24,
  "deliveryFee": 6.17,
  "tip": 12,
  "total": 306.41,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-02-28T09:45:20.928Z",
  "deliveredAt": null
}