example-data.com
Menu
Browse docs and collections

Overview

food-orders / #456

food-orders #456

userId
Conner Bernhard @conner.bernhard33
restaurantId
Greenfelder LLC · Jaydentown · ★ 3.2
items
              [
  {
    "menuItemId": 183,
    "quantity": 3,
    "unitPrice": 14.2,
    "lineTotal": 42.6
  },
  {
    "menuItemId": 185,
    "quantity": 1,
    "unitPrice": 20.15,
    "lineTotal": 20.15
  },
  {
    "menuItemId": 186,
    "quantity": 3,
    "unitPrice": 64.97,
    "lineTotal": 194.91
  }
]
            
subtotal
257.66
deliveryFee
0.08
tip
11.33
total
269.07
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 456,
  "userId": 3,
  "restaurantId": 13,
  "items": [
    {
      "menuItemId": 183,
      "quantity": 3,
      "unitPrice": 14.2,
      "lineTotal": 42.6
    },
    {
      "menuItemId": 185,
      "quantity": 1,
      "unitPrice": 20.15,
      "lineTotal": 20.15
    },
    {
      "menuItemId": 186,
      "quantity": 3,
      "unitPrice": 64.97,
      "lineTotal": 194.91
    }
  ],
  "subtotal": 257.66,
  "deliveryFee": 0.08,
  "tip": 11.33,
  "total": 269.07,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-08-09T23:25:41.620Z",
  "deliveredAt": null
}