question

cjackson avatar image
cjackson asked Jonathan Ryan Grice answered

Platform API that 'Gets a list of Orders' pagination

Hello! I am using the Platform API that 'Gets a list of Orders' and in the returned results i dont see how to tell if there are more records to read or not.

Example call : https://api.clover.com/v3/merchants/{mid}/orders?limit=5&expand=lineItems.

It returns the most recent 5 orders and but I do not see a 'has_more' field or anything that signifies we need to grab more data and then using starting_after does not seem to work

Any suggestions ?

Thanks!!!!

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Jonathan Ryan Grice avatar image
Jonathan Ryan Grice answered

Using the Platform API, you may try using the query string "offset" where offset starts at 0, then goes up each time you scroll or view another page of orders.

Example: https://api.clover.com/v3/merchants/{mid}/orders?limit=5&offset=5&expand=lineItems

Where offset is how further down in the database the pointer starts returning orders instead of starting at 0, it can start at any number.

Be sure to have a check that the offset doesn't exceed the total number of orders available, so that you won't get an error for trying to offset more than the total number of orders available for the merchant.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community