Storefront API orders line item variant return null

Topic summary

Issue: In Storefront API responses, some order and checkout line items return variant: null even when the product/variant appears to exist and be active.

  • Expected behavior: Variant details should be present on line items for available variants. Shopify docs note that if a variant is deleted, REST may return only the variant ID while other details are null, and GraphQL may return variant as null.
  • Observed behavior: Multiple users report variant is null for items that still exist, are active, and are available to the sales channel. Other fields (e.g., title) still return data. In some cases, the ProductVariant node can be queried successfully via Storefront API, but the line item’s variant field is null. Occurs inconsistently (“random” variants).
  • Evidence: Screenshots and a code snippet show lineItems with variant: null after checkoutCreate.

Status: No confirmed root cause or fix. Initial hypothesis (deleted items) does not explain all cases. Users are asking for an update; issue remains unresolved.

Summarized with AI on December 13. AI used: gpt-5.

Hello,

I am using Storefront API to get the order history of the users, then I list the different line_items. But some line_items have the variants object to null, I need this object because it contains several information.

Do you know why some line_item have the variants object to null?

Thank you.

Fair to assume that the items missing no longer exist in the shop? So the reference being nullified would be a reflection of that.

1 Like

Hello Jason,

Thank you for your answer but this is not the case for all products. Some old products are no longer available, but others recent products are still available but with an empty object variant.

2 Likes

Any news on this? I’m having exactly the same problem
Items exists in the shop, status is set to active.
But the variants field returns null.

Also - if it was a reflection of the item missing or no longer existing howcome its returning valid data for title etc?

According to Shopify docs:

Deleted objects are not available in the API. The product variant ID is the only detail you can get when a product variant is deleted. Other details are not available.
https://help.shopify.com/en/manual/shopify-flow/reference/triggers/product-variant-deleted#api-details

I see that REST API returns the variantid but other details are null. whereas GraphQL returns variant null

We also are seeing this when using the checkoutCreate storefront mutation, no errors no issues, but this is what is returned for the checkout lineItems:

"lineItems": {
"nodes": [
{
"title": "Personalized Cartoon Phone Case",
"quantity": 1,
"variant": null
}
]
}

Any ideas? The product is available in the custom app’s sales channel.

We can also query this ProductVariant node from the storefront api with no issues as well.

This only happens with random variants and we can’t seem to figure out why.

1 Like

Is there an update on this??