question

lov3bin avatar image
lov3bin asked brokenoval answered

reading all records from my account

Hi, I am new to Clover. I am trying to write an app using Clover API to read all sales records from my own account to a local file. Can someone teach me how to do it? What steps should I take to achieve that? Thanks for all the helps.
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

brokenoval avatar image
brokenoval answered
You will have to call the "/orders" API as documented here.

Bear in mind a couple of important things:
You can use the "expand=<option>" within the url to get further details e.g. if you need to get payments and items associated with the order you would call:

GET /v3/merchants/{mId}/orders?expand=payments,items

You should put the access_token into a `Authorization` header rather than the url, but both would work.

You can request a maximum of 1000 items at a time, I'd recommend paginating via your front end interface using the `offset` tag like this:

// This will return the first 1000 records, 
GET /v3/merchants/{mId}/orders?expand=payments,items&limit=1000&offset=0 

//then you can paginate by requesting the second 1000 records like this
GET /v3/merchants/{mId}/orders?expand=payments&limit=1000&offset=1000
10 |2000

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