example-data.com
Menu
Browse docs and collections

Overview

food-orders / #435

food-orders #435

userId
Zachariah Herzog @zachariah_herzog42
restaurantId
D'Amore, Quitzon and Satterfield · Bruenberg · ★ 4.6
items
              [
  {
    "menuItemId": 502,
    "quantity": 2,
    "unitPrice": 64.22,
    "lineTotal": 128.44
  },
  {
    "menuItemId": 498,
    "quantity": 4,
    "unitPrice": 42.35,
    "lineTotal": 169.4
  },
  {
    "menuItemId": 506,
    "quantity": 2,
    "unitPrice": 10.17,
    "lineTotal": 20.34
  },
  {
    "menuItemId": 507,
    "quantity": 1,
    "unitPrice": 18.84,
    "lineTotal": 18.84
  },
  {
    "menuItemId": 501,
    "quantity": 3,
    "unitPrice": 10.59,
    "lineTotal": 31.77
  }
]
            
subtotal
368.79
deliveryFee
5.37
tip
3.25
total
377.41
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 435,
  "userId": 15,
  "restaurantId": 34,
  "items": [
    {
      "menuItemId": 502,
      "quantity": 2,
      "unitPrice": 64.22,
      "lineTotal": 128.44
    },
    {
      "menuItemId": 498,
      "quantity": 4,
      "unitPrice": 42.35,
      "lineTotal": 169.4
    },
    {
      "menuItemId": 506,
      "quantity": 2,
      "unitPrice": 10.17,
      "lineTotal": 20.34
    },
    {
      "menuItemId": 507,
      "quantity": 1,
      "unitPrice": 18.84,
      "lineTotal": 18.84
    },
    {
      "menuItemId": 501,
      "quantity": 3,
      "unitPrice": 10.59,
      "lineTotal": 31.77
    }
  ],
  "subtotal": 368.79,
  "deliveryFee": 5.37,
  "tip": 3.25,
  "total": 377.41,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2024-10-13T10:32:38.297Z",
  "deliveredAt": null
}