example-data.com
Menu
Browse docs and collections

Overview

food-orders / #439

food-orders #439

userId
Lew O'Kon @lew.okon75
restaurantId
Pouros, O'Reilly and Block · Lake Chandler · ★ 3.5
items
              [
  {
    "menuItemId": 704,
    "quantity": 3,
    "unitPrice": 5.88,
    "lineTotal": 17.64
  },
  {
    "menuItemId": 721,
    "quantity": 2,
    "unitPrice": 18.1,
    "lineTotal": 36.2
  },
  {
    "menuItemId": 702,
    "quantity": 3,
    "unitPrice": 62.38,
    "lineTotal": 187.14
  },
  {
    "menuItemId": 708,
    "quantity": 1,
    "unitPrice": 26.39,
    "lineTotal": 26.39
  },
  {
    "menuItemId": 719,
    "quantity": 1,
    "unitPrice": 60.22,
    "lineTotal": 60.22
  }
]
            
subtotal
327.59
deliveryFee
2.54
tip
5.53
total
335.66
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 439,
  "userId": 131,
  "restaurantId": 47,
  "items": [
    {
      "menuItemId": 704,
      "quantity": 3,
      "unitPrice": 5.88,
      "lineTotal": 17.64
    },
    {
      "menuItemId": 721,
      "quantity": 2,
      "unitPrice": 18.1,
      "lineTotal": 36.2
    },
    {
      "menuItemId": 702,
      "quantity": 3,
      "unitPrice": 62.38,
      "lineTotal": 187.14
    },
    {
      "menuItemId": 708,
      "quantity": 1,
      "unitPrice": 26.39,
      "lineTotal": 26.39
    },
    {
      "menuItemId": 719,
      "quantity": 1,
      "unitPrice": 60.22,
      "lineTotal": 60.22
    }
  ],
  "subtotal": 327.59,
  "deliveryFee": 2.54,
  "tip": 5.53,
  "total": 335.66,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-07-20T12:00:00.229Z",
  "deliveredAt": "2024-07-20T15:22:11.007Z"
}