example-data.com
Menu
Browse docs and collections

Overview

food-orders / #40

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 40,
  "userId": 43,
  "restaurantId": 8,
  "items": [
    {
      "menuItemId": 111,
      "quantity": 4,
      "unitPrice": 59.91,
      "lineTotal": 239.64
    },
    {
      "menuItemId": 96,
      "quantity": 2,
      "unitPrice": 60.13,
      "lineTotal": 120.26
    }
  ],
  "subtotal": 359.9,
  "deliveryFee": 3.98,
  "tip": 3.71,
  "total": 367.59,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-02-06T07:36:11.675Z",
  "deliveredAt": null
}