example-data.com
Menu
Browse docs and collections

Overview

food-orders / #268

food-orders #268

userId
Chyna Kozey @chyna_kozey80
restaurantId
Gislason Group · Marinafield · ★ 3.2
items
              [
  {
    "menuItemId": 1059,
    "quantity": 1,
    "unitPrice": 61.29,
    "lineTotal": 61.29
  },
  {
    "menuItemId": 1067,
    "quantity": 4,
    "unitPrice": 8.7,
    "lineTotal": 34.8
  },
  {
    "menuItemId": 1064,
    "quantity": 4,
    "unitPrice": 26.45,
    "lineTotal": 105.8
  },
  {
    "menuItemId": 1061,
    "quantity": 4,
    "unitPrice": 10.99,
    "lineTotal": 43.96
  }
]
            
subtotal
245.85
deliveryFee
7.61
tip
0.44
total
253.9
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 268,
  "userId": 140,
  "restaurantId": 71,
  "items": [
    {
      "menuItemId": 1059,
      "quantity": 1,
      "unitPrice": 61.29,
      "lineTotal": 61.29
    },
    {
      "menuItemId": 1067,
      "quantity": 4,
      "unitPrice": 8.7,
      "lineTotal": 34.8
    },
    {
      "menuItemId": 1064,
      "quantity": 4,
      "unitPrice": 26.45,
      "lineTotal": 105.8
    },
    {
      "menuItemId": 1061,
      "quantity": 4,
      "unitPrice": 10.99,
      "lineTotal": 43.96
    }
  ],
  "subtotal": 245.85,
  "deliveryFee": 7.61,
  "tip": 0.44,
  "total": 253.9,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-07T14:03:13.410Z",
  "deliveredAt": "2025-01-07T17:58:23.656Z"
}