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
I am having a issue with creating a product, when I create the product the price or quantity does not get published like the rest of the attributes shown. I've included my code (python). Can anyone help pls?
import shopify API_KEY = '' PASSWORD = '' SHOP_NAME = '' shop_url = "https://SHOP.myshopify.com/admin" shopify.ShopifyResource.set_user(API_KEY) shopify.ShopifyResource.set_password(PASSWORD) shopify.ShopifyResource.set_site(shop_url) shop = shopify.Shop.current() new_product = shopify.Product() new_product.title = "title" new_product.body_html = "test" new_product.price = 19.99 new_product.quantity = 1 new_product.save() new_image = shopify.Image(dict(product_id=new_product.id)) new_image.src="" new_image.save()
https://help.shopify.com/en/api/reference/products/product#create
Check link above. If you see the response of API, price and quantity are the Variant level.
Even if a product has no size/color variations , it still needs a default variant.
You are sending price and quantity at the product level . it has to be sent at the Variant level
"product": { "variants": [ { "price": "0.00",
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