example-data.com
Menu
Browse docs and collections

Overview

food-orders / #417

food-orders #417

userId
Sandrine Osinski @sandrine.osinski
restaurantId
Mohr, Treutel and Watsica · East Felipa · ★ 4.6
items
              [
  {
    "menuItemId": 410,
    "quantity": 3,
    "unitPrice": 48.31,
    "lineTotal": 144.93
  },
  {
    "menuItemId": 409,
    "quantity": 2,
    "unitPrice": 38.74,
    "lineTotal": 77.48
  },
  {
    "menuItemId": 400,
    "quantity": 2,
    "unitPrice": 3.02,
    "lineTotal": 6.04
  },
  {
    "menuItemId": 411,
    "quantity": 1,
    "unitPrice": 58.13,
    "lineTotal": 58.13
  },
  {
    "menuItemId": 403,
    "quantity": 2,
    "unitPrice": 9.96,
    "lineTotal": 19.92
  }
]
            
subtotal
306.5
deliveryFee
1.43
tip
7.83
total
315.76
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 417,
  "userId": 157,
  "restaurantId": 27,
  "items": [
    {
      "menuItemId": 410,
      "quantity": 3,
      "unitPrice": 48.31,
      "lineTotal": 144.93
    },
    {
      "menuItemId": 409,
      "quantity": 2,
      "unitPrice": 38.74,
      "lineTotal": 77.48
    },
    {
      "menuItemId": 400,
      "quantity": 2,
      "unitPrice": 3.02,
      "lineTotal": 6.04
    },
    {
      "menuItemId": 411,
      "quantity": 1,
      "unitPrice": 58.13,
      "lineTotal": 58.13
    },
    {
      "menuItemId": 403,
      "quantity": 2,
      "unitPrice": 9.96,
      "lineTotal": 19.92
    }
  ],
  "subtotal": 306.5,
  "deliveryFee": 1.43,
  "tip": 7.83,
  "total": 315.76,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2025-03-31T18:16:49.054Z",
  "deliveredAt": null
}