example-data.com
Menu
Browse docs and collections

Overview

food-orders / #466

food-orders #466

userId
General Morissette @general_morissette47
restaurantId
Blanda and Sons · New Odashire · ★ 4.1
items
              [
  {
    "menuItemId": 889,
    "quantity": 3,
    "unitPrice": 9.6,
    "lineTotal": 28.8
  },
  {
    "menuItemId": 898,
    "quantity": 3,
    "unitPrice": 4.07,
    "lineTotal": 12.21
  },
  {
    "menuItemId": 897,
    "quantity": 1,
    "unitPrice": 27.35,
    "lineTotal": 27.35
  }
]
            
subtotal
68.36
deliveryFee
0.25
tip
11.81
total
80.42
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 466,
  "userId": 184,
  "restaurantId": 59,
  "items": [
    {
      "menuItemId": 889,
      "quantity": 3,
      "unitPrice": 9.6,
      "lineTotal": 28.8
    },
    {
      "menuItemId": 898,
      "quantity": 3,
      "unitPrice": 4.07,
      "lineTotal": 12.21
    },
    {
      "menuItemId": 897,
      "quantity": 1,
      "unitPrice": 27.35,
      "lineTotal": 27.35
    }
  ],
  "subtotal": 68.36,
  "deliveryFee": 0.25,
  "tip": 11.81,
  "total": 80.42,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-08T14:02:54.728Z",
  "deliveredAt": "2024-12-08T16:06:42.801Z"
}