python-shopee
python-shopee copied to clipboard
How to set a discount when listing an item
Hi, I would like to set a discount on an item when I list it for sale.
product_data = { "category_id": , "name": , "description": , "price": , "stock": , "weight": , "images": , "logistics":, "condition":, "item_sku":, }
What param do I need to add?
I believe you first need to set the campaign for the discount using.
import pyshopee
client = pyshopee.Client( shop_id, partner_id, key )
client.discount.add_discount(discount_name,start_time,end_time,items)
thats items is a list of the item you want in the discount campaign.
if your item have variation. items = [{ 'item_id': 'variations':[{variation_id,variation_promotion_price}] 'purchase_limit': }]
Althought I'm not clear how to do with item without variation. Also the 'start_time' and 'end_time' use timestamp.
source: https://open.shopee.com/documents?module=1&type=1&id=357
Thank you for your reply.
I wanted to know how to add an item to an already created discount setting.
There are no variations.
I will also check it myself.