Solved

API - Product availability of variants

sd-igorfmachado
Visitor
3 0 3

Hi everyone, 

 

We are trying to create/update products using the "WEB API" for client project. While creating a normal product it is published automatically to the store, whoever, if we try to create a product with variants, the product isn't published automatically.

 

Does anyone have experienced this ? How can I solve it ?

 

"Normal" products 

Product availability

Available on 1 of 1 channels and apps

 

Variant products 

Product availability

Available on 0 of 0 channels and apps

 
 

 

Many thanks, 

Igor Machado

Accepted Solution (1)

Gregarican
Shopify Partner
1033 86 285

This is an accepted solution.

I'm assuming you are using the REST API. If so, there is a property for published_scope. If you are only looking to publish to your web/e-com sales channel, set this to web. Described here --> https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-10. Hope this helps!

View solution in original post

Replies 3 (3)

Gregarican
Shopify Partner
1033 86 285

This is an accepted solution.

I'm assuming you are using the REST API. If so, there is a property for published_scope. If you are only looking to publish to your web/e-com sales channel, set this to web. Described here --> https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-10. Hope this helps!

sd-igorfmachado
Visitor
3 0 3

Dear Greg, 

 

Thanks for your reply. Yes we are using the REST API, and we are sending the published scope ... We have tried web and global ...

 

The issue here is that with the same code, if the product has variants it isn't published ... if the product has no variants then it's published.

 

Anastia
Visitor
1 0 0
Hi there. I met the same problem when intergrating api for products with viriants, so is it fixed now?