example-data.com
Menu
Browse docs and collections

Overview

food-orders / #358

food-orders #358

userId
Maymie Boehm @maymie.boehm90
restaurantId
Aufderhar - Johns · East Lorenside · ★ 4.5
items
              [
  {
    "menuItemId": 1428,
    "quantity": 3,
    "unitPrice": 48.68,
    "lineTotal": 146.04
  },
  {
    "menuItemId": 1417,
    "quantity": 3,
    "unitPrice": 20.71,
    "lineTotal": 62.13
  }
]
            
subtotal
208.17
deliveryFee
1.35
tip
9.86
total
219.38
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 358,
  "userId": 48,
  "restaurantId": 98,
  "items": [
    {
      "menuItemId": 1428,
      "quantity": 3,
      "unitPrice": 48.68,
      "lineTotal": 146.04
    },
    {
      "menuItemId": 1417,
      "quantity": 3,
      "unitPrice": 20.71,
      "lineTotal": 62.13
    }
  ],
  "subtotal": 208.17,
  "deliveryFee": 1.35,
  "tip": 9.86,
  "total": 219.38,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2024-06-29T23:27:04.354Z",
  "deliveredAt": null
}