example-data.com
Menu
Browse docs and collections

Overview

food-orders / #331

food-orders #331

userId
Lemuel Jast @lemuel.jast27
restaurantId
Hartmann, Dach and Kub · Gusikowskifield · ★ 4.2
items
              [
  {
    "menuItemId": 555,
    "quantity": 4,
    "unitPrice": 38.64,
    "lineTotal": 154.56
  },
  {
    "menuItemId": 560,
    "quantity": 1,
    "unitPrice": 34.64,
    "lineTotal": 34.64
  }
]
            
subtotal
189.2
deliveryFee
7.14
tip
10.14
total
206.48
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 331,
  "userId": 105,
  "restaurantId": 38,
  "items": [
    {
      "menuItemId": 555,
      "quantity": 4,
      "unitPrice": 38.64,
      "lineTotal": 154.56
    },
    {
      "menuItemId": 560,
      "quantity": 1,
      "unitPrice": 34.64,
      "lineTotal": 34.64
    }
  ],
  "subtotal": 189.2,
  "deliveryFee": 7.14,
  "tip": 10.14,
  "total": 206.48,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2025-03-24T15:35:44.660Z",
  "deliveredAt": null
}