example-data.com
Menu
Browse docs and collections

Overview

food-orders / #317

food-orders #317

userId
Gudrun Brakus @gudrun_brakus
restaurantId
Douglas Group · New Cletastead · ★ 3.3
items
              [
  {
    "menuItemId": 940,
    "quantity": 4,
    "unitPrice": 58.2,
    "lineTotal": 232.8
  },
  {
    "menuItemId": 941,
    "quantity": 3,
    "unitPrice": 44.97,
    "lineTotal": 134.91
  }
]
            
subtotal
367.71
deliveryFee
6.33
tip
5.23
total
379.27
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 317,
  "userId": 230,
  "restaurantId": 62,
  "items": [
    {
      "menuItemId": 940,
      "quantity": 4,
      "unitPrice": 58.2,
      "lineTotal": 232.8
    },
    {
      "menuItemId": 941,
      "quantity": 3,
      "unitPrice": 44.97,
      "lineTotal": 134.91
    }
  ],
  "subtotal": 367.71,
  "deliveryFee": 6.33,
  "tip": 5.23,
  "total": 379.27,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2025-03-23T14:56:52.016Z",
  "deliveredAt": "2025-03-23T18:27:18.876Z"
}