example-data.com
Menu
Browse docs and collections

Overview

food-orders / #488

food-orders #488

userId
Earlene Wisozk @earlene.wisozk
restaurantId
Bartoletti LLC · Shannychester · ★ 3.3
items
              [
  {
    "menuItemId": 740,
    "quantity": 1,
    "unitPrice": 49.23,
    "lineTotal": 49.23
  },
  {
    "menuItemId": 748,
    "quantity": 3,
    "unitPrice": 10.89,
    "lineTotal": 32.67
  },
  {
    "menuItemId": 739,
    "quantity": 2,
    "unitPrice": 67.14,
    "lineTotal": 134.28
  },
  {
    "menuItemId": 747,
    "quantity": 4,
    "unitPrice": 29.86,
    "lineTotal": 119.44
  }
]
            
subtotal
335.62
deliveryFee
1.24
tip
6.28
total
343.14
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 488,
  "userId": 216,
  "restaurantId": 49,
  "items": [
    {
      "menuItemId": 740,
      "quantity": 1,
      "unitPrice": 49.23,
      "lineTotal": 49.23
    },
    {
      "menuItemId": 748,
      "quantity": 3,
      "unitPrice": 10.89,
      "lineTotal": 32.67
    },
    {
      "menuItemId": 739,
      "quantity": 2,
      "unitPrice": 67.14,
      "lineTotal": 134.28
    },
    {
      "menuItemId": 747,
      "quantity": 4,
      "unitPrice": 29.86,
      "lineTotal": 119.44
    }
  ],
  "subtotal": 335.62,
  "deliveryFee": 1.24,
  "tip": 6.28,
  "total": 343.14,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-01-30T10:20:55.125Z",
  "deliveredAt": "2025-01-30T11:52:53.033Z"
}