Pagination
Page through list results with page tokens.
All List* operations except
ListTrackings return results in
pages.
How it works
Send page_size with no page_token. If there are more results, the response
includes next_page_token. Send it as page_token to get the next page. When
next_page_token is missing or empty, there are no more results.
{ "page_size": 100 }{
"products": [{ "id": "BGBL-ESPSRT-SMAL" }],
"next_page_token": "ChgKFgoJcHJvZHVjdHMSCUJHQkwtRVNQ"
}{ "page_size": 100, "page_token": "ChgKFgoJcHJvZHVjdHMSCUJHQkwtRVNQ" }Don't store page tokens
Tokens are opaque. Don't parse, build or keep them. If paging stops partway, start again with no token. Keep the same filters on every page.
Page sizes
| Operation | Default when page_size is 0 | Maximum |
|---|---|---|
ListProducts | 500 | None |
ListBundles | 100 | None |
ListInboundShipments | 100 | None |
ListInventories | 1000 | 1000 |
ListBundleInventories | 1000 | None |
ListAllocationInventories | 1000 | 5000 |
ListOrders | 100 | None |
ListOrderTickets | 100 | None |
ListReturns | Set by the server | None |
A page_size above the maximum fails with invalid_argument. It isn't reduced
for you.
Limits inside a result
ListInventoriesreturns at most 100 lots per row.- A bundle can have at most 20 components.
Choosing a page size
Larger pages mean fewer requests against your rate limit.
- For inventory, use the maximum:
page_size: 1000, or5000for allocation inventories. - For orders, use 100 to 250.
ListOrdersloads fulfillments and trackings for each order, so large pages are slow. - For other lists, the default is fine.