Development discussions around Shopify APIs
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",
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023