example-data.com
Menu
Browse docs and collections

Overview

food-orders / #7

food-orders #7

userId
Maryam Kunze @maryam_kunze
restaurantId
Pouros, O'Reilly and Block · Lake Chandler · ★ 3.5
items
              [
  {
    "menuItemId": 703,
    "quantity": 1,
    "unitPrice": 48.53,
    "lineTotal": 48.53
  },
  {
    "menuItemId": 724,
    "quantity": 3,
    "unitPrice": 73.54,
    "lineTotal": 220.62
  },
  {
    "menuItemId": 705,
    "quantity": 2,
    "unitPrice": 49.17,
    "lineTotal": 98.34
  }
]
            
subtotal
367.49
deliveryFee
0.41
tip
11.17
total
379.07
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 7,
  "userId": 195,
  "restaurantId": 47,
  "items": [
    {
      "menuItemId": 703,
      "quantity": 1,
      "unitPrice": 48.53,
      "lineTotal": 48.53
    },
    {
      "menuItemId": 724,
      "quantity": 3,
      "unitPrice": 73.54,
      "lineTotal": 220.62
    },
    {
      "menuItemId": 705,
      "quantity": 2,
      "unitPrice": 49.17,
      "lineTotal": 98.34
    }
  ],
  "subtotal": 367.49,
  "deliveryFee": 0.41,
  "tip": 11.17,
  "total": 379.07,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-11-04T04:54:09.974Z",
  "deliveredAt": "2024-11-04T08:10:31.321Z"
}