Test Integration Test Integration Posted February 9, 2023 Posted February 9, 2023 Hello, I want to update invoice by adding new lines to it and I want rest of the data in the invoice to remain the same. To do that, is it enough to just specify "invoice_lines" field in the update request that will contain both existing and new lines? Do I need to specify all other invoice fields if I don't want to change their values? Thanks in advance.
Steel, Mark Posted February 10, 2023 Posted February 10, 2023 HI, Thank you for your question. You would need to send all item lines that you need to keep along with their associated values including any analysis_types that they may be associated with. If you sent only the invoice_line that you wish to add/change the invoice would then only have a single invoice_line. Have you created a trial account to develop against and test your code? Thanks Mark
Test Integration Test Integration Posted February 10, 2023 Author Posted February 10, 2023 Hi Mark, Thanks for answering. I have created trial account and tested. I read the part about updating invoice with invoice lines from documentation and I think that I understand the part about updating invoice_lines in the invoice. I couldn't find the part about whether update of invoice behaves as sparse or full update. I am wondering if I need to also specify all other fields of the invoice when I want to just update the invoice_lines, such as date, invoice_number, due_date, reference, address, etc. From what I've tested, it seems that it is enough to just specify updated invoice_lines (if I omit all other invoice fields, they will stay the same and won't be overriden). I would like to confirm if that truly is case? Thanks
Steel, Mark Posted February 10, 2023 Posted February 10, 2023 Hi, The Invoice Headers (date, invoice_number, due_date, reference, address, etc) do not need to be included in the PUT body. Adding all of the item lines is sufficient and the invoice totals will be re-calculated based on the values in the invoice_lines you include. Thanks 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now