example-data.com
Menu
Browse docs and collections

Overview

food-orders / #322

food-orders #322

userId
Jermain Kshlerin @jermain_kshlerin51
restaurantId
Harber, Wolf and Reynolds · Providencifurt · ★ 4.5
items
              [
  {
    "menuItemId": 31,
    "quantity": 1,
    "unitPrice": 69.17,
    "lineTotal": 69.17
  },
  {
    "menuItemId": 33,
    "quantity": 3,
    "unitPrice": 28.94,
    "lineTotal": 86.82
  },
  {
    "menuItemId": 32,
    "quantity": 3,
    "unitPrice": 48.94,
    "lineTotal": 146.82
  },
  {
    "menuItemId": 30,
    "quantity": 3,
    "unitPrice": 76.01,
    "lineTotal": 228.03
  },
  {
    "menuItemId": 35,
    "quantity": 3,
    "unitPrice": 35.98,
    "lineTotal": 107.94
  }
]
            
subtotal
638.78
deliveryFee
6.63
tip
10.29
total
655.7
currency
USD
status
preparing
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 322,
  "userId": 104,
  "restaurantId": 3,
  "items": [
    {
      "menuItemId": 31,
      "quantity": 1,
      "unitPrice": 69.17,
      "lineTotal": 69.17
    },
    {
      "menuItemId": 33,
      "quantity": 3,
      "unitPrice": 28.94,
      "lineTotal": 86.82
    },
    {
      "menuItemId": 32,
      "quantity": 3,
      "unitPrice": 48.94,
      "lineTotal": 146.82
    },
    {
      "menuItemId": 30,
      "quantity": 3,
      "unitPrice": 76.01,
      "lineTotal": 228.03
    },
    {
      "menuItemId": 35,
      "quantity": 3,
      "unitPrice": 35.98,
      "lineTotal": 107.94
    }
  ],
  "subtotal": 638.78,
  "deliveryFee": 6.63,
  "tip": 10.29,
  "total": 655.7,
  "currency": "USD",
  "status": "preparing",
  "placedAt": "2024-08-08T11:14:15.361Z",
  "deliveredAt": null
}