example-data.com
Menu
Browse docs and collections

Overview

food-orders / #305

food-orders #305

userId
Jensen Bashirian @jensen_bashirian
restaurantId
Lehner - Smith · Larkinfurt · ★ 3.0
items
              [
  {
    "menuItemId": 1350,
    "quantity": 3,
    "unitPrice": 29.23,
    "lineTotal": 87.69
  },
  {
    "menuItemId": 1357,
    "quantity": 3,
    "unitPrice": 30.02,
    "lineTotal": 90.06
  },
  {
    "menuItemId": 1349,
    "quantity": 4,
    "unitPrice": 43.63,
    "lineTotal": 174.52
  },
  {
    "menuItemId": 1360,
    "quantity": 1,
    "unitPrice": 53.67,
    "lineTotal": 53.67
  },
  {
    "menuItemId": 1354,
    "quantity": 1,
    "unitPrice": 44.06,
    "lineTotal": 44.06
  }
]
            
subtotal
450
deliveryFee
1.48
tip
5.42
total
456.9
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 305,
  "userId": 29,
  "restaurantId": 93,
  "items": [
    {
      "menuItemId": 1350,
      "quantity": 3,
      "unitPrice": 29.23,
      "lineTotal": 87.69
    },
    {
      "menuItemId": 1357,
      "quantity": 3,
      "unitPrice": 30.02,
      "lineTotal": 90.06
    },
    {
      "menuItemId": 1349,
      "quantity": 4,
      "unitPrice": 43.63,
      "lineTotal": 174.52
    },
    {
      "menuItemId": 1360,
      "quantity": 1,
      "unitPrice": 53.67,
      "lineTotal": 53.67
    },
    {
      "menuItemId": 1354,
      "quantity": 1,
      "unitPrice": 44.06,
      "lineTotal": 44.06
    }
  ],
  "subtotal": 450,
  "deliveryFee": 1.48,
  "tip": 5.42,
  "total": 456.9,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-30T20:33:36.997Z",
  "deliveredAt": "2024-12-30T23:05:37.986Z"
}