All things Shopify and commerce
I am creating a program that allows for Shopfy users to update an external inventory database when a sale is made. I have found that when I do a REST Admin API call to get a list of orders that the line_items returned for some orders do not contain the variant_id number. This appears to be when the order was created in a sales channel other than Shopify, i.e. TikTok. The variant_id is always returned in a Shopify order. Can this be corrected? Is there a way to map the variant_id to TikToc and other sales channels so it is always returned instead of returned only with a Shopify sale?
Hmm that's surprising. Any chance the variant was deleted? I'd be curious to see the full payload.
Variant was not deleted. This is quite consistant with the store owner I am working with. The Shopify variant_id is not being returned in TikTok sales. Attached is a file that contains a sample of the returned json from an orders get. The file is just a text file renamed to .csv to meet the attachment requirements. I use Notepad++ with the json plugin to view the json text.
Wow that's weird. The product_id and sku fields are always empty too? I was going to say you could look up the variant ID from the sku if it were there? You have skus on all your variants I assume?
The variant_id and sku are always emtpy with any order that does not originate from Shopify, i.e. TikTok etc.
Not all of the variants have an SKU for the store I am working with, but the ones that do, are returned if the order originates from Shopify - but the SKU, even if it exists in the variant record in Shopify, is not returned from an order that does not originate from Shopify. This happens every time with every order.
Check out the returned json attachment in my prevoius post and you can see this yourself.
I did. That's where I saw them empty and asked about it.
Certainly not the case that all external systems drop the variant_id - recharge comes to mind as an example. But I'm not too familiar with the tiktok integration, which is why I'm curious about this.
Only idea I have is to look up the product/variant by title, but that's not ideal.
And the title will not work either - if the order is not a Shopify order, then the title is the same as the product name, without the 3 options appended to it. The variant_title will only work for Shopify orders. I need a unique identifier and the variant id would be perfect if it was always returned by the API.
How can I go about getting Shopify to modify the API so some sort of unique variant identifer is returned EVERY time with an order?
Brutal. I did look at the tiktokshop API a bit this morning. We have an integration queued up with them but doesn't look like it's going to launch very soon. Their API definitely gives you a SKU associated to order line items:
Unfortunately there is no way in Shopify to map the Shopify SKU to the TikTok SKU. If there was, then I could use the TikTok order identifer, which is returned to the Shopify API, to get the TikTok order and then the TikTok seller SKU.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024