example-data.com
Menu
Browse docs and collections

Overview

food-orders / #267

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 267,
  "userId": 47,
  "restaurantId": 74,
  "items": [
    {
      "menuItemId": 1095,
      "quantity": 3,
      "unitPrice": 52.13,
      "lineTotal": 156.39
    }
  ],
  "subtotal": 156.39,
  "deliveryFee": 5.89,
  "tip": 6.71,
  "total": 168.99,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-11-27T13:32:37.026Z",
  "deliveredAt": "2025-11-27T17:05:51.990Z"
}