example-data.com
Menu
Browse docs and collections

Overview

food-orders / #445

food-orders #445

userId
Niko Wisozk @niko_wisozk
restaurantId
Halvorson - Olson · Lake Angeloton · ★ 3.7
items
              [
  {
    "menuItemId": 87,
    "quantity": 3,
    "unitPrice": 40.69,
    "lineTotal": 122.07
  },
  {
    "menuItemId": 100,
    "quantity": 2,
    "unitPrice": 55.87,
    "lineTotal": 111.74
  },
  {
    "menuItemId": 103,
    "quantity": 3,
    "unitPrice": 66.97,
    "lineTotal": 200.91
  },
  {
    "menuItemId": 98,
    "quantity": 3,
    "unitPrice": 61.3,
    "lineTotal": 183.9
  },
  {
    "menuItemId": 91,
    "quantity": 2,
    "unitPrice": 13.89,
    "lineTotal": 27.78
  }
]
            
subtotal
646.4
deliveryFee
1.7
tip
1.33
total
649.43
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 445,
  "userId": 56,
  "restaurantId": 8,
  "items": [
    {
      "menuItemId": 87,
      "quantity": 3,
      "unitPrice": 40.69,
      "lineTotal": 122.07
    },
    {
      "menuItemId": 100,
      "quantity": 2,
      "unitPrice": 55.87,
      "lineTotal": 111.74
    },
    {
      "menuItemId": 103,
      "quantity": 3,
      "unitPrice": 66.97,
      "lineTotal": 200.91
    },
    {
      "menuItemId": 98,
      "quantity": 3,
      "unitPrice": 61.3,
      "lineTotal": 183.9
    },
    {
      "menuItemId": 91,
      "quantity": 2,
      "unitPrice": 13.89,
      "lineTotal": 27.78
    }
  ],
  "subtotal": 646.4,
  "deliveryFee": 1.7,
  "tip": 1.33,
  "total": 649.43,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-03-06T21:48:23.320Z",
  "deliveredAt": "2025-03-06T23:20:22.387Z"
}