Why cannot i configure countryCodeOfOrigin with productVariantUpdate mutation?

Solved

Why cannot i configure countryCodeOfOrigin with productVariantUpdate mutation?

devill
Shopify Partner
8 1 1

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?

Accepted Solution (1)

Liam
Community Manager
3108 341 878

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

View solution in original post

Replies 3 (3)

Liam
Community Manager
3108 341 878

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

devill
Shopify Partner
8 1 1

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.

Mickeydtails
Shopify Partner
13 1 15

+1 on a fix for this, as it means no bulk updating of countryCodeOfOrigin, alternatively bulk operation support for inventoryItemUpdate would be great 🙂