I have an array with order lines that I intend to send in via the Xero node as a draft Invoice. Issue is that I might have 1 or 30 order lines depending on the order.
Easiest way would be to have a split off where one workflow path handles the orderlines. You can use the item list node to split the lines, then you can process them and combine them again. After that simply merge them back into the main flow of the invoices.
Ah, now I see, sorry I didn’t realise how the node works.
No Idea how you would pull this one off with the node, without doing some bizarre stuff.
I think using a manual request with the HTTP node is the easiest way to get going.
At the moment the node doesn’t have support for paying invoices so we would need to create a feature request for that one, With the multi line items I can’t see a way to do it but I can see why it would be useful to have it although I am not sure why this has not come up before unless I have missed it.
I did think maybe a loop would do the job and you could create an invoice, store the ID then on the next loop just update the invoice to add new line items but it looks like the node replaces the line items which is not ideal.
At the moment the best I can suggest would be to use the HTTP Request node and create a new generic oauth option that contains the scopes required until we update the node or someone else pops in a pull request / creates a community version.
Just to be complete and share a workflow that doesn’t work as intended but shows what I was thinking
Hey @Jon, I’m also trying to work a solution for this. I noticed the following line in the Xero API instructions for Posting Invoice Updates.
Not providing an existing LineItem with it’s LineItemID will result in that line item being deleted.
I’m pretty sure this is what has been thwarting my attempts to get multi-line invoices working so far. Wondering if this may be relevant for your workflow too?
Disheartening to see that a year later, we still don’t have a Xero Create Invoice node that has the basic feature of supporting multiple line items Has everyone been using a custom HTTP request? Surely multiple line items isn’t an edge case in this instance?
Could anyone let us know if this is a feature that’s likely to be implemented? I’ve been a Zapier user for a few years and just dipping my toe into n8n. How responsive are the devs to this kind of thing?
There are a few nodes where we should probably add this as an option as it still seems odd to me that we don’t have it, This is something that will happen but we do have to prioritise our feature requests and also work on our roadmap and this is one of those things that has slipped. I will see if I can fit this in early next year though.
I went ahead and tackled the problem manually and it certainly was more complex than I initially anticipated. I’ve made some good progress, but I’m yet to tackle discounted line items, which adds a whole new layer of complexity
Doesn’t help that this is my first go at an n8n workflow, but I’m getting there