paymoapp / api

API documentation for Paymo
https://www.paymoapp.com
75 stars 31 forks source link

invoiceitems array empty when invoice has items #68

Open bu6n opened 3 months ago

bu6n commented 3 months ago

Hi there, I'm trying to export our invoices from Paymo and a lot of them have empty invoiceitems arrays whereas the invoice as shown in paymo has items. Could that be a bug?

The request I'm doing is:

curl -u <token>: -H 'Accept: application/json' "https://app.paymoapp.com/api/invoices?include=invoiceitems"

I've done the same request with our estimates and it seems to always work.

I can provide an example per e-mail if needed.

paymoapp commented 3 months ago

Hi,

It looks like the issue is due to our limit of 2500 items per ResourceType. Since your company has more than 2500 invoice items, it's best to paginate the responses. Please paginate your requests with 100 items per page. You can do this with the following curl command:

curl -u api_key:random -H 'Accept: application/json' "https://app.paymoapp.com/api/invoices?include=invoiceitems&page=0&page_size=100"

bu6n commented 3 months ago

Hi, thanks for your fast answer. It's good to know there is a way! In the past, I have searched for a pagination feature in the doc but I had not found it. It would be nice if it was documented :)

paymoapp commented 3 months ago

We will add documentation for pagination in the near future.