example-data.com
Menu
Browse docs and collections

Overview

food-orders / #403

food-orders #403

userId
Alexa Rippin @alexa_rippin25
restaurantId
Haley, Denesik and Walker · Port Chloe · ★ 3.3
items
              [
  {
    "menuItemId": 1436,
    "quantity": 1,
    "unitPrice": 34.63,
    "lineTotal": 34.63
  },
  {
    "menuItemId": 1432,
    "quantity": 4,
    "unitPrice": 13.28,
    "lineTotal": 53.12
  }
]
            
subtotal
87.75
deliveryFee
6.12
tip
0.79
total
94.66
currency
USD
status
placed
placedAt
deliveredAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 403,
  "userId": 235,
  "restaurantId": 99,
  "items": [
    {
      "menuItemId": 1436,
      "quantity": 1,
      "unitPrice": 34.63,
      "lineTotal": 34.63
    },
    {
      "menuItemId": 1432,
      "quantity": 4,
      "unitPrice": 13.28,
      "lineTotal": 53.12
    }
  ],
  "subtotal": 87.75,
  "deliveryFee": 6.12,
  "tip": 0.79,
  "total": 94.66,
  "currency": "USD",
  "status": "placed",
  "placedAt": "2024-06-30T13:53:55.781Z",
  "deliveredAt": null
}