example-data.com
Menu
Browse docs and collections

Overview

food-orders / #288

food-orders #288

userId
Judy Hackett @judy_hackett49
restaurantId
Gerhold - Dietrich · North Joshua · ★ 4.9
items
              [
  {
    "menuItemId": 949,
    "quantity": 2,
    "unitPrice": 24.93,
    "lineTotal": 49.86
  },
  {
    "menuItemId": 947,
    "quantity": 1,
    "unitPrice": 74.6,
    "lineTotal": 74.6
  },
  {
    "menuItemId": 962,
    "quantity": 3,
    "unitPrice": 60.65,
    "lineTotal": 181.95
  }
]
            
subtotal
306.41
deliveryFee
0.88
tip
3.48
total
310.77
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 288,
  "userId": 13,
  "restaurantId": 63,
  "items": [
    {
      "menuItemId": 949,
      "quantity": 2,
      "unitPrice": 24.93,
      "lineTotal": 49.86
    },
    {
      "menuItemId": 947,
      "quantity": 1,
      "unitPrice": 74.6,
      "lineTotal": 74.6
    },
    {
      "menuItemId": 962,
      "quantity": 3,
      "unitPrice": 60.65,
      "lineTotal": 181.95
    }
  ],
  "subtotal": 306.41,
  "deliveryFee": 0.88,
  "tip": 3.48,
  "total": 310.77,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-11-28T10:02:38.048Z",
  "deliveredAt": "2024-11-28T11:59:45.462Z"
}