example-data.com
Menu
Browse docs and collections

Overview

food-orders / #228

food-orders #228

userId
Rupert Lebsack @rupert.lebsack
restaurantId
Schimmel LLC · Clovis · ★ 3.3
items
              [
  {
    "menuItemId": 1255,
    "quantity": 2,
    "unitPrice": 70.84,
    "lineTotal": 141.68
  },
  {
    "menuItemId": 1259,
    "quantity": 4,
    "unitPrice": 76.04,
    "lineTotal": 304.16
  },
  {
    "menuItemId": 1249,
    "quantity": 3,
    "unitPrice": 26.49,
    "lineTotal": 79.47
  }
]
            
subtotal
525.31
deliveryFee
2.92
tip
4.97
total
533.2
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 228,
  "userId": 249,
  "restaurantId": 86,
  "items": [
    {
      "menuItemId": 1255,
      "quantity": 2,
      "unitPrice": 70.84,
      "lineTotal": 141.68
    },
    {
      "menuItemId": 1259,
      "quantity": 4,
      "unitPrice": 76.04,
      "lineTotal": 304.16
    },
    {
      "menuItemId": 1249,
      "quantity": 3,
      "unitPrice": 26.49,
      "lineTotal": 79.47
    }
  ],
  "subtotal": 525.31,
  "deliveryFee": 2.92,
  "tip": 4.97,
  "total": 533.2,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-07-22T00:11:50.984Z",
  "deliveredAt": "2024-07-22T02:57:56.860Z"
}