[SOLVED] unitPriceMeasurement not showing in storefront after API update
After a lot of trial and error I finally found the solution for the issue where unitPriceMeasurement is set correctly via the GraphQL API but the unit price doesn’t show in the storefront until you manually save the product in the admin.
The Problem
Setting unitPriceMeasurement via productVariantsBulkUpdate stores the data correctly and it’s visible in the API, but the storefront never displays it. Only after manually opening the unit price modal in the admin and clicking “Done” + “Save” does it appear.
The Root Cause
By inspecting the Network tab in the browser while doing a manual save, I found that Shopify’s admin sends an additional undocumented field alongside the unit price data:
showUnitPrice: true
This flag is what actually activates the unit price display in the storefront. It’s not documented in the public API but it works via productVariantsBulkUpdate.
The Fix
Simply include showUnitPrice: true in your variant update:
mutation($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
productVariantsBulkUpdate(productId: $productId, variants: $variants) {
productVariants { id }
userErrors { field message }
}
}
With variables:
{
"productId": "gid://shopify/Product/123",
"variants": [
{
"id": "gid://shopify/ProductVariant/456",
"unitPriceMeasurement": {
"quantityValue": 100,
"quantityUnit": "G",
"referenceValue": 1,
"referenceUnit": "KG"
},
"showUnitPrice": true
}
]
}
API version 2025-07 or later required (first version where unitPriceMeasurement is writable).
Hope this saves someone else hours of debugging!