example-data.com
Menu
Browse docs and collections

Overview

food-orders / #103

food-orders #103

userId
Gerald Lind @gerald_lind57
restaurantId
Heller Group · North Jarret · ★ 4.9
items
              [
  {
    "menuItemId": 167,
    "quantity": 1,
    "unitPrice": 48.32,
    "lineTotal": 48.32
  },
  {
    "menuItemId": 163,
    "quantity": 3,
    "unitPrice": 43.88,
    "lineTotal": 131.64
  },
  {
    "menuItemId": 181,
    "quantity": 3,
    "unitPrice": 30.68,
    "lineTotal": 92.04
  },
  {
    "menuItemId": 166,
    "quantity": 2,
    "unitPrice": 46.36,
    "lineTotal": 92.72
  }
]
            
subtotal
364.72
deliveryFee
1.18
tip
9.18
total
375.08
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 103,
  "userId": 179,
  "restaurantId": 12,
  "items": [
    {
      "menuItemId": 167,
      "quantity": 1,
      "unitPrice": 48.32,
      "lineTotal": 48.32
    },
    {
      "menuItemId": 163,
      "quantity": 3,
      "unitPrice": 43.88,
      "lineTotal": 131.64
    },
    {
      "menuItemId": 181,
      "quantity": 3,
      "unitPrice": 30.68,
      "lineTotal": 92.04
    },
    {
      "menuItemId": 166,
      "quantity": 2,
      "unitPrice": 46.36,
      "lineTotal": 92.72
    }
  ],
  "subtotal": 364.72,
  "deliveryFee": 1.18,
  "tip": 9.18,
  "total": 375.08,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-09-10T16:49:17.195Z",
  "deliveredAt": "2024-09-10T20:45:27.596Z"
}