example-data.com
Menu
Browse docs and collections

Overview

food-orders / #176

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 176,
  "userId": 177,
  "restaurantId": 3,
  "items": [
    {
      "menuItemId": 35,
      "quantity": 4,
      "unitPrice": 35.98,
      "lineTotal": 143.92
    }
  ],
  "subtotal": 143.92,
  "deliveryFee": 6.99,
  "tip": 11.46,
  "total": 162.37,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2025-06-05T16:39:43.123Z",
  "deliveredAt": null
}