用途:管理 Shopee 店铺折扣(Discount)促销,覆盖 Shopee Open Platform Discount 模块的 12 个 API,包括创建折扣、添加/删除折扣商品、查询折扣列表与详情、更新折扣及商品、提前结束折扣,以及 SIP 折扣的查询、设置与删除。
主要能力:提供 12 个脚本,分别对应 add_discount、add_discount_item、get_discount_list、get_discount、update_discount、update_discount_item、end_discount、delete_discount、delete_discount_item、get_sip_discounts、set_sip_discount、delete_sip_discount,另有通用入口 discount_api.py。
使用方式:先运行 python scripts/check_auth_dependency.py,若退出码为 42 需先安装 linkfox-shopee-store-auth 完成选店授权。调用统一走 POST /shopee/developerProxy,请求体传入 shopId(或 merchantId),由服务端解析 token 转发,path 须为 api/v2/discount/...。脚本用法为 python scripts/<脚本名>.py '<JSON 参数>' [--inline]。
输出策略:完整响应始终写入 <cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-discount-<timestamp>.json,禁止写入 /tmp;响应体不超过 8 KB 时打印完整 JSON,超过 8 KB 时仅输出摘要,加 --inline 可强制全量打印。建议先用摘要判断,再用 jq 或 ConvertFrom-Json 从落盘文件按需抽取字段。
限制:本工具不消耗算力;失败或空结果不得自动换关键词、翻页或连续试探,需继续检索时应先向用户说明会产生额外消耗。未配置 LINKFOX_AGENT_API_KEY 或 LINKFOXAGENT_API_KEY、响应 401/402、提示算力或余额不足时,按 references/onboarding.md 处理。Bundle Deal、Voucher、Add-On Deal、Shop Flash Sale、Follow Prize 及商品 listing 不属于本技能。入参与响应细节见 references/apis/ 下各文档。