example-data.com
Menu
Browse docs and collections

Overview

food-orders / #45

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 45,
  "userId": 250,
  "restaurantId": 35,
  "items": [
    {
      "menuItemId": 520,
      "quantity": 4,
      "unitPrice": 18.41,
      "lineTotal": 73.64
    }
  ],
  "subtotal": 73.64,
  "deliveryFee": 1.55,
  "tip": 6.63,
  "total": 81.82,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-04-25T04:57:16.885Z",
  "deliveredAt": "2025-04-25T06:34:35.772Z"
}