example-data.com
Menu
Browse docs and collections

Overview

food-orders / #245

food-orders #245

userId
Pinkie Denesik @pinkie_denesik32
restaurantId
Ortiz, Torp and Howell · Fort Devanside · ★ 2.9
items
              [
  {
    "menuItemId": 82,
    "quantity": 3,
    "unitPrice": 7.84,
    "lineTotal": 23.52
  },
  {
    "menuItemId": 80,
    "quantity": 1,
    "unitPrice": 20.78,
    "lineTotal": 20.78
  },
  {
    "menuItemId": 69,
    "quantity": 4,
    "unitPrice": 14.71,
    "lineTotal": 58.84
  }
]
            
subtotal
103.14
deliveryFee
2.52
tip
6.62
total
112.28
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 245,
  "userId": 88,
  "restaurantId": 7,
  "items": [
    {
      "menuItemId": 82,
      "quantity": 3,
      "unitPrice": 7.84,
      "lineTotal": 23.52
    },
    {
      "menuItemId": 80,
      "quantity": 1,
      "unitPrice": 20.78,
      "lineTotal": 20.78
    },
    {
      "menuItemId": 69,
      "quantity": 4,
      "unitPrice": 14.71,
      "lineTotal": 58.84
    }
  ],
  "subtotal": 103.14,
  "deliveryFee": 2.52,
  "tip": 6.62,
  "total": 112.28,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-06-13T21:15:35.677Z",
  "deliveredAt": null
}