example-data.com
Menu
Browse docs and collections

Overview

food-orders / #461

food-orders #461

userId
Esperanza Casper @esperanza_casper
restaurantId
Mayert LLC · Darianaburgh · ★ 4.4
items
              [
  {
    "menuItemId": 524,
    "quantity": 2,
    "unitPrice": 78.69,
    "lineTotal": 157.38
  },
  {
    "menuItemId": 522,
    "quantity": 2,
    "unitPrice": 69.8,
    "lineTotal": 139.6
  },
  {
    "menuItemId": 529,
    "quantity": 2,
    "unitPrice": 24.05,
    "lineTotal": 48.1
  }
]
            
subtotal
345.08
deliveryFee
3.28
tip
7.54
total
355.9
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 461,
  "userId": 97,
  "restaurantId": 36,
  "items": [
    {
      "menuItemId": 524,
      "quantity": 2,
      "unitPrice": 78.69,
      "lineTotal": 157.38
    },
    {
      "menuItemId": 522,
      "quantity": 2,
      "unitPrice": 69.8,
      "lineTotal": 139.6
    },
    {
      "menuItemId": 529,
      "quantity": 2,
      "unitPrice": 24.05,
      "lineTotal": 48.1
    }
  ],
  "subtotal": 345.08,
  "deliveryFee": 3.28,
  "tip": 7.54,
  "total": 355.9,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-08-06T05:55:04.004Z",
  "deliveredAt": "2024-08-06T07:01:16.429Z"
}