example-data.com
Menu
Browse docs and collections

Overview

food-orders / #362

food-orders #362

userId
Karolann Legros @karolann_legros
restaurantId
Price LLC · Aspen Hill · ★ 2.9
items
              [
  {
    "menuItemId": 1234,
    "quantity": 2,
    "unitPrice": 11.13,
    "lineTotal": 22.26
  },
  {
    "menuItemId": 1233,
    "quantity": 2,
    "unitPrice": 53.6,
    "lineTotal": 107.2
  },
  {
    "menuItemId": 1235,
    "quantity": 2,
    "unitPrice": 11.65,
    "lineTotal": 23.3
  }
]
            
subtotal
152.76
deliveryFee
0.88
tip
4.48
total
158.12
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 362,
  "userId": 246,
  "restaurantId": 84,
  "items": [
    {
      "menuItemId": 1234,
      "quantity": 2,
      "unitPrice": 11.13,
      "lineTotal": 22.26
    },
    {
      "menuItemId": 1233,
      "quantity": 2,
      "unitPrice": 53.6,
      "lineTotal": 107.2
    },
    {
      "menuItemId": 1235,
      "quantity": 2,
      "unitPrice": 11.65,
      "lineTotal": 23.3
    }
  ],
  "subtotal": 152.76,
  "deliveryFee": 0.88,
  "tip": 4.48,
  "total": 158.12,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-10-11T10:52:53.760Z",
  "deliveredAt": "2024-10-11T14:09:45.057Z"
}