example-data.com
Menu
Browse docs and collections

Overview

food-orders / #380

food-orders #380

userId
Norbert Jacobi @norbert_jacobi92
restaurantId
Bartoletti LLC · Shannychester · ★ 3.3
items
              [
  {
    "menuItemId": 741,
    "quantity": 1,
    "unitPrice": 13.79,
    "lineTotal": 13.79
  },
  {
    "menuItemId": 750,
    "quantity": 3,
    "unitPrice": 3.17,
    "lineTotal": 9.51
  }
]
            
subtotal
23.3
deliveryFee
2.81
tip
0.54
total
26.65
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 380,
  "userId": 101,
  "restaurantId": 49,
  "items": [
    {
      "menuItemId": 741,
      "quantity": 1,
      "unitPrice": 13.79,
      "lineTotal": 13.79
    },
    {
      "menuItemId": 750,
      "quantity": 3,
      "unitPrice": 3.17,
      "lineTotal": 9.51
    }
  ],
  "subtotal": 23.3,
  "deliveryFee": 2.81,
  "tip": 0.54,
  "total": 26.65,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-09-09T16:26:38.433Z",
  "deliveredAt": null
}