example-data.com
Menu
Browse docs and collections

Overview

food-orders / #342

food-orders #342

userId
Cruz Okuneva @cruz.okuneva
restaurantId
Welch LLC · North Brando · ★ 4.0
items
              [
  {
    "menuItemId": 1377,
    "quantity": 4,
    "unitPrice": 52.08,
    "lineTotal": 208.32
  },
  {
    "menuItemId": 1382,
    "quantity": 1,
    "unitPrice": 73.15,
    "lineTotal": 73.15
  },
  {
    "menuItemId": 1372,
    "quantity": 2,
    "unitPrice": 13.53,
    "lineTotal": 27.06
  },
  {
    "menuItemId": 1390,
    "quantity": 4,
    "unitPrice": 54.05,
    "lineTotal": 216.2
  },
  {
    "menuItemId": 1384,
    "quantity": 3,
    "unitPrice": 29.54,
    "lineTotal": 88.62
  }
]
            
subtotal
613.35
deliveryFee
4.83
tip
0.49
total
618.67
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 342,
  "userId": 239,
  "restaurantId": 95,
  "items": [
    {
      "menuItemId": 1377,
      "quantity": 4,
      "unitPrice": 52.08,
      "lineTotal": 208.32
    },
    {
      "menuItemId": 1382,
      "quantity": 1,
      "unitPrice": 73.15,
      "lineTotal": 73.15
    },
    {
      "menuItemId": 1372,
      "quantity": 2,
      "unitPrice": 13.53,
      "lineTotal": 27.06
    },
    {
      "menuItemId": 1390,
      "quantity": 4,
      "unitPrice": 54.05,
      "lineTotal": 216.2
    },
    {
      "menuItemId": 1384,
      "quantity": 3,
      "unitPrice": 29.54,
      "lineTotal": 88.62
    }
  ],
  "subtotal": 613.35,
  "deliveryFee": 4.83,
  "tip": 0.49,
  "total": 618.67,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-02-22T00:50:27.186Z",
  "deliveredAt": null
}