example-data.com
Menu
Browse docs and collections

Overview

food-orders / #407

food-orders #407

userId
Sheridan Turcotte @sheridan.turcotte
restaurantId
Halvorson - Torp · Tonawanda · ★ 3.3
items
              [
  {
    "menuItemId": 287,
    "quantity": 3,
    "unitPrice": 73.12,
    "lineTotal": 219.36
  },
  {
    "menuItemId": 279,
    "quantity": 2,
    "unitPrice": 73.18,
    "lineTotal": 146.36
  },
  {
    "menuItemId": 285,
    "quantity": 1,
    "unitPrice": 14.84,
    "lineTotal": 14.84
  }
]
            
subtotal
380.56
deliveryFee
3.35
tip
7.99
total
391.9
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 407,
  "userId": 153,
  "restaurantId": 18,
  "items": [
    {
      "menuItemId": 287,
      "quantity": 3,
      "unitPrice": 73.12,
      "lineTotal": 219.36
    },
    {
      "menuItemId": 279,
      "quantity": 2,
      "unitPrice": 73.18,
      "lineTotal": 146.36
    },
    {
      "menuItemId": 285,
      "quantity": 1,
      "unitPrice": 14.84,
      "lineTotal": 14.84
    }
  ],
  "subtotal": 380.56,
  "deliveryFee": 3.35,
  "tip": 7.99,
  "total": 391.9,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-10-02T06:45:18.367Z",
  "deliveredAt": "2024-10-02T10:04:46.473Z"
}