Xero Sales Invoice (awaiting payment) trigger not working
Hi,
This Xero trigger has not been working for me recently. I’ve updated the app, reconnected etc. Still does not work. Is anyone else having this problem?
For context, I have another Zap that creates a draft invoice in Xero when an order comes through, which works fine. Once the job has been completed, I manually change the invoice date to today, approve it in Xero, which changes it’s status to ‘awaiting payment’, however, the Zap does not trigger.
Thanks
Page 1 / 1
Hi @gloheating
Things to check…
Make sure you are using the updated version of the Xero Zap app
Make sure you are using the updated version of the Xero Zap app trigger event
Check the Xero Status page for recent/ongoing incidents that may be impacting the Zap trigger: https://status.xero.com/history
You mentioned that you are updating the invoice manually. Have you tried using the “Updated Sales Invoice” instead?
I'll be keeping an eye out for your response!
@ken.a yes I have tried that, but I only want i to trigger when status is ‘awaiting payment’ and Change is ‘Invoice Sent’ (custom, exactly matches text in Xero History and Notes section). However, it doesn’t work. Any ideas? Thanks.
@gloheating@ken.a@Troy Tessalone
I’ve been struggling for the last couple of days with something similar. Which used to work perfectly btw, but I think I figured out where the issue might be:
I’d set the trigger to look out for approved invoices, as below:
Then I’d create an invoice, mark it as Approved, but no trigger. I went to check the actions, and it seems like it makes the final action “Mark as Unsent”, instead of Approved.
So, I tested the trigger again, except I used “Invoice Unsent”.
And it then triggered perfectly!
We need the trigger to be on approved though, as “Unsent” won’t be consistent, especially if adding approved invoices through the API.
@BH0127 thanks for this insight. I have had some success by setting status to ‘awaiting payment’ and Change to ‘invoice unsent’. This triggers when clicking ‘Approve and send’ in Xero. However it only seems to work if you pause for a minute before pressing ‘send’ in the email preview screen in Xero.
The Change pop up tab in Zapiers configure tab suggests a Custom value can be used as long as it exactly matches the History and Notes in Xero, however, even though ‘Invoice Sent’ exactly matches, it does not trigger.
Hopefully someone at Zapier can tell us exactly what configuration do we need to set this Zap up as so that it reliably triggers for every sent invoice?
Thank you.
@gloheating no problem, glad I could help.
I still have an issue as I need my flow to trigger on “Invoice Approved” and I’ve tested every way they’ve described, so hopefully they get back to be on my ticket.
Will post any updates here as I receive them.
@Troy Tessalone@ken.a
Got to say, I’m pretty disappointed this has still not been sorted. I’ve wasted hours and hours trying to figure out a workaround for a trigger that worked perfectly before it got updated. I haven’t heard a thing from Support since they confirmed a bug exists. That was 12 days now and still the problem persists.
All I want to do is trigger when an invoice is sent. How difficult should it be? Come on please.
Thanks.
@Troy Tessalone@ken.a
Got to say, I’m pretty disappointed this has still not been sorted. I’ve wasted hours and hours trying to figure out a workaround for a trigger that worked perfectly before it got updated. I haven’t heard a thing from Support since they confirmed a bug exists. That was 12 days now and still the problem persists.
All I want to do is trigger when an invoice is sent. How difficult should it be? Come on please.
Thanks.
Agreed, the last response I had from support was:
Here’s what’s happening next:
Issue Logging: I have logged your report in our internal issue tracking system and added your email to the notification list for this issue.
Timing: Our development team prioritizes these types of reports based on overall impact. We try to unblock issues as soon as we can; however, at the moment, I can’t provide an exact timeline as to when this will be resolved.
Hopefully this is resolved soon. My invoices aren’t being sent until the Trigger works again.
@BH0127 I found a workaround until its fixed. Use Xero Updated invoice as trigger > config status ‘approved’ and leave Change blank (null). You’ll find that clicking Approve and Send in Xero will activate this trigger 3 times(!). Here’s how I got around the unnecessary multiple triggers…
Set up Step 2 to Look Up Row by invoice number in a Google sheet, and create a new row if it doesn’t exist. The sheet only needs to be 1 column, named ‘invoice numbers’ (for example).
Next step, Filter - only continue if the Step 2 was false.
The Zap still triggers multiple times, but at least it saves tasks and doesn’t go on to carry out the same actions as the previous zap and potentially mess something up further down the workflow.
It took me hours to figure this workaround out, I’m sure Zapier Support could have come up with it much more quickly.
Hello @Troy Tessalone, @ken.a and @gloheating
Sorry it’s taken me a while to get back on this, I’m working it out in my off hours. I think I’ve figured out how this integration works, and why it’s failing to do what we want.
I think that Zapier’s updated integration with Xero uses Xero’s webhooks, which means that Xero is now sending a notification every time an invoice is created or updated. However, the webhook payload only tells us that an "update" occurred without any specific details (like "Approved" or "Unsent").
As you can see, it doesn't specify the exact action, just that an update happened.
The problem is, when an invoice is marked as "Approved" in Xero, it triggers multiple actions (like "Edited," "Approved," and sometimes "Invoice Unsent"). Zapier receives an "Update" for each of these but doesn't get specific details, only that an update occurred.
It seems like Zapier then queries the invoice’s action history to determine the last action taken. Since these actions often happen at the same time, Zapier can end up reading the most recent status, which might not reflect the full sequence. This also explains why Zapier sometimes runs the workflow 2 or 3 times for the same invoice.
It’s also good to note, events can be bundled if they’re created in quick succession, which I found in this devblog. It states:
A final note about Xero webhooks, they can be batched meaning that if events occurred near the same time. The JSON body will contain an array of events (up to 200) within a single notification.
Workaround:
It’s not the perfect solution, but to work around this, I'm thinking of using a Zapier Table to track invoice IDs:
When an invoice is created, it’s logged in the table.
For each update, we check if the invoice ID is in the table:
If change history shows any “Approved” action, we process it and delete it from the table.
If change history shows any “Voided” action, we simply delete it from the table.
I may also need to manually add a delay to manage API rate limits. I also need to make sure that the invoice is created in the table before handling the rest if it’s created and approved at the same time.
It's a really long, unnecessary workaround for something that used to work perfectly. I think the Zapier team need to revert to the way it worked before, until they figure this out.
Hi @BH0127,
Thank you for the detailed write-up and for sharing a workaround. This will be incredibly helpful to other Community members facing similar issues—the Community really appreciate it!
@BH0127 Thanks, webhooks etc is beyond me. In any case, it seems you have found a workaround similar to the one I found with cross referencing the invoice ID so it only gets processed once instead of multiple times.
FYI @Troy Tessalone@ken.a
@BH0127 I found a workaround until its fixed. Use Xero Updated invoice as trigger > config status ‘approved’ and leave Change blank (null). You’ll find that clicking Approve and Send in Xero will activate this trigger 3 times(!). Here’s how I got around the unnecessary multiple triggers…
Set up Step 2 to Look Up Row by invoice number in a Google sheet, and create a new row if it doesn’t exist. The sheet only needs to be 1 column, named ‘invoice numbers’ (for example).
Next step, Filter - only continue if the Step 2 was false.
The Zap still triggers multiple times, but at least it saves tasks and doesn’t go on to carry out the same actions as the previous zap and potentially mess something up further down the workflow.
It took me hours to figure this workaround out, I’m sure Zapier Support could have come up with it much more quickly.
I am also spending hours of my time unsuccessfully trying to fix my zaps which were previously working beautifully! Since updating my xero app and the trigger of new sales invoice now being instant I am having so many issues with my zaps. I have now changed to use the invoice updated trigger and am trying to set the conditions and/or use filters to ensure the zap runs only trigger when I actually want them to - ie when an invoice is sent, and subsequently edited by me (and not by a system generated edit such as invoice viewed or reminders). So far unsuccessful. I either can’t filter so end up with multiple zap runs that I don’t want (using up heaps of tasks unnecessarily) or the zap won’t trigger at all. This is incredibly frustrating! If anyone has had any success with something similar that doesn’t involve ridiculous workarounds that use more zaps and require more workflows to be set up, I would love to hear about it! Or has anyone found an alternative software to Zapier that I could use instead? Zapier support has so far been of no use.
Hi @Nb_ride
I’m so sorry to hear of the difficulties you’ve been running into on this and that the Support team haven’t been able to help get this solved yet. I’d be happy to lend a hand in finding a solution!
I noticed that the Updated Sales Invoice trigger has a Trigger Preference field:
It sounds like if that field is set to As soon as possible rather than Detailed we won’t receive details of the update which occured. So I’m wondering if that might account for why the filter isn’t correctly filtering out the updates that you don’t want the Zap to continue for. Do you think that could be the case?
Would you mind sharing a quick screenshot showing the setup of the filter so we can see the conditions it’s using currently? Make sure to blur or remove all personal information (names, emails, addresses etc.) from screenshots before sharing - you can use a tool like Zappy for that.
Thanks, I look forward to your reply!
Hi @SamB thanks for your reply, I have managed to have some success by configuring the trigger to run when status is authorised, with no change field specified, user specified as our organisation (which has removed system generated edits and updates) and trigger preference detailed. I have then added a filter (see below) for history changes specifying text contains ‘Invoice Sent’ (which is a change code from Xero) so that only zaps for invoices that have been sent and/or subsequently updated/edited are going to run. That seems to be doing the job for now, yay.
I have another zap that I want to run only the first time the invoice has sent (and not on subsequent edits/updates) but I can’t get that to work. I am using the same trigger conditions as above but trying to use a filter that only allows the zap to continue if the history changes text starts with Invoice Sent, but this hasn’t been effective at filtering out other records that are edits made after invoice has sent (ie it seems the filter is ignoring that the text needs to start with Invoice Sent and will continue if Invoice Sent is contained anywhere within the history). I am not sure if I have misinterpreted the application of this filter or if it just isn’t working. For an example see screenshot below:
Let me know if you can see any issues with how I have set up this filter or shed any light as to why it is not working as intended. TIA
Thanks for the update here @Nb_ride! I’m so glad that the Zap is now working!
I have another zap that I want to run only the first time the invoice has sent (and not on subsequent edits/updates) but I can’t get that to work. I am using the same trigger conditions as above but trying to use a filter that only allows the zap to continue if the history changes text starts with Invoice Sent, but this hasn’t been effective at filtering out other records that are edits made after invoice has sent (ie it seems the filter is ignoring that the text needs to start with Invoice Sent and will continue if Invoice Sent is contained anywhere within the history). I am not sure if I have misinterpreted the application of this filter or if it just isn’t working. For an example see screenshot below:
Hmm, for this other Zap I suspect that the History field is outputting each change as separate line items. If it is then that could explain why the filter continued as, if it’s looking at each line item individually then it would see each value as the first item that it started with.
To get around that you could add a Formatter (Utilities > Line-item to Text) action ahead of the filter to first convert the line items into a comma separated list then have the filter check the list it outputs to see if it starts with the value “Invoice Sent”.
Can you give that a try and let me know if that fixes it?
OMG @SamB that worked perfectly thank you! Thanks for explaining the line item thing in simple terms and giving me a workaround that was easy to implement. Job done and I have learnt lots in the process
That’s awesome @Nb_ride! Thrilled to hear it worked perfectly and that you’ve learned so much in the process - great work!