Empty SKU for line items when getting order

Empty SKU for line items when getting order

hoangphan
Shopify Partner
3 0 0

Hi, is it normal behavior that a line item may have sku item even though the product and variant itself has sku? Also, in the same order, there is another line item that is for the same product and variant and sku is not empty. I was just wondering if this is a bug from Shopify or we might be missing something and might want to take something into account for such scenario.

Thank you

Replies 4 (4)

hoangphan
Shopify Partner
3 0 0

Just to clarify as I cannot edit the post: in the payload that I got for an order there is one line item that has empty SKU even though the product itself has SKU

Alan
Shopify Staff
129 15 24

Hey @hoangphan - thanks for getting in touch. If you're using something like an orders query to surface line item information, it could show the SKU for the lineitem, and would generally be expected behaviour for a REST GET call on the orders endpoint. 

You mentioned that for one line item it surfaced an empty SKU in the response payload even though the product has a SKU? Would you be able to share the X-Request-ID from the response header for that call? Or if you're able to replicate the API call were you saw that error, and provide that Request ID, we could also use that to look into the logs on our end. 

If a product has a SKU, we'd expect that the lineitem associated with that product would surface the same SKU ID, so we're happy to look into this further with you. 

 

Hope to hear from you soon!

Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

hoangphan
Shopify Partner
3 0 0

@Alan thank you very much for your response. Here is the X-Request-ID from the response that I see the issue 9c1a81c5-b48d-4f64-9ac1-2ec1fe918bb8 and the problematic lineitem is the second one in the list. I also notice that there is another lineitem in the same order that is of the same product and variant and its SKU is not empty.

 

Thank you again and I hope to hear from you soon

Alan
Shopify Staff
129 15 24

Hey @hoangphan - thanks for your patience while we looked into this on our end. I was able to pull some logs using the request ID you provided and while I couldn't find anything wrong with the request itself, I was able to run a few tests on the store mentioned in those requests using GraphQL. I saw that there appears to be a few blank SKUs for some variants, like you mentioned in your initial post. 

I can't say for sure why the SKUs themselves are blank, but I can say that sometimes they could could be blank due to the merchant not inputting a SKU for the specific variant. Again, can't confirm if this is the case, but my recommendation would be to reach out to the merchant on your end to confirm if they either are intentionally not adding the SKU or if if it was an oversight on their end. 

 

If we can confirm there should be a SKU (for instance, if there is one in the admin, but it's not surfacing in the API Call), we can definitely take a further look. Since a deeper look would require a bit more data that is in most cases more private, if you could reach out using our Issue Report form, we can help out via email. 


Hope this helps - and don't hesitate to reach out through that form if the issue persists. 

Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog