I have a question about product edits in Shopify. If an order is created with a product that does not have a SKU, and later we add the SKU by editing the product in Shopify, this update does not reflect on the order. When we retrieve the order through the API, the SKU field remains empty.
Is there a way to ensure that the SKU change for the product is reflected in the existing orders? This issue is affecting our app that integrates with Shopify.
As far as I know, you cannot update the SKU for an existing order since it may violate regulations. For older orders without an SKU, you can add product metafields and name the key as SKU. However, this is not an optimal solution.
The “sku” field under “line_items” is historical, so changes to the variant SKU will only apply to new orders.
There is a “variant_id” field in the “line_items” data, so what you could potentially do is use that variant_id field and do a separate lookup against the Product Variant API endpoint to retrieve the current Variant SKU value.