创建店铺优惠券。有效期内的店铺优惠券总数量不超过50张
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
denominations | Number | 必须 | 3 | 优惠券的面额,必须是3,5,10,20,50,100 | |
start_time | Date | 可选 | 2010-02-15 00:00:00 | 优惠券的生效时间 | |
end_time | Date | 必须 | 2010-02-15 23:59:59 | 优惠券的截止日期 | |
condition | Number | 可选 | 5 | 订单满多少元才能用这个优惠券,500就是满500元才能使用 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
coupon_id | Number | 123456 | 优惠券的id |
1 2 3 4 5 6 7 8 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); PromotionCouponAddRequest req = new PromotionCouponAddRequest(); req.setDenominations(3L); req.setStartTime(StringUtils.parseDateTime( "2010-02-15 00:00:00" )); req.setEndTime(StringUtils.parseDateTime( "2010-02-15 23:59:59" )); req.setCondition(5L); PromotionCouponAddResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 | < promotion_coupon_add_response > < coupon_id >123456</ coupon_id > </ promotion_coupon_add_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isp.promotiontop-service-unavailable | 系统异常 | 系统异常联络淘宝 |
isv.parameter-endtime-error | 优惠券日期错误 | 优惠券的结束日期必须大于等于当天,例如今天是2011-02-22,结束日期必须大于等于2011-02-22 23:59:59,优惠券结束日期不能大于6个月 |
isv.parameter-denominations-error | 面额必须是3,5,10,20,50,100 | 面额必须是3,5,10,20,50,100 |
isv.parameter-condition-error | 优惠券的使用条件错误 | 优惠券的使用条件不能小于面额,0代表没有使用条件,默认使用条件面额+1分 |
isv.error-unauthorized | 卖家没有订购优惠券的服务 | 卖家没有订购优惠券的服务,必须订购优惠券或者是商城的用户 |
isv.parameter-count-overflowing | 优惠券数量超出100个 | 优惠券数量超出100个 |
isv.parameter-starttime-error | 优惠券日期错误 | 如果填写了优惠券的生效时间,优惠券的有效期(失效日期-生效日期)必须大于等于24小时 |