Question

How to create draft orders in Shopify from Xero invoices with multiple line items?

  • 22 June 2024
  • 3 replies
  • 13 views

I need to create draft orders in Shopify from Xero invoices that have multiple line items. I tried using the Utilities in Formatter by Zapier > Line Itemizer, but when I proceed to Find Product Variant by SKU in Shopify, the line items get combined, resulting in the error "Nothing could be found for the search." When I test with a single line item, the draft order is created successfully, so the issue seems to be with multiple SKUs. Does anyone have any guidance on how to resolve this?


3 replies

Userlevel 7
Badge +11

Hi and welcome to the Community @Erin Arrivillaga! 😁

I did some checking and the Find Product Variant by SKU search action for Shopify doesn’t support line items, it’s only able to find a single product variant. Do the Xero invoices contain the title of the product variants?

If so, perhaps you could use the Find Product Variants by Title (Line Item Support) instead as it’s able to work with line items and return multiple results from the search. Would that be a viable solution?

If not, then you’ll want to try using Looping by Zapier. It would allow you to run the Find Product Variant by SKU action multiple times (once for each SKU in the line items). Though I should note that you can’t have the Create Draft Order (Shopify) action outside of the loop, as Looping by Zapier would need to be the last action in the Zap. So you’d need to put it inside the loop and use a filter (also in the loop) to check it’s the last loop iteration that’s running. That will ensure that the order only gets created once the last SKU is processed. You can find out more about that here: How do I stop a loop from running in subsequent action steps?

 
Hope that helps. If you run into any issues on that or have any further questions at all just let us know! 

After I create the loop we are trying find product variant by SKU in Shopify and create draft orders in shopify, but only 1 line item is coming across to Shopify. Does Zapier offer live support or offer contacts to Zapier experts? 

 

 

Userlevel 7
Badge +11

Sorry for missing your reply here previously, @Erin Arrivillaga

After I create the loop we are trying find product variant by SKU in Shopify and create draft orders in shopify, but only 1 line item is coming across to Shopify.

When testing in the Zap editor you’ll only be able to test the first loop, but when it’s running it would loop through each of the ordered items separately. Though reading back on my previous reply it looks as though I got a bit mixed up - I’m so sorry for leading you down the wrong path here previously and for any confusion caused! 

To clarify, the Create Draft Order can go outside of the loop, it’s actually an Update Order action that you’d want to have running inside the loop. That way after the order is created, the loop will search for each variant by it’s SKU individually and update the order with each of the variant details. Then for any actions that need to run on the last loop iteration, you’d place that after the filter action.

So it would look more like this:
463a0bfecf346a7c36729eba35377912.png
Hope that helps to clarify things and sorry again for any confusion caused - clearly I needed more caffeine! ☕

Does Zapier offer live support or offer contacts to Zapier experts? 

Live chat is available to all paid plans, and there’s different Support levels available across each plan. You can view the Support options available for each plan here: https://zapier.com/pricing. I can’t give any direct contact details but you can head over to our Experts directory here to see what experts are available. 

Reply