example-data.com
Menu
Browse docs and collections

Overview

food-orders / #252

food-orders #252

userId
Ari Howe @ari.howe73
restaurantId
Kertzmann - Boyer · Chicago · ★ 4.1
items
              [
  {
    "menuItemId": 1296,
    "quantity": 4,
    "unitPrice": 57.13,
    "lineTotal": 228.52
  },
  {
    "menuItemId": 1312,
    "quantity": 4,
    "unitPrice": 40.1,
    "lineTotal": 160.4
  },
  {
    "menuItemId": 1300,
    "quantity": 2,
    "unitPrice": 19.05,
    "lineTotal": 38.1
  }
]
            
subtotal
427.02
deliveryFee
5.12
tip
11.89
total
444.03
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 252,
  "userId": 167,
  "restaurantId": 90,
  "items": [
    {
      "menuItemId": 1296,
      "quantity": 4,
      "unitPrice": 57.13,
      "lineTotal": 228.52
    },
    {
      "menuItemId": 1312,
      "quantity": 4,
      "unitPrice": 40.1,
      "lineTotal": 160.4
    },
    {
      "menuItemId": 1300,
      "quantity": 2,
      "unitPrice": 19.05,
      "lineTotal": 38.1
    }
  ],
  "subtotal": 427.02,
  "deliveryFee": 5.12,
  "tip": 11.89,
  "total": 444.03,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-06-24T14:27:51.223Z",
  "deliveredAt": null
}