example-data.com
Menu
Browse docs and collections

Overview

food-orders / #478

food-orders #478

userId
Leonor Corwin @leonor_corwin3
restaurantId
Mills, Kassulke and Marquardt · Jeffersonville · ★ 3.6
items
              [
  {
    "menuItemId": 451,
    "quantity": 3,
    "unitPrice": 15.67,
    "lineTotal": 47.01
  },
  {
    "menuItemId": 442,
    "quantity": 2,
    "unitPrice": 55.4,
    "lineTotal": 110.8
  },
  {
    "menuItemId": 447,
    "quantity": 2,
    "unitPrice": 58.83,
    "lineTotal": 117.66
  }
]
            
subtotal
275.47
deliveryFee
5.84
tip
3.99
total
285.3
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 478,
  "userId": 211,
  "restaurantId": 30,
  "items": [
    {
      "menuItemId": 451,
      "quantity": 3,
      "unitPrice": 15.67,
      "lineTotal": 47.01
    },
    {
      "menuItemId": 442,
      "quantity": 2,
      "unitPrice": 55.4,
      "lineTotal": 110.8
    },
    {
      "menuItemId": 447,
      "quantity": 2,
      "unitPrice": 58.83,
      "lineTotal": 117.66
    }
  ],
  "subtotal": 275.47,
  "deliveryFee": 5.84,
  "tip": 3.99,
  "total": 285.3,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-05-25T01:06:29.568Z",
  "deliveredAt": null
}