example-data.com
Menu
Browse docs and collections

Overview

food-orders / #421

food-orders #421

userId
Cassidy Price-Schimmel @cassidy.price-schimmel
restaurantId
Mitchell, O'Kon and Kunde · South Janelle · ★ 3.2
items
              [
  {
    "menuItemId": 342,
    "quantity": 2,
    "unitPrice": 76.35,
    "lineTotal": 152.7
  },
  {
    "menuItemId": 340,
    "quantity": 3,
    "unitPrice": 68,
    "lineTotal": 204
  },
  {
    "menuItemId": 341,
    "quantity": 3,
    "unitPrice": 38.13,
    "lineTotal": 114.39
  }
]
            
subtotal
471.09
deliveryFee
4.12
tip
10.77
total
485.98
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 421,
  "userId": 227,
  "restaurantId": 22,
  "items": [
    {
      "menuItemId": 342,
      "quantity": 2,
      "unitPrice": 76.35,
      "lineTotal": 152.7
    },
    {
      "menuItemId": 340,
      "quantity": 3,
      "unitPrice": 68,
      "lineTotal": 204
    },
    {
      "menuItemId": 341,
      "quantity": 3,
      "unitPrice": 38.13,
      "lineTotal": 114.39
    }
  ],
  "subtotal": 471.09,
  "deliveryFee": 4.12,
  "tip": 10.77,
  "total": 485.98,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-08-11T10:07:17.825Z",
  "deliveredAt": null
}