example-data.com
Menu
Browse docs and collections

Overview

food-orders / #198

food-orders #198

userId
Vidal Parker @vidal_parker12
restaurantId
Brown - Johnson · West Bernie · ★ 3.3
items
              [
  {
    "menuItemId": 625,
    "quantity": 2,
    "unitPrice": 6.11,
    "lineTotal": 12.22
  },
  {
    "menuItemId": 636,
    "quantity": 4,
    "unitPrice": 59.18,
    "lineTotal": 236.72
  },
  {
    "menuItemId": 621,
    "quantity": 2,
    "unitPrice": 45.28,
    "lineTotal": 90.56
  },
  {
    "menuItemId": 627,
    "quantity": 4,
    "unitPrice": 5.52,
    "lineTotal": 22.08
  }
]
            
subtotal
361.58
deliveryFee
4.28
tip
5.92
total
371.78
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 198,
  "userId": 203,
  "restaurantId": 43,
  "items": [
    {
      "menuItemId": 625,
      "quantity": 2,
      "unitPrice": 6.11,
      "lineTotal": 12.22
    },
    {
      "menuItemId": 636,
      "quantity": 4,
      "unitPrice": 59.18,
      "lineTotal": 236.72
    },
    {
      "menuItemId": 621,
      "quantity": 2,
      "unitPrice": 45.28,
      "lineTotal": 90.56
    },
    {
      "menuItemId": 627,
      "quantity": 4,
      "unitPrice": 5.52,
      "lineTotal": 22.08
    }
  ],
  "subtotal": 361.58,
  "deliveryFee": 4.28,
  "tip": 5.92,
  "total": 371.78,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-04-25T23:24:08.848Z",
  "deliveredAt": null
}