example-data.com
Menu
Browse docs and collections

Overview

food-orders / #276

food-orders #276

userId
Cindy Barrows @cindy_barrows20
restaurantId
Heathcote Group · New Eduardoboro · ★ 4.0
items
              [
  {
    "menuItemId": 1174,
    "quantity": 2,
    "unitPrice": 10.64,
    "lineTotal": 21.28
  },
  {
    "menuItemId": 1191,
    "quantity": 2,
    "unitPrice": 57.12,
    "lineTotal": 114.24
  },
  {
    "menuItemId": 1177,
    "quantity": 2,
    "unitPrice": 39.89,
    "lineTotal": 79.78
  }
]
            
subtotal
215.3
deliveryFee
3.4
tip
2.19
total
220.89
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 276,
  "userId": 165,
  "restaurantId": 80,
  "items": [
    {
      "menuItemId": 1174,
      "quantity": 2,
      "unitPrice": 10.64,
      "lineTotal": 21.28
    },
    {
      "menuItemId": 1191,
      "quantity": 2,
      "unitPrice": 57.12,
      "lineTotal": 114.24
    },
    {
      "menuItemId": 1177,
      "quantity": 2,
      "unitPrice": 39.89,
      "lineTotal": 79.78
    }
  ],
  "subtotal": 215.3,
  "deliveryFee": 3.4,
  "tip": 2.19,
  "total": 220.89,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-06-10T23:17:37.506Z",
  "deliveredAt": "2024-06-11T00:32:36.969Z"
}