Pagination
Paginated list endpoints return page-based results.
Current paginated resources:
GET /api/v1/ordersGET /api/v1/shipmentsGET /api/v1/products
Non-paginated list resources (return full arrays):
GET /api/v1/warehousesGET /api/v1/webhooks
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (minimum 1) |
limit | integer | 50 | Items per page (minimum 1, maximum 100) |
Response Meta
Paginated responses include a meta object alongside data:
{
"data": [ ... ],
"meta": {
"page": 1,
"limit": 50,
"total": 237,
"totalPages": 5
}
}
| Field | Description |
|---|---|
page | Current page number |
limit | Items per page |
total | Total number of matching items |
totalPages | Total number of pages (Math.ceil(total / limit)) |
Examples
Fetch the First Page
curl "https://shipwave.app/api/v1/orders?page=1&limit=25" \
-H "Authorization: Bearer sw_live_abc123..."
Iterate Through All Pages
async function fetchAllOrders(apiKey: string) {
const baseUrl = "https://shipwave.app/api/v1/orders";
let page = 1;
const limit = 100;
const allOrders = [];
while (true) {
const res = await fetch(`${baseUrl}?page=${page}&limit=${limit}`, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const { data, meta } = await res.json();
allOrders.push(...data);
if (page >= meta.totalPages) break;
page++;
}
return allOrders;
}
Combine with Filters
Pagination works alongside all filter parameters:
curl "https://shipwave.app/api/v1/orders?status=pending&storeId=store_abc&page=2&limit=25" \
-H "Authorization: Bearer sw_live_abc123..."