example-data.com
Menu
Browse docs and collections

Overview

food-orders / #398

food-orders #398

userId
Everett Yundt @everett_yundt11
restaurantId
Simonis - Kshlerin · Stanleybury · ★ 2.8
items
              [
  {
    "menuItemId": 671,
    "quantity": 4,
    "unitPrice": 75.23,
    "lineTotal": 300.92
  },
  {
    "menuItemId": 682,
    "quantity": 3,
    "unitPrice": 5.31,
    "lineTotal": 15.93
  },
  {
    "menuItemId": 673,
    "quantity": 2,
    "unitPrice": 63.75,
    "lineTotal": 127.5
  },
  {
    "menuItemId": 666,
    "quantity": 1,
    "unitPrice": 8.71,
    "lineTotal": 8.71
  }
]
            
subtotal
453.06
deliveryFee
6.03
tip
11.31
total
470.4
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 398,
  "userId": 44,
  "restaurantId": 45,
  "items": [
    {
      "menuItemId": 671,
      "quantity": 4,
      "unitPrice": 75.23,
      "lineTotal": 300.92
    },
    {
      "menuItemId": 682,
      "quantity": 3,
      "unitPrice": 5.31,
      "lineTotal": 15.93
    },
    {
      "menuItemId": 673,
      "quantity": 2,
      "unitPrice": 63.75,
      "lineTotal": 127.5
    },
    {
      "menuItemId": 666,
      "quantity": 1,
      "unitPrice": 8.71,
      "lineTotal": 8.71
    }
  ],
  "subtotal": 453.06,
  "deliveryFee": 6.03,
  "tip": 11.31,
  "total": 470.4,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-18T08:51:22.130Z",
  "deliveredAt": "2025-02-18T10:43:50.820Z"
}