example-data.com
Menu
Browse docs and collections

Overview

food-orders / #160

food-orders #160

userId
Lazaro Herzog @lazaro_herzog
restaurantId
Hills Group · North Jaylincester · ★ 2.5
items
              [
  {
    "menuItemId": 968,
    "quantity": 2,
    "unitPrice": 53.18,
    "lineTotal": 106.36
  },
  {
    "menuItemId": 966,
    "quantity": 2,
    "unitPrice": 30.7,
    "lineTotal": 61.4
  }
]
            
subtotal
167.76
deliveryFee
0.16
tip
10.03
total
177.95
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 160,
  "userId": 181,
  "restaurantId": 64,
  "items": [
    {
      "menuItemId": 968,
      "quantity": 2,
      "unitPrice": 53.18,
      "lineTotal": 106.36
    },
    {
      "menuItemId": 966,
      "quantity": 2,
      "unitPrice": 30.7,
      "lineTotal": 61.4
    }
  ],
  "subtotal": 167.76,
  "deliveryFee": 0.16,
  "tip": 10.03,
  "total": 177.95,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-09-23T11:07:08.168Z",
  "deliveredAt": null
}