Posting a Sales Invoice with 500+ invoice item lines

Hi,

When posting a sales invoice with 500+ invoice item lines to the endpoint "/sales_invoices" the invoice is being created successfully in Sage, however, the response to the Post request is the following Bad Request:

 

- Bad Request 400 - The backend has not responded within 28s while proxying this request. Please try again later. (Proxy)

Any help on this one would be very much appreciated.

I am using Sage Business Cloud Start

Regards,

-Paul.

Parents
  • Hi Paul,

    an invoice with 500 line items sounds huge. The API does not have a limitation, but a 400 response might be expected from time to time. The issue is that the backend of Sage Accounting is creating the invoice but it takes longer than the timeout of our API infrastructure.

    The 400 is returned because the request took longer than 28 seconds, but it is actually executed in the backend. This is why you can see the created invoice later, but not as a response to your large request.

    My recommendation would be to not try to create such big invoices, maybe you have a way to either split it to multiple invoices or combine similar line items of the invoice. 

    I hope this helps and makes some sense.

    Regards, Tim

Reply
  • Hi Paul,

    an invoice with 500 line items sounds huge. The API does not have a limitation, but a 400 response might be expected from time to time. The issue is that the backend of Sage Accounting is creating the invoice but it takes longer than the timeout of our API infrastructure.

    The 400 is returned because the request took longer than 28 seconds, but it is actually executed in the backend. This is why you can see the created invoice later, but not as a response to your large request.

    My recommendation would be to not try to create such big invoices, maybe you have a way to either split it to multiple invoices or combine similar line items of the invoice. 

    I hope this helps and makes some sense.

    Regards, Tim

Children