example-data.com
Menu
Browse docs and collections

Overview

food-orders / #431

food-orders #431

userId
Douglas Frami @douglas.frami
restaurantId
Blanda and Sons · New Odashire · ★ 4.1
items
              [
  {
    "menuItemId": 888,
    "quantity": 4,
    "unitPrice": 7.53,
    "lineTotal": 30.12
  },
  {
    "menuItemId": 898,
    "quantity": 3,
    "unitPrice": 4.07,
    "lineTotal": 12.21
  },
  {
    "menuItemId": 891,
    "quantity": 2,
    "unitPrice": 17.02,
    "lineTotal": 34.04
  },
  {
    "menuItemId": 889,
    "quantity": 1,
    "unitPrice": 9.6,
    "lineTotal": 9.6
  },
  {
    "menuItemId": 895,
    "quantity": 4,
    "unitPrice": 14.83,
    "lineTotal": 59.32
  }
]
            
subtotal
145.29
deliveryFee
5.3
tip
5.69
total
156.28
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 431,
  "userId": 148,
  "restaurantId": 59,
  "items": [
    {
      "menuItemId": 888,
      "quantity": 4,
      "unitPrice": 7.53,
      "lineTotal": 30.12
    },
    {
      "menuItemId": 898,
      "quantity": 3,
      "unitPrice": 4.07,
      "lineTotal": 12.21
    },
    {
      "menuItemId": 891,
      "quantity": 2,
      "unitPrice": 17.02,
      "lineTotal": 34.04
    },
    {
      "menuItemId": 889,
      "quantity": 1,
      "unitPrice": 9.6,
      "lineTotal": 9.6
    },
    {
      "menuItemId": 895,
      "quantity": 4,
      "unitPrice": 14.83,
      "lineTotal": 59.32
    }
  ],
  "subtotal": 145.29,
  "deliveryFee": 5.3,
  "tip": 5.69,
  "total": 156.28,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-12-24T02:32:26.651Z",
  "deliveredAt": "2024-12-24T05:49:46.494Z"
}