example-data.com
Menu
Browse docs and collections

Overview

food-orders / #377

food-orders #377

userId
Kamryn Rogahn @kamryn_rogahn40
restaurantId
Stroman - Wolf · Hoboken · ★ 3.7
items
              [
  {
    "menuItemId": 571,
    "quantity": 4,
    "unitPrice": 33.01,
    "lineTotal": 132.04
  },
  {
    "menuItemId": 570,
    "quantity": 4,
    "unitPrice": 55.72,
    "lineTotal": 222.88
  },
  {
    "menuItemId": 575,
    "quantity": 4,
    "unitPrice": 35.72,
    "lineTotal": 142.88
  }
]
            
subtotal
497.8
deliveryFee
0.56
tip
4.95
total
503.31
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 377,
  "userId": 170,
  "restaurantId": 39,
  "items": [
    {
      "menuItemId": 571,
      "quantity": 4,
      "unitPrice": 33.01,
      "lineTotal": 132.04
    },
    {
      "menuItemId": 570,
      "quantity": 4,
      "unitPrice": 55.72,
      "lineTotal": 222.88
    },
    {
      "menuItemId": 575,
      "quantity": 4,
      "unitPrice": 35.72,
      "lineTotal": 142.88
    }
  ],
  "subtotal": 497.8,
  "deliveryFee": 0.56,
  "tip": 4.95,
  "total": 503.31,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-06T21:49:09.063Z",
  "deliveredAt": "2025-01-07T00:38:13.525Z"
}