Skip to content

Adding Pagination Support #10

Description

@MajorLeagueDale-1

Problem

Certain API endpoints support pagination (i.e. Invoices), but the current list functions don't provide sufficient response information to be able to access it.

Example for Pagination

Request

GET https://api.xero.com/api.xro/2.0/Invoices?page=1

Response

{
	"Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"Status": "OK",
	"ProviderName": "xxxxxxxx",
	"DateTimeUTC": "\/Date(1738629433480)\/",
	"pagination": {
		"page": 1,
		"pageSize": 100,
		"pageCount": 2,
		"itemCount": 113
	},
	"Invoices": [
            ...
        ]
}

Proposed Solutions

Instead of returning the datasets directly, the "ListResponse"object should be returned as a whole and allow the user to handle looking at the returned structure.

This would allow the user to call invoices::list() again and just increment a new ListParameter called page based on the response objects "pagination" field as required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions