Accounts API Issue
Devansh Dev
Member Posts: 16 ✭
I am fetching accounts from my cashbook. I found i have total 100 accounts in cashbook, but API returns 50 accounts. Please help me. What i am missing ?
Using below API :
https://api.reckon.com/R1/{Cashbook Id}/accounts
Using below API :
https://api.reckon.com/R1/{Cashbook Id}/accounts
0
Comments
-
All listy things like accounts, items, contacts, etc, return 50 records at a time, so you'll need to use pagination to get all your accounts. Reckon One API uses OData for that.
Since each request will get you next 50 records, you can stop once you get back less then 50 records, or you can keep making requests until you get back an empty array.
To get your 100 accounts, you'll want to make these 3 requests:https://api.reckon.com/R1/{Cashbook Id}/accounts?$orderby=Name&$skip=0 https://api.reckon.com/R1/{Cashbook Id}/accounts?$orderby=Name&$skip=50 https://api.reckon.com/R1/{Cashbook Id}/accounts?$orderby=Name&$skip=100
Notice the $skip parameter at the end. You'll want to increase that for each subsequent request to get next 50 accounts.
Since you have exactly 100 accounts, you won't know after 2nd request if there are more accounts or not, so you have to make the 3rd request as well, even if it'll return an empty array in this case.
While $orderby=Name is not necessary, I found it easier to debug things that way, but you can omit that if you don't want your accounts sorted.0 -
ok Thanks Nemanja
0
Categories
- All Categories
- 6.8K Accounts Hosted
- 10 📢 Reckon Accounts Hosted - Announcements
- 6K Reckon Accounts (Desktop)
- 3 📢 Reckon Accounts Desktop - Announcements
- 1.2K Reckon Payroll 🚀
- 21 Reckon Payroll Help Videos 🎥
- 21 Reckon Mate App
- 18 📢 Reckon Payroll - Announcements
- 3.1K Reckon One
- 7 📢 Reckon One - Announcements
- 11 Reckon Invoices App
- 14 Reckon Insights
- 114 Reckon API
- 830 Payroll Premier
- 325 Point of Sale
- 1.9K Personal Plus and Home & Business
- 73 About Reckon Community