example-data.com
Menu
Browse docs and collections

orders

orders

Page 37 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": 865,
      "userId": 249,
      "status": "refunded",
      "currency": "USD",
      "subtotal": 779.21,
      "tax": 68.18,
      "shipping": 0,
      "total": 847.39,
      "placedAt": "2024-12-30T06:51:57.148Z",
      "shippedAt": null,
      "deliveredAt": null,
      "createdAt": "2024-12-30T06:51:57.148Z",
      "updatedAt": "2024-12-30T06:51:57.148Z"
    },
    {
      "id": 866,
      "userId": 249,
      "status": "refunded",
      "currency": "USD",
      "subtotal": 1598.95,
      "tax": 139.91,
      "shipping": 0,
      "total": 1738.86,
      "placedAt": "2024-12-30T05:35:31.804Z",
      "shippedAt": null,
      "deliveredAt": null,
      "createdAt": "2024-12-30T05:35:31.804Z",
      "updatedAt": "2024-12-30T05:35:31.804Z"
    },
    {
      "id": 867,
      "userId": 18,
      "status": "shipped",
      "currency": "USD",
      "subtotal": 97.4,
      "tax": 8.52,
      "shipping": 9.99,
      "total": 115.91,
      "placedAt": "2025-01-17T09:39:24.249Z",
      "shippedAt": "2025-01-19T11:06:11.583Z",
      "deliveredAt": null,
      "createdAt": "2025-01-17T09:39:24.249Z",
      "updatedAt": "2025-01-19T11:06:11.583Z"
    }
  ],
  "meta": {
    "page": 37,
    "limit": 24,
    "total": 1000,
    "totalPages": 42
  },
  "links": {
    "self": "/api/v1/orders?page=37&limit=24",
    "first": "/api/v1/orders?page=1&limit=24",
    "last": "/api/v1/orders?page=42&limit=24",
    "next": "/api/v1/orders?page=38&limit=24",
    "prev": "/api/v1/orders?page=36&limit=24"
  }
}