example-data.com
Menu
Browse docs and collections

Overview

food-orders / #308

food-orders #308

userId
Berniece Medhurst @berniece_medhurst
restaurantId
Roob - Fisher · Kuhlmanshire · ★ 3.2
items
              [
  {
    "menuItemId": 1220,
    "quantity": 4,
    "unitPrice": 25.22,
    "lineTotal": 100.88
  },
  {
    "menuItemId": 1221,
    "quantity": 3,
    "unitPrice": 4.45,
    "lineTotal": 13.35
  }
]
            
subtotal
114.23
deliveryFee
1.41
tip
1.37
total
117.01
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 308,
  "userId": 77,
  "restaurantId": 83,
  "items": [
    {
      "menuItemId": 1220,
      "quantity": 4,
      "unitPrice": 25.22,
      "lineTotal": 100.88
    },
    {
      "menuItemId": 1221,
      "quantity": 3,
      "unitPrice": 4.45,
      "lineTotal": 13.35
    }
  ],
  "subtotal": 114.23,
  "deliveryFee": 1.41,
  "tip": 1.37,
  "total": 117.01,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-30T03:32:39.200Z",
  "deliveredAt": "2025-01-30T07:27:49.753Z"
}