example-data.com
Menu
Browse docs and collections

Overview

food-orders / #250

food-orders #250

userId
Florencio Mohr @florencio_mohr
restaurantId
McGlynn, Bosco and Gusikowski · Altadena · ★ 3.8
items
              [
  {
    "menuItemId": 486,
    "quantity": 4,
    "unitPrice": 14.76,
    "lineTotal": 59.04
  },
  {
    "menuItemId": 482,
    "quantity": 2,
    "unitPrice": 26.11,
    "lineTotal": 52.22
  },
  {
    "menuItemId": 487,
    "quantity": 3,
    "unitPrice": 67.86,
    "lineTotal": 203.58
  }
]
            
subtotal
314.84
deliveryFee
7.87
tip
6.13
total
328.84
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 250,
  "userId": 71,
  "restaurantId": 33,
  "items": [
    {
      "menuItemId": 486,
      "quantity": 4,
      "unitPrice": 14.76,
      "lineTotal": 59.04
    },
    {
      "menuItemId": 482,
      "quantity": 2,
      "unitPrice": 26.11,
      "lineTotal": 52.22
    },
    {
      "menuItemId": 487,
      "quantity": 3,
      "unitPrice": 67.86,
      "lineTotal": 203.58
    }
  ],
  "subtotal": 314.84,
  "deliveryFee": 7.87,
  "tip": 6.13,
  "total": 328.84,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-05-28T15:56:15.994Z",
  "deliveredAt": "2024-05-28T18:48:42.309Z"
}