文档中心 > API类目 > 淘宝买菜

taobao.freshx.promotion.coupon.update (优惠券更新)

更新优惠券

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param CouponDo 可选 创建优惠券入参
  • └ instruction
  • String
  • 可选
  • 满2元可使用
  • 使用规则
  • └ template_code
  • Number
  • 必须
  • 1111
  • 优惠券模板code
  • └ total_count
  • Number
  • 可选
  • 100
  • 发放券数量,不修改时为空
  • └ title
  • String
  • 可选
  • 满3元减2元
  • 标题,,不修改时为空
  • operator
  • User
  • 可选
  • 操作人,,不修改时为空
  • └ user_nick
  • String
  • 可选
  • 菜菜
  • 操作人nick
  • └ client_ip
  • String
  • 可选
  • 127.0.0.1
  • 操作人ip
  • └ user_id
  • String
  • 可选
  • 111
  • 操作人id
  • └ coupon_type
  • Number
  • 必须
  • 1
  • 券类型,创建券时返回的couponType

响应参数

名称 类型 示例值 描述
result Boolean true 结果

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
FreshxPromotionCouponUpdateRequest req = new FreshxPromotionCouponUpdateRequest();
FreshxPromotionCouponUpdateRequest.CouponDo obj1 = new FreshxPromotionCouponUpdateRequest.CouponDo();
obj1.setInstruction("满2元可使用");
obj1.setTemplateCode(1111L);
obj1.setTotalCount(100L);
obj1.setTitle("满3元减2元");
FreshxPromotionCouponUpdateRequest.User obj2 = new FreshxPromotionCouponUpdateRequest.User();
obj2.setUserNick("菜菜");
obj2.setClientIp("127.0.0.1");
obj2.setUserId("111");
obj1.setOperator(obj2);
obj1.setCouponType(1L);
req.setParam(obj1);
FreshxPromotionCouponUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<freshx_promotion_coupon_update_response>
    <result>true</result>
</freshx_promotion_coupon_update_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部