example-data.com
Menu
Browse docs and collections

Overview

food-orders / #281

food-orders #281

userId
Ike Breitenberg @ike.breitenberg
restaurantId
Hamill, Flatley and Pfeffer · North Trevacester · ★ 4.3
items
              [
  {
    "menuItemId": 778,
    "quantity": 4,
    "unitPrice": 41.69,
    "lineTotal": 166.76
  },
  {
    "menuItemId": 777,
    "quantity": 2,
    "unitPrice": 32.68,
    "lineTotal": 65.36
  },
  {
    "menuItemId": 769,
    "quantity": 1,
    "unitPrice": 13.47,
    "lineTotal": 13.47
  },
  {
    "menuItemId": 766,
    "quantity": 1,
    "unitPrice": 5.29,
    "lineTotal": 5.29
  },
  {
    "menuItemId": 771,
    "quantity": 4,
    "unitPrice": 17.95,
    "lineTotal": 71.8
  }
]
            
subtotal
322.68
deliveryFee
6.14
tip
1.18
total
330
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 281,
  "userId": 72,
  "restaurantId": 51,
  "items": [
    {
      "menuItemId": 778,
      "quantity": 4,
      "unitPrice": 41.69,
      "lineTotal": 166.76
    },
    {
      "menuItemId": 777,
      "quantity": 2,
      "unitPrice": 32.68,
      "lineTotal": 65.36
    },
    {
      "menuItemId": 769,
      "quantity": 1,
      "unitPrice": 13.47,
      "lineTotal": 13.47
    },
    {
      "menuItemId": 766,
      "quantity": 1,
      "unitPrice": 5.29,
      "lineTotal": 5.29
    },
    {
      "menuItemId": 771,
      "quantity": 4,
      "unitPrice": 17.95,
      "lineTotal": 71.8
    }
  ],
  "subtotal": 322.68,
  "deliveryFee": 6.14,
  "tip": 1.18,
  "total": 330,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-06-10T11:22:01.279Z",
  "deliveredAt": null
}