example-data.com
Menu
Browse docs and collections

Overview

food-orders / #170

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 170,
  "userId": 83,
  "restaurantId": 38,
  "items": [
    {
      "menuItemId": 555,
      "quantity": 1,
      "unitPrice": 38.64,
      "lineTotal": 38.64
    }
  ],
  "subtotal": 38.64,
  "deliveryFee": 6.71,
  "tip": 8.2,
  "total": 53.55,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-23T01:56:56.634Z",
  "deliveredAt": "2025-02-23T05:13:51.046Z"
}