How do I set "This is a physical product" flag through the api?

Solved
Highlighted

I'm creating and updating products successfully through the api. However, all of them are coming across with the "This is a physical product" flag as false. I can't see a property on any api endpoint that allows you to set this flag. The closest I see is the "requires_shipping" property on InventoryItem and ProductVariant (deprecated), however it's set to readonly. We're moving hundreds of products through the api and our client does not want to have to manually toggle this on for every product. What are my options through the api?

0 Likes

Anyone have the answer to this?

0 Likes

Success.

Shopify Staff
Shopify Staff
1552 78 233

I think you're looking for requiresShipping on the productVariantUpdate mutation using the GraphQL Admin API:

 

https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/productvariantupdate

 

There's a requires_shipping field on product variants through REST, but the field is deprecated, so I would not depend on it too much.

 

Cheers.

0 Likes

Thank you for your answer. I see that requires_shipping was recently depreciated. Do I have to worry that in the future requiresShipping in the GraphQL api is going to become deprecated? Secondly, why would the value be allowed to be set in GraphQL but not REST?

0 Likes
Shopify Staff
Shopify Staff
1552 78 233

There's plans to expose this as mutable on InventoryItems (at least via GraphQL), and it looks like at that time requiresShipping will actually be deprecated on the ProductVariant level. It looks like it was just deprecated on REST ahead of this process. Note that when the field is deprecated on productVariant, you'll have time to migrate to controlling it on the InventoryItem so you won't have to make a hard shift.

 

Cheers.

0 Likes