example-data.com
Menu
Browse docs and collections

Overview

food-orders / #412

food-orders #412

userId
Cassidy Price-Schimmel @cassidy.price-schimmel
restaurantId
McGlynn, Bosco and Gusikowski · Altadena · ★ 3.8
items
              [
  {
    "menuItemId": 484,
    "quantity": 3,
    "unitPrice": 29.66,
    "lineTotal": 88.98
  },
  {
    "menuItemId": 485,
    "quantity": 3,
    "unitPrice": 18.98,
    "lineTotal": 56.94
  },
  {
    "menuItemId": 496,
    "quantity": 1,
    "unitPrice": 15.67,
    "lineTotal": 15.67
  }
]
            
subtotal
161.59
deliveryFee
4.8
tip
6.96
total
173.35
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 412,
  "userId": 227,
  "restaurantId": 33,
  "items": [
    {
      "menuItemId": 484,
      "quantity": 3,
      "unitPrice": 29.66,
      "lineTotal": 88.98
    },
    {
      "menuItemId": 485,
      "quantity": 3,
      "unitPrice": 18.98,
      "lineTotal": 56.94
    },
    {
      "menuItemId": 496,
      "quantity": 1,
      "unitPrice": 15.67,
      "lineTotal": 15.67
    }
  ],
  "subtotal": 161.59,
  "deliveryFee": 4.8,
  "tip": 6.96,
  "total": 173.35,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2024-07-15T21:04:53.177Z",
  "deliveredAt": null
}