example-data.com
Menu
Browse docs and collections

Overview

food-orders / #408

food-orders #408

userId
Marta Harvey @marta.harvey68
restaurantId
Trantow - Jerde · Zaneberg · ★ 2.7
items
              [
  {
    "menuItemId": 437,
    "quantity": 1,
    "unitPrice": 62.77,
    "lineTotal": 62.77
  },
  {
    "menuItemId": 439,
    "quantity": 3,
    "unitPrice": 19.18,
    "lineTotal": 57.54
  },
  {
    "menuItemId": 426,
    "quantity": 1,
    "unitPrice": 42.47,
    "lineTotal": 42.47
  }
]
            
subtotal
162.78
deliveryFee
7.04
tip
2.91
total
172.73
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 408,
  "userId": 112,
  "restaurantId": 29,
  "items": [
    {
      "menuItemId": 437,
      "quantity": 1,
      "unitPrice": 62.77,
      "lineTotal": 62.77
    },
    {
      "menuItemId": 439,
      "quantity": 3,
      "unitPrice": 19.18,
      "lineTotal": 57.54
    },
    {
      "menuItemId": 426,
      "quantity": 1,
      "unitPrice": 42.47,
      "lineTotal": 42.47
    }
  ],
  "subtotal": 162.78,
  "deliveryFee": 7.04,
  "tip": 2.91,
  "total": 172.73,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-11-03T19:19:12.727Z",
  "deliveredAt": null
}