Bigcommerce Python API, how do I create a product with an image?

帅比萌擦擦* 提交于 2019-12-11 01:35:53

问题


how do I upload an image (from the web) using Bigcommerce's Python API?

I've got this so far:

custom = api.Products.create(name='Test', type='physical', price=8.33, categories=[85], availability='available', weight=0)

Thank you! I've tried almost everything!


回答1:


This will create the product on the BigCommerce website. You create the image after creating the product, by entering the following line. The image_file tag should be a fully qualified URL pointing to an image that is accessible to the BigCommerce website, being found either on another website or on your own webserver.

api.ProductImages.create(parentid=custom.id, image_file='http://www.evenmore.co.uk/images/emgrab_s.jpg', description='My image description')



来源:https://stackoverflow.com/questions/42003461/bigcommerce-python-api-how-do-i-create-a-product-with-an-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!