example-data.com
Menu
Browse docs and collections

Overview

food-orders / #339

food-orders #339

userId
Charlene Roberts @charlene_roberts
restaurantId
Aufderhar - Johns · East Lorenside · ★ 4.5
items
              [
  {
    "menuItemId": 1422,
    "quantity": 3,
    "unitPrice": 48.1,
    "lineTotal": 144.3
  },
  {
    "menuItemId": 1426,
    "quantity": 2,
    "unitPrice": 75.59,
    "lineTotal": 151.18
  },
  {
    "menuItemId": 1427,
    "quantity": 2,
    "unitPrice": 24.79,
    "lineTotal": 49.58
  },
  {
    "menuItemId": 1423,
    "quantity": 3,
    "unitPrice": 73.02,
    "lineTotal": 219.06
  },
  {
    "menuItemId": 1424,
    "quantity": 1,
    "unitPrice": 65.44,
    "lineTotal": 65.44
  }
]
            
subtotal
629.56
deliveryFee
2.07
tip
6.41
total
638.04
currency
USD
status
cancelled
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 339,
  "userId": 1,
  "restaurantId": 98,
  "items": [
    {
      "menuItemId": 1422,
      "quantity": 3,
      "unitPrice": 48.1,
      "lineTotal": 144.3
    },
    {
      "menuItemId": 1426,
      "quantity": 2,
      "unitPrice": 75.59,
      "lineTotal": 151.18
    },
    {
      "menuItemId": 1427,
      "quantity": 2,
      "unitPrice": 24.79,
      "lineTotal": 49.58
    },
    {
      "menuItemId": 1423,
      "quantity": 3,
      "unitPrice": 73.02,
      "lineTotal": 219.06
    },
    {
      "menuItemId": 1424,
      "quantity": 1,
      "unitPrice": 65.44,
      "lineTotal": 65.44
    }
  ],
  "subtotal": 629.56,
  "deliveryFee": 2.07,
  "tip": 6.41,
  "total": 638.04,
  "currency": "USD",
  "status": "cancelled",
  "placedAt": "2025-02-04T02:51:07.031Z",
  "deliveredAt": null
}