example-data.com
Menu
Browse docs and collections

Overview

food-orders / #314

food-orders #314

userId
Jensen Bashirian @jensen_bashirian
restaurantId
Hauck, Larson and West · Port Shayna · ★ 4.4
items
              [
  {
    "menuItemId": 1093,
    "quantity": 3,
    "unitPrice": 30.64,
    "lineTotal": 91.92
  },
  {
    "menuItemId": 1090,
    "quantity": 4,
    "unitPrice": 27.34,
    "lineTotal": 109.36
  },
  {
    "menuItemId": 1094,
    "quantity": 3,
    "unitPrice": 40.46,
    "lineTotal": 121.38
  }
]
            
subtotal
322.66
deliveryFee
1.32
tip
9.53
total
333.51
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 314,
  "userId": 29,
  "restaurantId": 73,
  "items": [
    {
      "menuItemId": 1093,
      "quantity": 3,
      "unitPrice": 30.64,
      "lineTotal": 91.92
    },
    {
      "menuItemId": 1090,
      "quantity": 4,
      "unitPrice": 27.34,
      "lineTotal": 109.36
    },
    {
      "menuItemId": 1094,
      "quantity": 3,
      "unitPrice": 40.46,
      "lineTotal": 121.38
    }
  ],
  "subtotal": 322.66,
  "deliveryFee": 1.32,
  "tip": 9.53,
  "total": 333.51,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-09-22T18:00:37.826Z",
  "deliveredAt": "2024-09-22T21:50:49.719Z"
}