REST Admin API orders > fulfillments > line_items

cwtart
Shopify Partner
5 0 1

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?

CommPay Software LLC
Creating software solutions for the consumer electronics industry since 1998.
CommPayPro
Replies 8 (8)

Kalen_Jordan
Shopify Partner
335 12 46

Hmm that's surprising. Any chance the variant was deleted? I'd be curious to see the full payload.

Kalen Jordan
Platform Advocate
MESA - Shopify Automation You've Love
cwtart
Shopify Partner
5 0 1

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.

CommPay Software LLC
Creating software solutions for the consumer electronics industry since 1998.
CommPayPro
Kalen_Jordan
Shopify Partner
335 12 46

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? 

Kalen Jordan
Platform Advocate
MESA - Shopify Automation You've Love
cwtart
Shopify Partner
5 0 1

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.

CommPay Software LLC
Creating software solutions for the consumer electronics industry since 1998.
CommPayPro
Kalen_Jordan
Shopify Partner
335 12 46

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.

Kalen Jordan
Platform Advocate
MESA - Shopify Automation You've Love
cwtart
Shopify Partner
5 0 1

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?

CommPay Software LLC
Creating software solutions for the consumer electronics industry since 1998.
CommPayPro
Kalen_Jordan
Shopify Partner
335 12 46

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:

https://partner.tiktokshop.com/doc/page/649a5eeb38158c02a43fc6b5?external_id=63fd742f715d622a338c4c1...

 

Screenshot 2024-02-14 at 12.09.13 PM.png

Kalen Jordan
Platform Advocate
MESA - Shopify Automation You've Love
cwtart
Shopify Partner
5 0 1

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.

CommPay Software LLC
Creating software solutions for the consumer electronics industry since 1998.
CommPayPro