example-data.com
Menu
Browse docs and collections

Overview

food-orders / #193

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 193,
  "userId": 145,
  "restaurantId": 49,
  "items": [
    {
      "menuItemId": 752,
      "quantity": 3,
      "unitPrice": 34.93,
      "lineTotal": 104.79
    },
    {
      "menuItemId": 743,
      "quantity": 4,
      "unitPrice": 5.59,
      "lineTotal": 22.36
    }
  ],
  "subtotal": 127.15,
  "deliveryFee": 0.27,
  "tip": 8.36,
  "total": 135.78,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-02-26T03:51:15.964Z",
  "deliveredAt": null
}