example-data.com
Menu
Browse docs and collections

Overview

food-orders / #427

food-orders #427

userId
Michale Hilpert @michale_hilpert62
restaurantId
Johns - Adams · Bradleyburgh · ★ 2.6
items
              [
  {
    "menuItemId": 874,
    "quantity": 4,
    "unitPrice": 19.84,
    "lineTotal": 79.36
  },
  {
    "menuItemId": 882,
    "quantity": 2,
    "unitPrice": 68.35,
    "lineTotal": 136.7
  },
  {
    "menuItemId": 877,
    "quantity": 4,
    "unitPrice": 72,
    "lineTotal": 288
  },
  {
    "menuItemId": 875,
    "quantity": 2,
    "unitPrice": 64.05,
    "lineTotal": 128.1
  }
]
            
subtotal
632.16
deliveryFee
0.64
tip
6.26
total
639.06
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 427,
  "userId": 250,
  "restaurantId": 58,
  "items": [
    {
      "menuItemId": 874,
      "quantity": 4,
      "unitPrice": 19.84,
      "lineTotal": 79.36
    },
    {
      "menuItemId": 882,
      "quantity": 2,
      "unitPrice": 68.35,
      "lineTotal": 136.7
    },
    {
      "menuItemId": 877,
      "quantity": 4,
      "unitPrice": 72,
      "lineTotal": 288
    },
    {
      "menuItemId": 875,
      "quantity": 2,
      "unitPrice": 64.05,
      "lineTotal": 128.1
    }
  ],
  "subtotal": 632.16,
  "deliveryFee": 0.64,
  "tip": 6.26,
  "total": 639.06,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-11-15T12:21:32.884Z",
  "deliveredAt": null
}