Focusing on managing products, variants, and collections through the API.
It can be set on InventoryItemUpdateInput but not on ProductVariantInput.
- https://shopify.dev/docs/api/admin-graphql/2023-04/input-objects/ProductVariantInput
- https://shopify.dev/docs/api/admin-graphql/2023-04/input-objects/InventoryItemUpdateInput#field-inve...
Why can't I set countryCodeOfOrigin while countryHarmonizedSystemCodes can be set either way?
Solved! Go to the solution
This is an accepted solution.
Hi Devill,
As you've noticed it's not possible to configure countryCodeOfOrigin
with the ProductVariantUpdate
mutation, because the countryCodeOfOrigin
field is not a valid field for the ProductVariantInput
object
The ProductVariantInput
object is used to update the properties of a product variant, such as the title, price, and inventory quantity. However, the countryCodeOfOrigin
field is not a property of a product variant, but rather a property of an inventory item. However, the countryHarmonizedSystemCodes
field can be set either way because it is a valid field for both the InventoryItemInput
and ProductVariantInput
objects. This limitation is valuable feedback however to share with our product teams - so thanks for flagging!
Hope this helps!
Liam | Developer Advocate @ 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
This is an accepted solution.
Hi Devill,
As you've noticed it's not possible to configure countryCodeOfOrigin
with the ProductVariantUpdate
mutation, because the countryCodeOfOrigin
field is not a valid field for the ProductVariantInput
object
The ProductVariantInput
object is used to update the properties of a product variant, such as the title, price, and inventory quantity. However, the countryCodeOfOrigin
field is not a property of a product variant, but rather a property of an inventory item. However, the countryHarmonizedSystemCodes
field can be set either way because it is a valid field for both the InventoryItemInput
and ProductVariantInput
objects. This limitation is valuable feedback however to share with our product teams - so thanks for flagging!
Hope this helps!
Liam | Developer Advocate @ 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
Thank you for reply, Lian. I understand why.
> This limitation is valuable feedback however to share with our product teams - so thanks for flagging!
Thanks for sharing to product teams.
Hopefully you will consider adding it.
+1 on a fix for this, as it means no bulk updating of countryCodeOfOrigin, alternatively bulk operation support for inventoryItemUpdate would be great 🙂