example-data.com
Menu
Browse docs and collections

Overview

food-orders / #303

food-orders #303

userId
Filiberto Fay @filiberto.fay59
restaurantId
Medhurst, Effertz and Brown · Franeckiburgh · ★ 3.2
items
              [
  {
    "menuItemId": 1149,
    "quantity": 4,
    "unitPrice": 39.76,
    "lineTotal": 159.04
  },
  {
    "menuItemId": 1135,
    "quantity": 1,
    "unitPrice": 57.92,
    "lineTotal": 57.92
  },
  {
    "menuItemId": 1136,
    "quantity": 4,
    "unitPrice": 78.33,
    "lineTotal": 313.32
  }
]
            
subtotal
530.28
deliveryFee
5.79
tip
0.26
total
536.33
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 303,
  "userId": 92,
  "restaurantId": 78,
  "items": [
    {
      "menuItemId": 1149,
      "quantity": 4,
      "unitPrice": 39.76,
      "lineTotal": 159.04
    },
    {
      "menuItemId": 1135,
      "quantity": 1,
      "unitPrice": 57.92,
      "lineTotal": 57.92
    },
    {
      "menuItemId": 1136,
      "quantity": 4,
      "unitPrice": 78.33,
      "lineTotal": 313.32
    }
  ],
  "subtotal": 530.28,
  "deliveryFee": 5.79,
  "tip": 0.26,
  "total": 536.33,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-10-31T15:11:09.529Z",
  "deliveredAt": null
}