example-data.com
Menu
Browse docs and collections

Overview

food-orders / #83

food-orders #83

userId
Phyllis Hyatt @phyllis_hyatt83
restaurantId
Gulgowski, Terry and Funk · North Stephaniefort · ★ 4.9
items
              [
  {
    "menuItemId": 650,
    "quantity": 2,
    "unitPrice": 51,
    "lineTotal": 102
  },
  {
    "menuItemId": 658,
    "quantity": 4,
    "unitPrice": 28.13,
    "lineTotal": 112.52
  },
  {
    "menuItemId": 639,
    "quantity": 1,
    "unitPrice": 39.16,
    "lineTotal": 39.16
  }
]
            
subtotal
253.68
deliveryFee
1.15
tip
5.97
total
260.8
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 83,
  "userId": 84,
  "restaurantId": 44,
  "items": [
    {
      "menuItemId": 650,
      "quantity": 2,
      "unitPrice": 51,
      "lineTotal": 102
    },
    {
      "menuItemId": 658,
      "quantity": 4,
      "unitPrice": 28.13,
      "lineTotal": 112.52
    },
    {
      "menuItemId": 639,
      "quantity": 1,
      "unitPrice": 39.16,
      "lineTotal": 39.16
    }
  ],
  "subtotal": 253.68,
  "deliveryFee": 1.15,
  "tip": 5.97,
  "total": 260.8,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-06T17:02:25.729Z",
  "deliveredAt": "2024-12-06T19:57:15.345Z"
}