example-data.com
Menu
Browse docs and collections

Overview

food-orders / #460

food-orders #460

userId
Cayla Farrell @cayla_farrell
restaurantId
Mohr, Treutel and Watsica · East Felipa · ★ 4.6
items
              [
  {
    "menuItemId": 410,
    "quantity": 1,
    "unitPrice": 48.31,
    "lineTotal": 48.31
  },
  {
    "menuItemId": 402,
    "quantity": 4,
    "unitPrice": 42.4,
    "lineTotal": 169.6
  },
  {
    "menuItemId": 416,
    "quantity": 4,
    "unitPrice": 15.86,
    "lineTotal": 63.44
  }
]
            
subtotal
281.35
deliveryFee
4.62
tip
9.51
total
295.48
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 460,
  "userId": 4,
  "restaurantId": 27,
  "items": [
    {
      "menuItemId": 410,
      "quantity": 1,
      "unitPrice": 48.31,
      "lineTotal": 48.31
    },
    {
      "menuItemId": 402,
      "quantity": 4,
      "unitPrice": 42.4,
      "lineTotal": 169.6
    },
    {
      "menuItemId": 416,
      "quantity": 4,
      "unitPrice": 15.86,
      "lineTotal": 63.44
    }
  ],
  "subtotal": 281.35,
  "deliveryFee": 4.62,
  "tip": 9.51,
  "total": 295.48,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-19T02:19:53.868Z",
  "deliveredAt": "2024-12-19T03:45:49.720Z"
}