Pagination

Here is how to work with paginated responses when querying the SellApp API. By default, all responses limit results to fifteen. However, you can go as high as 100 by adding a limit parameter to your requests.

When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a meta attribute and have a last_page attribute that indicates whether you have reached the end of the last page. You can use the page query parameter to browse pages.

Example using invoices

In this example, we request the page that starts at page 10, with a limit of 20 results per page. As a result, we get a list of twenty invoices and can tell by the last_page attribute that we have not yet reached the end of the resultset.

  • Name
    limit
    Type
    integer
    Description

    The response limit of the API resource you are accessing.

  • Name
    page
    Type
    integer
    Description

    The page number you are attempting to access.

Manual pagination using cURL

curl --request GET \
  --url 'https://sell.app/api/v1/invoices?page=10&limit=20' \
  --header 'Authorization: Bearer {ApiKeyHere}' \
  --header 'Content-Type: application/json'

Paginated response

{
  "data": [
    {
      "id": "1",
      // ...
    },
    {
      "id": "2"
      // ...
    },
    {
      "id": "3"
      // ...
    }
    // ...
  ],
  "meta": {
    "current_page": 10,
    "from": 181,
    "last_page": 42,
    "links": [
      // ...
    ]
  }
},