example-data.com
Menu
Browse docs and collections

Overview

food-orders / #72

food-orders #72

userId
Kevon Dickinson @kevon.dickinson
restaurantId
Durgan Group · Fort Collins · ★ 3.1
items
              [
  {
    "menuItemId": 49,
    "quantity": 1,
    "unitPrice": 78.67,
    "lineTotal": 78.67
  },
  {
    "menuItemId": 50,
    "quantity": 1,
    "unitPrice": 34.46,
    "lineTotal": 34.46
  },
  {
    "menuItemId": 48,
    "quantity": 4,
    "unitPrice": 57.67,
    "lineTotal": 230.68
  }
]
            
subtotal
343.81
deliveryFee
6.02
tip
4.38
total
354.21
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 72,
  "userId": 218,
  "restaurantId": 5,
  "items": [
    {
      "menuItemId": 49,
      "quantity": 1,
      "unitPrice": 78.67,
      "lineTotal": 78.67
    },
    {
      "menuItemId": 50,
      "quantity": 1,
      "unitPrice": 34.46,
      "lineTotal": 34.46
    },
    {
      "menuItemId": 48,
      "quantity": 4,
      "unitPrice": 57.67,
      "lineTotal": 230.68
    }
  ],
  "subtotal": 343.81,
  "deliveryFee": 6.02,
  "tip": 4.38,
  "total": 354.21,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-07T13:26:35.817Z",
  "deliveredAt": "2025-02-07T15:46:10.432Z"
}