example-data.com
Menu
Browse docs and collections

Overview

food-orders / #216

food-orders #216

userId
Abdul Rau @abdul.rau
restaurantId
Rogahn - Kreiger · South Cathrynside · ★ 4.6
items
              [
  {
    "menuItemId": 1207,
    "quantity": 4,
    "unitPrice": 77.46,
    "lineTotal": 309.84
  },
  {
    "menuItemId": 1209,
    "quantity": 1,
    "unitPrice": 45.24,
    "lineTotal": 45.24
  }
]
            
subtotal
355.08
deliveryFee
2.43
tip
2.37
total
359.88
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 216,
  "userId": 108,
  "restaurantId": 82,
  "items": [
    {
      "menuItemId": 1207,
      "quantity": 4,
      "unitPrice": 77.46,
      "lineTotal": 309.84
    },
    {
      "menuItemId": 1209,
      "quantity": 1,
      "unitPrice": 45.24,
      "lineTotal": 45.24
    }
  ],
  "subtotal": 355.08,
  "deliveryFee": 2.43,
  "tip": 2.37,
  "total": 359.88,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-08-11T02:19:12.777Z",
  "deliveredAt": null
}