example-data.com
Menu
Browse docs and collections

Overview

food-orders / #96

food-orders #96

userId
Maryam Kunze @maryam_kunze
restaurantId
Rogahn - Kreiger · South Cathrynside · ★ 4.6
items
              [
  {
    "menuItemId": 1218,
    "quantity": 2,
    "unitPrice": 41.46,
    "lineTotal": 82.92
  },
  {
    "menuItemId": 1208,
    "quantity": 2,
    "unitPrice": 18.29,
    "lineTotal": 36.58
  },
  {
    "menuItemId": 1215,
    "quantity": 4,
    "unitPrice": 53.02,
    "lineTotal": 212.08
  },
  {
    "menuItemId": 1211,
    "quantity": 2,
    "unitPrice": 9.51,
    "lineTotal": 19.02
  },
  {
    "menuItemId": 1209,
    "quantity": 4,
    "unitPrice": 45.24,
    "lineTotal": 180.96
  }
]
            
subtotal
531.56
deliveryFee
4.58
tip
10.07
total
546.21
currency
USD
status
out_for_delivery
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 96,
  "userId": 195,
  "restaurantId": 82,
  "items": [
    {
      "menuItemId": 1218,
      "quantity": 2,
      "unitPrice": 41.46,
      "lineTotal": 82.92
    },
    {
      "menuItemId": 1208,
      "quantity": 2,
      "unitPrice": 18.29,
      "lineTotal": 36.58
    },
    {
      "menuItemId": 1215,
      "quantity": 4,
      "unitPrice": 53.02,
      "lineTotal": 212.08
    },
    {
      "menuItemId": 1211,
      "quantity": 2,
      "unitPrice": 9.51,
      "lineTotal": 19.02
    },
    {
      "menuItemId": 1209,
      "quantity": 4,
      "unitPrice": 45.24,
      "lineTotal": 180.96
    }
  ],
  "subtotal": 531.56,
  "deliveryFee": 4.58,
  "tip": 10.07,
  "total": 546.21,
  "currency": "USD",
  "status": "out_for_delivery",
  "placedAt": "2024-06-08T19:36:03.707Z",
  "deliveredAt": null
}