example-data.com
Menu
Browse docs and collections

Overview

food-orders / #499

food-orders #499

userId
Raheem Kovacek @raheem_kovacek3
restaurantId
Hudson - Lueilwitz · South Lesliefurt · ★ 4.9
items
              [
  {
    "menuItemId": 581,
    "quantity": 3,
    "unitPrice": 13.34,
    "lineTotal": 40.02
  },
  {
    "menuItemId": 582,
    "quantity": 2,
    "unitPrice": 31.32,
    "lineTotal": 62.64
  },
  {
    "menuItemId": 580,
    "quantity": 4,
    "unitPrice": 18.03,
    "lineTotal": 72.12
  },
  {
    "menuItemId": 578,
    "quantity": 2,
    "unitPrice": 66.39,
    "lineTotal": 132.78
  }
]
            
subtotal
307.56
deliveryFee
3.38
tip
4.19
total
315.13
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 499,
  "userId": 57,
  "restaurantId": 40,
  "items": [
    {
      "menuItemId": 581,
      "quantity": 3,
      "unitPrice": 13.34,
      "lineTotal": 40.02
    },
    {
      "menuItemId": 582,
      "quantity": 2,
      "unitPrice": 31.32,
      "lineTotal": 62.64
    },
    {
      "menuItemId": 580,
      "quantity": 4,
      "unitPrice": 18.03,
      "lineTotal": 72.12
    },
    {
      "menuItemId": 578,
      "quantity": 2,
      "unitPrice": 66.39,
      "lineTotal": 132.78
    }
  ],
  "subtotal": 307.56,
  "deliveryFee": 3.38,
  "tip": 4.19,
  "total": 315.13,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-11-09T03:00:55.391Z",
  "deliveredAt": "2024-11-09T06:00:46.919Z"
}