example-data.com
Menu
Browse docs and collections

Overview

food-orders / #388

food-orders #388

userId
Mateo Gerlach @mateo.gerlach
restaurantId
Aufderhar - Johns · East Lorenside · ★ 4.5
items
              [
  {
    "menuItemId": 1418,
    "quantity": 4,
    "unitPrice": 69.42,
    "lineTotal": 277.68
  },
  {
    "menuItemId": 1424,
    "quantity": 1,
    "unitPrice": 65.44,
    "lineTotal": 65.44
  }
]
            
subtotal
343.12
deliveryFee
4.58
tip
6.55
total
354.25
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 388,
  "userId": 81,
  "restaurantId": 98,
  "items": [
    {
      "menuItemId": 1418,
      "quantity": 4,
      "unitPrice": 69.42,
      "lineTotal": 277.68
    },
    {
      "menuItemId": 1424,
      "quantity": 1,
      "unitPrice": 65.44,
      "lineTotal": 65.44
    }
  ],
  "subtotal": 343.12,
  "deliveryFee": 4.58,
  "tip": 6.55,
  "total": 354.25,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-01T07:17:28.030Z",
  "deliveredAt": "2025-02-01T09:34:50.032Z"
}