example-data.com
Menu
Browse docs and collections

Overview

food-orders / #373

food-orders #373

userId
Jamaal Rolfson @jamaal_rolfson
restaurantId
McGlynn, Bosco and Gusikowski · Altadena · ★ 3.8
items
              [
  {
    "menuItemId": 485,
    "quantity": 2,
    "unitPrice": 18.98,
    "lineTotal": 37.96
  },
  {
    "menuItemId": 487,
    "quantity": 1,
    "unitPrice": 67.86,
    "lineTotal": 67.86
  },
  {
    "menuItemId": 494,
    "quantity": 2,
    "unitPrice": 40.25,
    "lineTotal": 80.5
  },
  {
    "menuItemId": 482,
    "quantity": 1,
    "unitPrice": 26.11,
    "lineTotal": 26.11
  }
]
            
subtotal
212.43
deliveryFee
0.99
tip
4.1
total
217.52
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 373,
  "userId": 207,
  "restaurantId": 33,
  "items": [
    {
      "menuItemId": 485,
      "quantity": 2,
      "unitPrice": 18.98,
      "lineTotal": 37.96
    },
    {
      "menuItemId": 487,
      "quantity": 1,
      "unitPrice": 67.86,
      "lineTotal": 67.86
    },
    {
      "menuItemId": 494,
      "quantity": 2,
      "unitPrice": 40.25,
      "lineTotal": 80.5
    },
    {
      "menuItemId": 482,
      "quantity": 1,
      "unitPrice": 26.11,
      "lineTotal": 26.11
    }
  ],
  "subtotal": 212.43,
  "deliveryFee": 0.99,
  "tip": 4.1,
  "total": 217.52,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-02-15T23:36:14.577Z",
  "deliveredAt": "2025-02-16T02:20:37.299Z"
}