example-data.com
Menu
Browse docs and collections

Overview

food-orders / #301

food-orders #301

userId
Casimir Smitham @casimir_smitham35
restaurantId
Schimmel LLC · Clovis · ★ 3.3
items
              [
  {
    "menuItemId": 1260,
    "quantity": 1,
    "unitPrice": 28.65,
    "lineTotal": 28.65
  },
  {
    "menuItemId": 1262,
    "quantity": 2,
    "unitPrice": 19.68,
    "lineTotal": 39.36
  }
]
            
subtotal
68.01
deliveryFee
0.23
tip
7.14
total
75.38
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 301,
  "userId": 16,
  "restaurantId": 86,
  "items": [
    {
      "menuItemId": 1260,
      "quantity": 1,
      "unitPrice": 28.65,
      "lineTotal": 28.65
    },
    {
      "menuItemId": 1262,
      "quantity": 2,
      "unitPrice": 19.68,
      "lineTotal": 39.36
    }
  ],
  "subtotal": 68.01,
  "deliveryFee": 0.23,
  "tip": 7.14,
  "total": 75.38,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-08-09T11:50:22.202Z",
  "deliveredAt": "2024-08-09T13:07:52.614Z"
}