example-data.com
Menu
Browse docs and collections

Overview

orders / #786

orders #786

userId
Van Crona @van_crona
status
delivered
currency
USD
subtotal
1997.22
tax
174.76
shipping
0
total
2171.98
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/orders/786"
);
const order = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/orders.d.ts https://example-data.com/types/orders.d.ts
import type { Order } from "./types/orders";

const res = await fetch(
  "https://example-data.com/api/v1/orders/786"
);
const order = (await res.json()) as Order;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/orders/786"
)
order = res.json()

Response

{
  "id": 786,
  "userId": 185,
  "status": "delivered",
  "currency": "USD",
  "subtotal": 1997.22,
  "tax": 174.76,
  "shipping": 0,
  "total": 2171.98,
  "placedAt": "2024-09-01T12:38:02.882Z",
  "shippedAt": "2024-09-03T18:30:15.044Z",
  "deliveredAt": "2024-09-09T02:10:43.155Z",
  "createdAt": "2024-09-01T12:38:02.882Z",
  "updatedAt": "2024-09-09T02:10:43.155Z"
}