example-data.com
Menu
Browse docs and collections

Overview

food-orders / #260

food-orders #260

userId
Enos Hamill @enos_hamill
restaurantId
Blanda and Sons · New Odashire · ★ 4.1
items
              [
  {
    "menuItemId": 890,
    "quantity": 3,
    "unitPrice": 40.41,
    "lineTotal": 121.23
  },
  {
    "menuItemId": 889,
    "quantity": 1,
    "unitPrice": 9.6,
    "lineTotal": 9.6
  },
  {
    "menuItemId": 902,
    "quantity": 4,
    "unitPrice": 11.61,
    "lineTotal": 46.44
  },
  {
    "menuItemId": 900,
    "quantity": 3,
    "unitPrice": 31.5,
    "lineTotal": 94.5
  },
  {
    "menuItemId": 898,
    "quantity": 3,
    "unitPrice": 4.07,
    "lineTotal": 12.21
  }
]
            
subtotal
283.98
deliveryFee
0.16
tip
4.23
total
288.37
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 260,
  "userId": 65,
  "restaurantId": 59,
  "items": [
    {
      "menuItemId": 890,
      "quantity": 3,
      "unitPrice": 40.41,
      "lineTotal": 121.23
    },
    {
      "menuItemId": 889,
      "quantity": 1,
      "unitPrice": 9.6,
      "lineTotal": 9.6
    },
    {
      "menuItemId": 902,
      "quantity": 4,
      "unitPrice": 11.61,
      "lineTotal": 46.44
    },
    {
      "menuItemId": 900,
      "quantity": 3,
      "unitPrice": 31.5,
      "lineTotal": 94.5
    },
    {
      "menuItemId": 898,
      "quantity": 3,
      "unitPrice": 4.07,
      "lineTotal": 12.21
    }
  ],
  "subtotal": 283.98,
  "deliveryFee": 0.16,
  "tip": 4.23,
  "total": 288.37,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2025-01-02T03:35:32.495Z",
  "deliveredAt": null
}