example-data.com
Menu
Browse docs and collections

Overview

food-orders / #437

food-orders #437

userId
Berniece Medhurst @berniece_medhurst
restaurantId
Hand Inc · Costa Mesa · ★ 3.2
items
              [
  {
    "menuItemId": 345,
    "quantity": 4,
    "unitPrice": 14.49,
    "lineTotal": 57.96
  },
  {
    "menuItemId": 354,
    "quantity": 3,
    "unitPrice": 33.21,
    "lineTotal": 99.63
  }
]
            
subtotal
157.59
deliveryFee
2.71
tip
8.42
total
168.72
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 437,
  "userId": 77,
  "restaurantId": 23,
  "items": [
    {
      "menuItemId": 345,
      "quantity": 4,
      "unitPrice": 14.49,
      "lineTotal": 57.96
    },
    {
      "menuItemId": 354,
      "quantity": 3,
      "unitPrice": 33.21,
      "lineTotal": 99.63
    }
  ],
  "subtotal": 157.59,
  "deliveryFee": 2.71,
  "tip": 8.42,
  "total": 168.72,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-11-29T01:19:29.891Z",
  "deliveredAt": "2024-11-29T04:27:04.743Z"
}