example-data.com
Menu
Browse docs and collections

Overview

food-orders / #393

food-orders #393

userId
Joseph Steuber @joseph_steuber
restaurantId
Marks Inc · East Dena · ★ 4.1
items
              [
  {
    "menuItemId": 816,
    "quantity": 3,
    "unitPrice": 79.17,
    "lineTotal": 237.51
  },
  {
    "menuItemId": 802,
    "quantity": 3,
    "unitPrice": 40.53,
    "lineTotal": 121.59
  },
  {
    "menuItemId": 805,
    "quantity": 2,
    "unitPrice": 51.43,
    "lineTotal": 102.86
  },
  {
    "menuItemId": 814,
    "quantity": 1,
    "unitPrice": 35.5,
    "lineTotal": 35.5
  },
  {
    "menuItemId": 815,
    "quantity": 1,
    "unitPrice": 51.34,
    "lineTotal": 51.34
  }
]
            
subtotal
548.8
deliveryFee
4.96
tip
5.79
total
559.55
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 393,
  "userId": 221,
  "restaurantId": 54,
  "items": [
    {
      "menuItemId": 816,
      "quantity": 3,
      "unitPrice": 79.17,
      "lineTotal": 237.51
    },
    {
      "menuItemId": 802,
      "quantity": 3,
      "unitPrice": 40.53,
      "lineTotal": 121.59
    },
    {
      "menuItemId": 805,
      "quantity": 2,
      "unitPrice": 51.43,
      "lineTotal": 102.86
    },
    {
      "menuItemId": 814,
      "quantity": 1,
      "unitPrice": 35.5,
      "lineTotal": 35.5
    },
    {
      "menuItemId": 815,
      "quantity": 1,
      "unitPrice": 51.34,
      "lineTotal": 51.34
    }
  ],
  "subtotal": 548.8,
  "deliveryFee": 4.96,
  "tip": 5.79,
  "total": 559.55,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2024-06-20T22:22:13.776Z",
  "deliveredAt": null
}