example-data.com
Menu
Browse docs and collections

Overview

food-orders / #355

food-orders #355

userId
Allan Buckridge @allan_buckridge
restaurantId
Marks Inc · East Dena · ★ 4.1
items
              [
  {
    "menuItemId": 800,
    "quantity": 2,
    "unitPrice": 79.2,
    "lineTotal": 158.4
  },
  {
    "menuItemId": 805,
    "quantity": 2,
    "unitPrice": 51.43,
    "lineTotal": 102.86
  }
]
            
subtotal
261.26
deliveryFee
1.4
tip
1.14
total
263.8
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 355,
  "userId": 106,
  "restaurantId": 54,
  "items": [
    {
      "menuItemId": 800,
      "quantity": 2,
      "unitPrice": 79.2,
      "lineTotal": 158.4
    },
    {
      "menuItemId": 805,
      "quantity": 2,
      "unitPrice": 51.43,
      "lineTotal": 102.86
    }
  ],
  "subtotal": 261.26,
  "deliveryFee": 1.4,
  "tip": 1.14,
  "total": 263.8,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-02T08:56:46.723Z",
  "deliveredAt": "2024-12-02T10:12:21.896Z"
}