example-data.com
Menu
Browse docs and collections

Overview

food-orders / #334

food-orders #334

userId
Jennifer Hoeger @jennifer.hoeger
restaurantId
Walsh LLC · Predovicville · ★ 4.8
items
              [
  {
    "menuItemId": 1450,
    "quantity": 4,
    "unitPrice": 40.3,
    "lineTotal": 161.2
  },
  {
    "menuItemId": 1446,
    "quantity": 1,
    "unitPrice": 57.38,
    "lineTotal": 57.38
  },
  {
    "menuItemId": 1447,
    "quantity": 3,
    "unitPrice": 32.07,
    "lineTotal": 96.21
  },
  {
    "menuItemId": 1449,
    "quantity": 4,
    "unitPrice": 51.99,
    "lineTotal": 207.96
  }
]
            
subtotal
522.75
deliveryFee
1.18
tip
2.88
total
526.81
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 334,
  "userId": 119,
  "restaurantId": 100,
  "items": [
    {
      "menuItemId": 1450,
      "quantity": 4,
      "unitPrice": 40.3,
      "lineTotal": 161.2
    },
    {
      "menuItemId": 1446,
      "quantity": 1,
      "unitPrice": 57.38,
      "lineTotal": 57.38
    },
    {
      "menuItemId": 1447,
      "quantity": 3,
      "unitPrice": 32.07,
      "lineTotal": 96.21
    },
    {
      "menuItemId": 1449,
      "quantity": 4,
      "unitPrice": 51.99,
      "lineTotal": 207.96
    }
  ],
  "subtotal": 522.75,
  "deliveryFee": 1.18,
  "tip": 2.88,
  "total": 526.81,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-24T19:06:20.181Z",
  "deliveredAt": "2024-12-24T20:09:29.479Z"
}