Pagination

Learn how API resources use pagination.

All API resources that return lists support bulk fetches. For example, you can use the limit, startingAfter, and endingBefore parameters to list orders, customers, and SKUs.

The startingBefore and endingAfter parameters both use an object ID value to determine the starting point, and the objects appear in the response in reverse chronological order. To return objects listed before the named object, use the endingBefore parameter. To return objects listed after the named object, use the startingAfter parameter. If you provide both parameters, the request uses only the endingBefore parameter.

Parameters

Parameter

Description

limit

The maximum number of objects returned. You can specify a value between 1 and 100.

startingAfter

This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 manufacturers ending with xyz, your subsequent calls can include startingAfter=xyz to fetch the next page of the list.

endingBefore

This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 objects starting with xyz, your subsequent call can include endingBefore=xyz to fetch the previous page of the list.

List response attributes

Attribute

Description

data

This array contains response elements. Any request parameter can paginate the response elements.

hasMore

When true, there are more elements available after this set. When false, this set marks the end of the list.