Development discussions around Shopify APIs
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
Hi Team,
As Per Shopify Docs,
Whether the product is published to the Point of Sale channel. Valid values:
I am using REST API to update the published_scope of a product. It is not working as expected. I am passing the value as published_scope: 'web' but it does not list the product for Online Store on Shopify.
In below example, I used PUT request "/api/2021-07/products/632910392.json" to update the product with the below params.
{"product"=>{"id"=>6930626281668, "title"=>"Women Fossil watch", "published_scope"=>"web" } }
But it does not update the product on Shopify.
Although on fetching the product details using Get Product API, the API returns below response (where published scope is mentioned as web) :
{"product"=>{"id"=>6930626281668, "title"=>"Women Fossil watch", "vendor"=>"My Ind Store", "product_type"=>"", "created_at"=>"2021-10-21T17:11:57+05:30", "handle"=>"women-fossil-watch", "updated_at"=>"2021-10-21T17:42:31+05:30", "published_at"=>nil, "template_suffix"=>"", "status"=>"active", "published_scope"=>"web", "tags"=>"", "admin_graphql_api_id"=>"gid://shopify/Product/6930626281668", "variants"=>[{"id"=>40807257866436, "product_id"=>6930626281668, "title"=>"Default Title", "price"=>"50000.00", "sku"=>"Women Fossil watch", "position"=>1, "inventory_policy"=>"deny", "compare_at_price"=>"70000.00", "fulfillment_service"=>"manual", "inventory_management"=>nil, "option1"=>"Default Title", "option2"=>nil, "option3"=>nil, "created_at"=>"2021-10-21T17:11:57+05:30", "updated_at"=>"2021-10-21T17:17:57+05:30", "taxable"=>true, "barcode"=>"", "grams"=>100, "image_id"=>nil, "weight"=>0.1, "weight_unit"=>"kg", "inventory_item_id"=>42903835279556, "inventory_quantity"=>61, "old_inventory_quantity"=>61, "requires_shipping"=>true, "admin_graphql_api_id"=>"gid://shopify/ProductVariant/40807257866436"}], "options"=>[{"id"=>8876097437892, "product_id"=>6930626281668, "name"=>"Title", "position"=>1, "values"=>["Default Title"]}], "images"=>[{"id"=>30050785296580, "product_id"=>6930626281668, "position"=>1, "created_at"=>"2021-10-21T17:12:00+05:30", "updated_at"=>"2021-10-21T17:12:00+05:30", "alt"=>nil, "width"=>658, "height"=>734, "src"=>"https://cdn.shopify.com/s/files/1/0580/9861/4468/products/Default-1634816337-img1.jpg?v=1634816520", "variant_ids"=>[], "admin_graphql_api_id"=>"gid://shopify/ProductImage/30050785296580"}], "image"=>{"id"=>30050785296580, "product_id"=>6930626281668, "position"=>1, "created_at"=>"2021-10-21T17:12:00+05:30", "updated_at"=>"2021-10-21T17:12:00+05:30", "alt"=>nil, "width"=>658, "height"=>734, "src"=>"https://cdn.shopify.com/s/files/1/0580/9861/4468/products/Default-1634816337-img1.jpg?v=1634816520", "variant_ids"=>[], "admin_graphql_api_id"=>"gid://shopify/ProductImage/30050785296580"}}}
But this is what i see on Shopify.
Altough If I use Update Product API to update the published_scope as global, it updates for POS and but again not for Online Store.
{"product"=>{"id"=>6930626281668, "published_scope"=>"global" }}
Please let me know what am I doing wrong here.
Hello @Ashu24 ,
Thanks for bringing this to our attention. Some quick replications attempts on my end show the same behaviour that you are seeing.
It looks like you'll need to pass ' "published": true ' as part of your payload body in order to get any given publication scope to apply to the online store. I'm going to approach our documentation team to have this revised for future clarity improvements.
Best,
Graham S | API Support @ 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
User | RANK |
---|---|
5 | |
5 | |
4 | |
4 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022