example-data.com
Menu
Browse docs and collections

Overview

food-orders / #261

food-orders #261

userId
Kathleen Lynch @kathleen_lynch1
restaurantId
Schoen, Cole and Bauch · Thompsonberg · ★ 3.1
items
              [
  {
    "menuItemId": 469,
    "quantity": 1,
    "unitPrice": 45.46,
    "lineTotal": 45.46
  },
  {
    "menuItemId": 473,
    "quantity": 1,
    "unitPrice": 18.26,
    "lineTotal": 18.26
  },
  {
    "menuItemId": 465,
    "quantity": 2,
    "unitPrice": 64.18,
    "lineTotal": 128.36
  },
  {
    "menuItemId": 459,
    "quantity": 1,
    "unitPrice": 41,
    "lineTotal": 41
  },
  {
    "menuItemId": 458,
    "quantity": 4,
    "unitPrice": 29.76,
    "lineTotal": 119.04
  }
]
            
subtotal
352.12
deliveryFee
0.7
tip
3.95
total
356.77
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 261,
  "userId": 139,
  "restaurantId": 31,
  "items": [
    {
      "menuItemId": 469,
      "quantity": 1,
      "unitPrice": 45.46,
      "lineTotal": 45.46
    },
    {
      "menuItemId": 473,
      "quantity": 1,
      "unitPrice": 18.26,
      "lineTotal": 18.26
    },
    {
      "menuItemId": 465,
      "quantity": 2,
      "unitPrice": 64.18,
      "lineTotal": 128.36
    },
    {
      "menuItemId": 459,
      "quantity": 1,
      "unitPrice": 41,
      "lineTotal": 41
    },
    {
      "menuItemId": 458,
      "quantity": 4,
      "unitPrice": 29.76,
      "lineTotal": 119.04
    }
  ],
  "subtotal": 352.12,
  "deliveryFee": 0.7,
  "tip": 3.95,
  "total": 356.77,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-09-19T15:01:49.132Z",
  "deliveredAt": "2024-09-19T17:30:58.390Z"
}