python-shopee icon indicating copy to clipboard operation
python-shopee copied to clipboard

How to set a discount when listing an item

Open himacri opened this issue 5 years ago • 2 comments
trafficstars

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?

himacri avatar Oct 20 '20 15:10 himacri

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

Squallpka1 avatar Oct 21 '20 05:10 Squallpka1

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.

himacri avatar Oct 24 '20 22:10 himacri