example-data.com
Menu
Browse docs and collections

Overview

food-orders / #425

food-orders #425

userId
Cindy Barrows @cindy_barrows20
restaurantId
Hayes - McDermott · Lake Tanya · ★ 2.5
items
              [
  {
    "menuItemId": 1025,
    "quantity": 4,
    "unitPrice": 16.73,
    "lineTotal": 66.92
  },
  {
    "menuItemId": 1017,
    "quantity": 4,
    "unitPrice": 12.46,
    "lineTotal": 49.84
  },
  {
    "menuItemId": 1013,
    "quantity": 1,
    "unitPrice": 6.63,
    "lineTotal": 6.63
  },
  {
    "menuItemId": 1012,
    "quantity": 4,
    "unitPrice": 25.27,
    "lineTotal": 101.08
  }
]
            
subtotal
224.47
deliveryFee
0.54
tip
7.63
total
232.64
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 425,
  "userId": 165,
  "restaurantId": 68,
  "items": [
    {
      "menuItemId": 1025,
      "quantity": 4,
      "unitPrice": 16.73,
      "lineTotal": 66.92
    },
    {
      "menuItemId": 1017,
      "quantity": 4,
      "unitPrice": 12.46,
      "lineTotal": 49.84
    },
    {
      "menuItemId": 1013,
      "quantity": 1,
      "unitPrice": 6.63,
      "lineTotal": 6.63
    },
    {
      "menuItemId": 1012,
      "quantity": 4,
      "unitPrice": 25.27,
      "lineTotal": 101.08
    }
  ],
  "subtotal": 224.47,
  "deliveryFee": 0.54,
  "tip": 7.63,
  "total": 232.64,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-05-30T09:51:16.195Z",
  "deliveredAt": null
}