example-data.com
Menu
Browse docs and collections

Overview

food-orders / #463

food-orders #463

userId
Autumn Bartell @autumn.bartell95
restaurantId
Durgan Group · Fort Collins · ★ 3.1
items
              [
  {
    "menuItemId": 47,
    "quantity": 2,
    "unitPrice": 56.05,
    "lineTotal": 112.1
  },
  {
    "menuItemId": 46,
    "quantity": 2,
    "unitPrice": 17.44,
    "lineTotal": 34.88
  },
  {
    "menuItemId": 49,
    "quantity": 2,
    "unitPrice": 78.67,
    "lineTotal": 157.34
  },
  {
    "menuItemId": 51,
    "quantity": 1,
    "unitPrice": 58.78,
    "lineTotal": 58.78
  },
  {
    "menuItemId": 48,
    "quantity": 1,
    "unitPrice": 57.67,
    "lineTotal": 57.67
  }
]
            
subtotal
420.77
deliveryFee
4.86
tip
7.5
total
433.13
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 463,
  "userId": 58,
  "restaurantId": 5,
  "items": [
    {
      "menuItemId": 47,
      "quantity": 2,
      "unitPrice": 56.05,
      "lineTotal": 112.1
    },
    {
      "menuItemId": 46,
      "quantity": 2,
      "unitPrice": 17.44,
      "lineTotal": 34.88
    },
    {
      "menuItemId": 49,
      "quantity": 2,
      "unitPrice": 78.67,
      "lineTotal": 157.34
    },
    {
      "menuItemId": 51,
      "quantity": 1,
      "unitPrice": 58.78,
      "lineTotal": 58.78
    },
    {
      "menuItemId": 48,
      "quantity": 1,
      "unitPrice": 57.67,
      "lineTotal": 57.67
    }
  ],
  "subtotal": 420.77,
  "deliveryFee": 4.86,
  "tip": 7.5,
  "total": 433.13,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-06-02T05:27:26.939Z",
  "deliveredAt": "2024-06-02T08:25:49.379Z"
}