example-data.com
Menu
Browse docs and collections

Overview

food-orders / #290

food-orders #290

userId
Brad Wisoky @brad.wisoky41
restaurantId
Walker - Botsford · Zulaufburgh · ★ 3.7
items
              [
  {
    "menuItemId": 479,
    "quantity": 1,
    "unitPrice": 40.31,
    "lineTotal": 40.31
  },
  {
    "menuItemId": 480,
    "quantity": 2,
    "unitPrice": 66.92,
    "lineTotal": 133.84
  },
  {
    "menuItemId": 477,
    "quantity": 4,
    "unitPrice": 68.24,
    "lineTotal": 272.96
  }
]
            
subtotal
447.11
deliveryFee
7.83
tip
1.65
total
456.59
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 290,
  "userId": 154,
  "restaurantId": 32,
  "items": [
    {
      "menuItemId": 479,
      "quantity": 1,
      "unitPrice": 40.31,
      "lineTotal": 40.31
    },
    {
      "menuItemId": 480,
      "quantity": 2,
      "unitPrice": 66.92,
      "lineTotal": 133.84
    },
    {
      "menuItemId": 477,
      "quantity": 4,
      "unitPrice": 68.24,
      "lineTotal": 272.96
    }
  ],
  "subtotal": 447.11,
  "deliveryFee": 7.83,
  "tip": 1.65,
  "total": 456.59,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-06-15T06:47:39.191Z",
  "deliveredAt": "2024-06-15T07:49:14.960Z"
}