example-data.com
Menu
Browse docs and collections

Overview

food-orders / #436

food-orders #436

userId
Matilde Beahan @matilde_beahan
restaurantId
Simonis - Kshlerin · Stanleybury · ★ 2.8
items
              [
  {
    "menuItemId": 668,
    "quantity": 3,
    "unitPrice": 49.48,
    "lineTotal": 148.44
  },
  {
    "menuItemId": 673,
    "quantity": 1,
    "unitPrice": 63.75,
    "lineTotal": 63.75
  },
  {
    "menuItemId": 670,
    "quantity": 2,
    "unitPrice": 75.47,
    "lineTotal": 150.94
  },
  {
    "menuItemId": 679,
    "quantity": 4,
    "unitPrice": 37.88,
    "lineTotal": 151.52
  }
]
            
subtotal
514.65
deliveryFee
5.79
tip
6.12
total
526.56
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 436,
  "userId": 96,
  "restaurantId": 45,
  "items": [
    {
      "menuItemId": 668,
      "quantity": 3,
      "unitPrice": 49.48,
      "lineTotal": 148.44
    },
    {
      "menuItemId": 673,
      "quantity": 1,
      "unitPrice": 63.75,
      "lineTotal": 63.75
    },
    {
      "menuItemId": 670,
      "quantity": 2,
      "unitPrice": 75.47,
      "lineTotal": 150.94
    },
    {
      "menuItemId": 679,
      "quantity": 4,
      "unitPrice": 37.88,
      "lineTotal": 151.52
    }
  ],
  "subtotal": 514.65,
  "deliveryFee": 5.79,
  "tip": 6.12,
  "total": 526.56,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-08-08T23:59:41.058Z",
  "deliveredAt": "2024-08-09T02:08:19.534Z"
}