example-data.com
Menu
Browse docs and collections

Overview

food-orders / #212

food-orders #212

userId
Esperanza Casper @esperanza_casper
restaurantId
Price LLC · Aspen Hill · ★ 2.9
items
              [
  {
    "menuItemId": 1235,
    "quantity": 4,
    "unitPrice": 11.65,
    "lineTotal": 46.6
  },
  {
    "menuItemId": 1232,
    "quantity": 4,
    "unitPrice": 4.21,
    "lineTotal": 16.84
  },
  {
    "menuItemId": 1234,
    "quantity": 4,
    "unitPrice": 11.13,
    "lineTotal": 44.52
  }
]
            
subtotal
107.96
deliveryFee
5.84
tip
0.59
total
114.39
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 212,
  "userId": 97,
  "restaurantId": 84,
  "items": [
    {
      "menuItemId": 1235,
      "quantity": 4,
      "unitPrice": 11.65,
      "lineTotal": 46.6
    },
    {
      "menuItemId": 1232,
      "quantity": 4,
      "unitPrice": 4.21,
      "lineTotal": 16.84
    },
    {
      "menuItemId": 1234,
      "quantity": 4,
      "unitPrice": 11.13,
      "lineTotal": 44.52
    }
  ],
  "subtotal": 107.96,
  "deliveryFee": 5.84,
  "tip": 0.59,
  "total": 114.39,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-09-23T01:45:39.666Z",
  "deliveredAt": null
}