example-data.com
Menu
Browse docs and collections

Overview

food-orders / #50

food-orders #50

userId
Mara Johnson @mara.johnson17
restaurantId
Weimann, Herzog and Wisoky · Grahamberg · ★ 3.2
items
              [
  {
    "menuItemId": 1282,
    "quantity": 4,
    "unitPrice": 13.28,
    "lineTotal": 53.12
  },
  {
    "menuItemId": 1284,
    "quantity": 3,
    "unitPrice": 66.71,
    "lineTotal": 200.13
  },
  {
    "menuItemId": 1285,
    "quantity": 1,
    "unitPrice": 8.63,
    "lineTotal": 8.63
  },
  {
    "menuItemId": 1280,
    "quantity": 1,
    "unitPrice": 8.8,
    "lineTotal": 8.8
  }
]
            
subtotal
270.68
deliveryFee
6.12
tip
9.35
total
286.15
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 50,
  "userId": 12,
  "restaurantId": 89,
  "items": [
    {
      "menuItemId": 1282,
      "quantity": 4,
      "unitPrice": 13.28,
      "lineTotal": 53.12
    },
    {
      "menuItemId": 1284,
      "quantity": 3,
      "unitPrice": 66.71,
      "lineTotal": 200.13
    },
    {
      "menuItemId": 1285,
      "quantity": 1,
      "unitPrice": 8.63,
      "lineTotal": 8.63
    },
    {
      "menuItemId": 1280,
      "quantity": 1,
      "unitPrice": 8.8,
      "lineTotal": 8.8
    }
  ],
  "subtotal": 270.68,
  "deliveryFee": 6.12,
  "tip": 9.35,
  "total": 286.15,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-04-26T07:18:30.467Z",
  "deliveredAt": "2025-04-26T10:34:49.625Z"
}