example-data.com
Menu
Browse docs and collections

Overview

food-orders / #495

food-orders #495

userId
Theresia Collins @theresia_collins86
restaurantId
Thiel and Sons · Shyanneville · ★ 4.0
items
              [
  {
    "menuItemId": 1415,
    "quantity": 4,
    "unitPrice": 34.56,
    "lineTotal": 138.24
  },
  {
    "menuItemId": 1411,
    "quantity": 2,
    "unitPrice": 75.28,
    "lineTotal": 150.56
  },
  {
    "menuItemId": 1413,
    "quantity": 4,
    "unitPrice": 10.43,
    "lineTotal": 41.72
  },
  {
    "menuItemId": 1410,
    "quantity": 1,
    "unitPrice": 61.31,
    "lineTotal": 61.31
  }
]
            
subtotal
391.83
deliveryFee
0.89
tip
3.76
total
396.48
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 495,
  "userId": 63,
  "restaurantId": 97,
  "items": [
    {
      "menuItemId": 1415,
      "quantity": 4,
      "unitPrice": 34.56,
      "lineTotal": 138.24
    },
    {
      "menuItemId": 1411,
      "quantity": 2,
      "unitPrice": 75.28,
      "lineTotal": 150.56
    },
    {
      "menuItemId": 1413,
      "quantity": 4,
      "unitPrice": 10.43,
      "lineTotal": 41.72
    },
    {
      "menuItemId": 1410,
      "quantity": 1,
      "unitPrice": 61.31,
      "lineTotal": 61.31
    }
  ],
  "subtotal": 391.83,
  "deliveryFee": 0.89,
  "tip": 3.76,
  "total": 396.48,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-05-24T18:48:28.004Z",
  "deliveredAt": "2024-05-24T21:48:13.162Z"
}