example-data.com
Menu
Browse docs and collections

Overview

food-orders / #263

food-orders #263

userId
Myrtie Daniel @myrtie_daniel33
restaurantId
Spinka, Runolfsdottir and Brown · Costa Mesa · ★ 3.1
items
              [
  {
    "menuItemId": 1266,
    "quantity": 4,
    "unitPrice": 21.83,
    "lineTotal": 87.32
  },
  {
    "menuItemId": 1265,
    "quantity": 2,
    "unitPrice": 58.27,
    "lineTotal": 116.54
  },
  {
    "menuItemId": 1268,
    "quantity": 2,
    "unitPrice": 63.73,
    "lineTotal": 127.46
  }
]
            
subtotal
331.32
deliveryFee
7.05
tip
9.3
total
347.67
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 263,
  "userId": 45,
  "restaurantId": 87,
  "items": [
    {
      "menuItemId": 1266,
      "quantity": 4,
      "unitPrice": 21.83,
      "lineTotal": 87.32
    },
    {
      "menuItemId": 1265,
      "quantity": 2,
      "unitPrice": 58.27,
      "lineTotal": 116.54
    },
    {
      "menuItemId": 1268,
      "quantity": 2,
      "unitPrice": 63.73,
      "lineTotal": 127.46
    }
  ],
  "subtotal": 331.32,
  "deliveryFee": 7.05,
  "tip": 9.3,
  "total": 347.67,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-11-28T03:23:38.156Z",
  "deliveredAt": null
}