example-data.com
Menu
Browse docs and collections

Overview

food-orders / #381

food-orders #381

userId
Hermina West @hermina.west3
restaurantId
Huel, Stark and Zulauf · Zoiemouth · ★ 2.7
items
              [
  {
    "menuItemId": 1006,
    "quantity": 3,
    "unitPrice": 51.33,
    "lineTotal": 153.99
  },
  {
    "menuItemId": 1009,
    "quantity": 3,
    "unitPrice": 53.8,
    "lineTotal": 161.4
  },
  {
    "menuItemId": 1007,
    "quantity": 4,
    "unitPrice": 26.43,
    "lineTotal": 105.72
  },
  {
    "menuItemId": 1004,
    "quantity": 1,
    "unitPrice": 73.14,
    "lineTotal": 73.14
  },
  {
    "menuItemId": 1008,
    "quantity": 4,
    "unitPrice": 25.37,
    "lineTotal": 101.48
  }
]
            
subtotal
595.73
deliveryFee
7.57
tip
10.72
total
614.02
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 381,
  "userId": 51,
  "restaurantId": 67,
  "items": [
    {
      "menuItemId": 1006,
      "quantity": 3,
      "unitPrice": 51.33,
      "lineTotal": 153.99
    },
    {
      "menuItemId": 1009,
      "quantity": 3,
      "unitPrice": 53.8,
      "lineTotal": 161.4
    },
    {
      "menuItemId": 1007,
      "quantity": 4,
      "unitPrice": 26.43,
      "lineTotal": 105.72
    },
    {
      "menuItemId": 1004,
      "quantity": 1,
      "unitPrice": 73.14,
      "lineTotal": 73.14
    },
    {
      "menuItemId": 1008,
      "quantity": 4,
      "unitPrice": 25.37,
      "lineTotal": 101.48
    }
  ],
  "subtotal": 595.73,
  "deliveryFee": 7.57,
  "tip": 10.72,
  "total": 614.02,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-12-29T16:56:12.750Z",
  "deliveredAt": null
}