example-data.com
Menu
Browse docs and collections

Overview

food-orders / #346

food-orders #346

userId
Americo Hoppe @americo_hoppe57
restaurantId
Blanda and Sons · New Odashire · ★ 4.1
items
              [
  {
    "menuItemId": 895,
    "quantity": 2,
    "unitPrice": 14.83,
    "lineTotal": 29.66
  },
  {
    "menuItemId": 903,
    "quantity": 4,
    "unitPrice": 53.71,
    "lineTotal": 214.84
  },
  {
    "menuItemId": 897,
    "quantity": 4,
    "unitPrice": 27.35,
    "lineTotal": 109.4
  },
  {
    "menuItemId": 891,
    "quantity": 3,
    "unitPrice": 17.02,
    "lineTotal": 51.06
  }
]
            
subtotal
404.96
deliveryFee
0.19
tip
9.19
total
414.34
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 346,
  "userId": 177,
  "restaurantId": 59,
  "items": [
    {
      "menuItemId": 895,
      "quantity": 2,
      "unitPrice": 14.83,
      "lineTotal": 29.66
    },
    {
      "menuItemId": 903,
      "quantity": 4,
      "unitPrice": 53.71,
      "lineTotal": 214.84
    },
    {
      "menuItemId": 897,
      "quantity": 4,
      "unitPrice": 27.35,
      "lineTotal": 109.4
    },
    {
      "menuItemId": 891,
      "quantity": 3,
      "unitPrice": 17.02,
      "lineTotal": 51.06
    }
  ],
  "subtotal": 404.96,
  "deliveryFee": 0.19,
  "tip": 9.19,
  "total": 414.34,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-22T02:31:55.091Z",
  "deliveredAt": "2025-01-22T06:23:29.981Z"
}