example-data.com
Menu
Browse docs and collections

Overview

food-orders / #394

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 394,
  "userId": 60,
  "restaurantId": 21,
  "items": [
    {
      "menuItemId": 337,
      "quantity": 1,
      "unitPrice": 33.8,
      "lineTotal": 33.8
    }
  ],
  "subtotal": 33.8,
  "deliveryFee": 3.41,
  "tip": 5.84,
  "total": 43.05,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-09-12T22:17:33.509Z",
  "deliveredAt": "2025-09-13T01:27:09.959Z"
}