Best answer

Shipping lines for Xero Invoice when a new WooCommerce order is created

  • 2 September 2020
  • 10 replies
  • 207 views

Userlevel 1

Hi All,

I’m trying to create a zap that creates Xero invoice whenever a new order in WooCommerce is created. However, I don’t see any way to add shipping line in “Customize Sales Invoice” in Xero. This is important to us since we want customer to pay the invoice via Xero (including the shipping fee).

Is there any way we can do this? Or is this a limitation with Xero integration?

Appreciate your help! Thanks!

icon

Best answer by njgage 12 November 2020, 07:18

Hi,

@McMasterful  I found a fix!

There is an action for adding line items to an invoice - as long as that happens before you add a payment to the invoice then Xero will let you add a new line (which it will if you do it directly after creating the invoice). 

The new line needs to reference the shipping_total from Woocommerce order data, you can then code it to your shipping/postage account in Xero and use the Invoice reference from the previous step to apply it to the recently created invoice.

I also add a step to create a bill for the processing fee (Stripe in my case).

Here are my steps:

 

 

Cheers,

Nick

View original

This topic has been closed for comments

10 replies

Userlevel 1

FYI I can see the shipping_lines data in WooCommerce’s order but there’s no setting to apply this to Xero invoice:

 

I am having the exact same issue with X-Cart to Xero. Would make life a lot easier.

Userlevel 7
Badge +8

Hi there @AlexT and @tmull123 - Thanks for this question. At this time, this functionality doesn’t exist but we have a workaround suggestion for you to try: https://zapier.com/help/doc/common-problems-woocommerce#my-metadata-fields-come-through-as-line-items-not-as-separate-fields

Please give it a shot and let us know if it worked!

Userlevel 1

Hi @steph.n,

I’m familiar with splitting Woocommerce data into line items but how do you propose this is a workaround for dealing with the shipping lines issue? Shipping data does not come through in the order lines array so it won’t split out as a line item.

 

As @AlexT mentioned it is in a separate part of the api response. If you have more specific info about perhaps combining the data in javascript before that would be helpful.

 

Thanks,

Nick

Userlevel 7
Badge +7

Hi @njgage ,

What kind of data do you get from the Woocommerce trigger? is there any other field that contains the data with shipping lines? How does this look (screenshot)?

I am sure we should be able to retrieve this somehow as long as we have the data in a field somewhere.

~Bjorn

Userlevel 1

Hi @ForYourIT ,

The data is definitely there - looks like this:

 

 

I just haven’t had a chance to work out if I can append this to the order lines array for the Xero loop.

 

Cheers,

Nick

Userlevel 7
Badge +7

I understand @njgage thank you! I was more wondering what kind of fields the woocommerce app gives you. There must be some field somewhere you can format and use.

Userlevel 1

Hi All,

Did anyone find a way to solve this?

I need to add my shipping charges to the invoice.

 

Thanks so much

Margot

Userlevel 1

Hi,

@McMasterful  I found a fix!

There is an action for adding line items to an invoice - as long as that happens before you add a payment to the invoice then Xero will let you add a new line (which it will if you do it directly after creating the invoice). 

The new line needs to reference the shipping_total from Woocommerce order data, you can then code it to your shipping/postage account in Xero and use the Invoice reference from the previous step to apply it to the recently created invoice.

I also add a step to create a bill for the processing fee (Stripe in my case).

Here are my steps:

 

 

Cheers,

Nick

Userlevel 7
Badge +7

Hi All,

An update on this functionality: we've worked with the WooCommerce team to identify where meta data was provided in somewhat cumbersome line item fields. They've recently written in to let us know that they re-engineered this data model, so now meta data is also provided as individual fields in trigger and search steps, and is available to be created in action steps.

They have extensive documentation on using this new meta data model: https://om4.io/woocommerce-zapier-documentation/usage/#meta-data-custom-fields

Hoping you are able to test this out soon!