example-data.com
Menu
Browse docs and collections

Overview

food-orders / #399

food-orders #399

userId
Edward Jacobson @edward_jacobson38
restaurantId
Ferry LLC · South Gilbertoton · ★ 3.8
items
              [
  {
    "menuItemId": 857,
    "quantity": 3,
    "unitPrice": 50.69,
    "lineTotal": 152.07
  },
  {
    "menuItemId": 863,
    "quantity": 1,
    "unitPrice": 29.07,
    "lineTotal": 29.07
  },
  {
    "menuItemId": 852,
    "quantity": 3,
    "unitPrice": 72.01,
    "lineTotal": 216.03
  },
  {
    "menuItemId": 853,
    "quantity": 1,
    "unitPrice": 25.25,
    "lineTotal": 25.25
  }
]
            
subtotal
422.42
deliveryFee
3.84
tip
7.72
total
433.98
currency
USD
status
delivered
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 399,
  "userId": 38,
  "restaurantId": 57,
  "items": [
    {
      "menuItemId": 857,
      "quantity": 3,
      "unitPrice": 50.69,
      "lineTotal": 152.07
    },
    {
      "menuItemId": 863,
      "quantity": 1,
      "unitPrice": 29.07,
      "lineTotal": 29.07
    },
    {
      "menuItemId": 852,
      "quantity": 3,
      "unitPrice": 72.01,
      "lineTotal": 216.03
    },
    {
      "menuItemId": 853,
      "quantity": 1,
      "unitPrice": 25.25,
      "lineTotal": 25.25
    }
  ],
  "subtotal": 422.42,
  "deliveryFee": 3.84,
  "tip": 7.72,
  "total": 433.98,
  "currency": "USD",
  "status": "delivered",
  "placedAt": "2024-07-09T21:33:46.107Z",
  "deliveredAt": "2024-07-10T01:26:32.803Z"
}