example-data.com
Menu
Browse docs and collections

Overview

food-orders / #484

food-orders #484

userId
Mathilde Ziemann-Nienow @mathilde.ziemann-nienow6
restaurantId
Larson Group · Lehnerville · ★ 2.9
items
              [
  {
    "menuItemId": 518,
    "quantity": 2,
    "unitPrice": 73.88,
    "lineTotal": 147.76
  },
  {
    "menuItemId": 517,
    "quantity": 2,
    "unitPrice": 56.54,
    "lineTotal": 113.08
  },
  {
    "menuItemId": 520,
    "quantity": 3,
    "unitPrice": 18.41,
    "lineTotal": 55.23
  },
  {
    "menuItemId": 519,
    "quantity": 4,
    "unitPrice": 64.62,
    "lineTotal": 258.48
  }
]
            
subtotal
574.55
deliveryFee
1.57
tip
0.63
total
576.75
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 484,
  "userId": 202,
  "restaurantId": 35,
  "items": [
    {
      "menuItemId": 518,
      "quantity": 2,
      "unitPrice": 73.88,
      "lineTotal": 147.76
    },
    {
      "menuItemId": 517,
      "quantity": 2,
      "unitPrice": 56.54,
      "lineTotal": 113.08
    },
    {
      "menuItemId": 520,
      "quantity": 3,
      "unitPrice": 18.41,
      "lineTotal": 55.23
    },
    {
      "menuItemId": 519,
      "quantity": 4,
      "unitPrice": 64.62,
      "lineTotal": 258.48
    }
  ],
  "subtotal": 574.55,
  "deliveryFee": 1.57,
  "tip": 0.63,
  "total": 576.75,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-06-28T00:38:18.112Z",
  "deliveredAt": null
}