example-data.com
Menu
Browse docs and collections

Overview

food-orders / #79

food-orders #79

userId
Wilton Dietrich @wilton.dietrich23
restaurantId
Adams - Schimmel · Murrayburgh · ★ 2.7
items
              [
  {
    "menuItemId": 1203,
    "quantity": 3,
    "unitPrice": 17.44,
    "lineTotal": 52.32
  },
  {
    "menuItemId": 1196,
    "quantity": 1,
    "unitPrice": 57.29,
    "lineTotal": 57.29
  },
  {
    "menuItemId": 1201,
    "quantity": 3,
    "unitPrice": 73.92,
    "lineTotal": 221.76
  }
]
            
subtotal
331.37
deliveryFee
7.36
tip
6.49
total
345.22
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 79,
  "userId": 190,
  "restaurantId": 81,
  "items": [
    {
      "menuItemId": 1203,
      "quantity": 3,
      "unitPrice": 17.44,
      "lineTotal": 52.32
    },
    {
      "menuItemId": 1196,
      "quantity": 1,
      "unitPrice": 57.29,
      "lineTotal": 57.29
    },
    {
      "menuItemId": 1201,
      "quantity": 3,
      "unitPrice": 73.92,
      "lineTotal": 221.76
    }
  ],
  "subtotal": 331.37,
  "deliveryFee": 7.36,
  "tip": 6.49,
  "total": 345.22,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-09-23T08:27:28.513Z",
  "deliveredAt": "2024-09-23T11:26:18.354Z"
}