Question

Automating Invoice Generation via API Beta (Sage Integration has issues)

  • 7 October 2023
  • 2 replies
  • 30 views

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": [
{
"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!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +14

Hi @krisor 

Good question.

To help us have more context please post screenshots with how your Zap steps are currently configured.

Can you link to the Sage API endpoint you are referencing?

Userlevel 6
Badge +8

Hey there!

 

Thanks for reaching out. I took a quick peek and I might recommend checking out this similar topic: 

 

I went ahead and add your vote as an interested user. If anything changes we’ll shoot you an email! We’ll also keep that main thread updated as well so I might recommend subscribing to it.