example-data.com
Menu
Browse docs and collections

Overview

food-orders / #411

food-orders #411

userId
Marilou Douglas @marilou.douglas
restaurantId
Howe, Kunde and Ortiz · Rosemead · ★ 4.9
items
              [
  {
    "menuItemId": 1157,
    "quantity": 3,
    "unitPrice": 3.82,
    "lineTotal": 11.46
  },
  {
    "menuItemId": 1161,
    "quantity": 4,
    "unitPrice": 51.7,
    "lineTotal": 206.8
  },
  {
    "menuItemId": 1154,
    "quantity": 2,
    "unitPrice": 68.24,
    "lineTotal": 136.48
  },
  {
    "menuItemId": 1159,
    "quantity": 4,
    "unitPrice": 49.21,
    "lineTotal": 196.84
  },
  {
    "menuItemId": 1166,
    "quantity": 3,
    "unitPrice": 48.23,
    "lineTotal": 144.69
  }
]
            
subtotal
696.27
deliveryFee
6.45
tip
4.18
total
706.9
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 411,
  "userId": 78,
  "restaurantId": 79,
  "items": [
    {
      "menuItemId": 1157,
      "quantity": 3,
      "unitPrice": 3.82,
      "lineTotal": 11.46
    },
    {
      "menuItemId": 1161,
      "quantity": 4,
      "unitPrice": 51.7,
      "lineTotal": 206.8
    },
    {
      "menuItemId": 1154,
      "quantity": 2,
      "unitPrice": 68.24,
      "lineTotal": 136.48
    },
    {
      "menuItemId": 1159,
      "quantity": 4,
      "unitPrice": 49.21,
      "lineTotal": 196.84
    },
    {
      "menuItemId": 1166,
      "quantity": 3,
      "unitPrice": 48.23,
      "lineTotal": 144.69
    }
  ],
  "subtotal": 696.27,
  "deliveryFee": 6.45,
  "tip": 4.18,
  "total": 706.9,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-06-15T06:31:57.628Z",
  "deliveredAt": "2024-06-15T09:03:41.541Z"
}