example-data.com
Menu
Browse docs and collections

Overview

food-orders / #486

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 486,
  "userId": 123,
  "restaurantId": 46,
  "items": [
    {
      "menuItemId": 689,
      "quantity": 4,
      "unitPrice": 15.37,
      "lineTotal": 61.48
    }
  ],
  "subtotal": 61.48,
  "deliveryFee": 3.63,
  "tip": 5.39,
  "total": 70.5,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-11-23T18:59:19.488Z",
  "deliveredAt": "2025-11-23T20:01:44.354Z"
}