example-data.com
Menu
Browse docs and collections

orders

orders

Page 23 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": 529,
      "userId": 28,
      "status": "pending",
      "currency": "USD",
      "subtotal": 618.78,
      "tax": 54.14,
      "shipping": 0,
      "total": 672.92,
      "placedAt": "2024-06-30T23:24:17.695Z",
      "shippedAt": null,
      "deliveredAt": null,
      "createdAt": "2024-06-30T23:24:17.695Z",
      "updatedAt": "2024-06-30T23:24:17.695Z"
    },
    {
      "id": 530,
      "userId": 15,
      "status": "cancelled",
      "currency": "USD",
      "subtotal": 2752.87,
      "tax": 240.88,
      "shipping": 0,
      "total": 2993.75,
      "placedAt": "2025-03-28T03:16:09.323Z",
      "shippedAt": null,
      "deliveredAt": null,
      "createdAt": "2025-03-28T03:16:09.323Z",
      "updatedAt": "2025-03-28T03:16:09.323Z"
    },
    {
      "id": 531,
      "userId": 180,
      "status": "shipped",
      "currency": "USD",
      "subtotal": 220.18,
      "tax": 19.27,
      "shipping": 0,
      "total": 239.45,
      "placedAt": "2024-06-08T13:58:02.079Z",
      "shippedAt": "2024-06-11T01:57:22.431Z",
      "deliveredAt": null,
      "createdAt": "2024-06-08T13:58:02.079Z",
      "updatedAt": "2024-06-11T01:57:22.431Z"
    }
  ],
  "meta": {
    "page": 23,
    "limit": 24,
    "total": 1000,
    "totalPages": 42
  },
  "links": {
    "self": "/api/v1/orders?page=23&limit=24",
    "first": "/api/v1/orders?page=1&limit=24",
    "last": "/api/v1/orders?page=42&limit=24",
    "next": "/api/v1/orders?page=24&limit=24",
    "prev": "/api/v1/orders?page=22&limit=24"
  }
}