Hello all!
Have a unique requirement currently which has led to me using Zapier for automating invoice generation into Sage. Initially, this looked like a nice streamlined scenario by using the Sage Integration. Unfortunately the integration returns a 504 Gateway Timeout on the most important function I need, the Create Sales Invoice.
Currently I have tested and had success with raising an invoice using the API (Beta) functionality in Sage Accounting integration by querying the API directly with the correct JSON body. But the current downside of this, is that I am working with line-items from Woocommerce that will be organic based on order quantities and number of items being bought through the store. How would I go about reading in the line-items from WooCommerce for the Product name, qty, price, tax, whether it has shipping etc.
So the number of this array can vary based on the order at hand. In terms of the Sage API functionality, the ‘Update Invoice’ PUT action will overwrite any invoice line items that had been created on an invoice.
Is there a way I would be able to loop through the line items that have been provided by the order and then build out the relevant Invoice Line entries on the JSON payload for Sage Invoice creation?
"invoice_lines": i
{
"description": "",
"product_id": "",
"ledger_account_id": "",
"quantity": "",
"unit_price": "",
"tax_rate_id": "GB_STANDARD",
"tax_amount": "",
"total_amount": ""
}
]
Any assistance with this whilst I am awaiting Sage dev support on the state of their integration would be much appreciated :)
Many thanks!