orders
orders
Page 4 of 42.
Overview
Request
curl example
curl -sS \ "https://example-data.com/api/v1/orders?limit=25"
JavaScript example
const res = await fetch(
"https://example-data.com/api/v1/orders?limit=25"
);
const { data, meta } = 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, ListEnvelope } from "./types/orders";
const res = await fetch(
"https://example-data.com/api/v1/orders?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Order>; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/orders",
params={"limit": 25},
)
data = res.json() Response
{
"data": [
{
"id": 73,
"userId": 56,
"status": "confirmed",
"currency": "USD",
"subtotal": 1615.81,
"tax": 141.38,
"shipping": 0,
"total": 1757.19,
"placedAt": "2024-11-23T01:46:10.678Z",
"shippedAt": null,
"deliveredAt": null,
"createdAt": "2024-11-23T01:46:10.678Z",
"updatedAt": "2024-11-23T01:46:10.678Z"
},
{
"id": 74,
"userId": 232,
"status": "cancelled",
"currency": "USD",
"subtotal": 863.71,
"tax": 75.57,
"shipping": 0,
"total": 939.28,
"placedAt": "2024-07-17T22:55:28.520Z",
"shippedAt": null,
"deliveredAt": null,
"createdAt": "2024-07-17T22:55:28.520Z",
"updatedAt": "2024-07-17T22:55:28.520Z"
},
{
"id": 75,
"userId": 38,
"status": "cancelled",
"currency": "USD",
"subtotal": 512.63,
"tax": 44.86,
"shipping": 0,
"total": 557.49,
"placedAt": "2024-10-11T22:39:37.655Z",
"shippedAt": null,
"deliveredAt": null,
"createdAt": "2024-10-11T22:39:37.655Z",
"updatedAt": "2024-10-11T22:39:37.655Z"
}
],
"meta": {
"page": 4,
"limit": 24,
"total": 1000,
"totalPages": 42
},
"links": {
"self": "/api/v1/orders?page=4&limit=24",
"first": "/api/v1/orders?page=1&limit=24",
"last": "/api/v1/orders?page=42&limit=24",
"next": "/api/v1/orders?page=5&limit=24",
"prev": "/api/v1/orders?page=3&limit=24"
}
}