example-data.com
Menu
Browse docs and collections

Overview

food-orders / #312

food-orders #312

userId
Jameson Considine @jameson.considine1
restaurantId
Simonis, Reynolds and Harber · Dahliastead · ★ 3.5
items
              [
  {
    "menuItemId": 265,
    "quantity": 1,
    "unitPrice": 27.81,
    "lineTotal": 27.81
  },
  {
    "menuItemId": 269,
    "quantity": 1,
    "unitPrice": 66.78,
    "lineTotal": 66.78
  },
  {
    "menuItemId": 256,
    "quantity": 2,
    "unitPrice": 6.93,
    "lineTotal": 13.86
  },
  {
    "menuItemId": 257,
    "quantity": 2,
    "unitPrice": 45.12,
    "lineTotal": 90.24
  }
]
            
subtotal
198.69
deliveryFee
2.43
tip
9.66
total
210.78
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 312,
  "userId": 236,
  "restaurantId": 17,
  "items": [
    {
      "menuItemId": 265,
      "quantity": 1,
      "unitPrice": 27.81,
      "lineTotal": 27.81
    },
    {
      "menuItemId": 269,
      "quantity": 1,
      "unitPrice": 66.78,
      "lineTotal": 66.78
    },
    {
      "menuItemId": 256,
      "quantity": 2,
      "unitPrice": 6.93,
      "lineTotal": 13.86
    },
    {
      "menuItemId": 257,
      "quantity": 2,
      "unitPrice": 45.12,
      "lineTotal": 90.24
    }
  ],
  "subtotal": 198.69,
  "deliveryFee": 2.43,
  "tip": 9.66,
  "total": 210.78,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2024-12-30T03:25:38.676Z",
  "deliveredAt": null
}