taobao.promotion.coupon.sns.send (微淘粉丝店铺优惠券发放接口)

通过接口批量发放店铺优惠券(每次只能发送100张,只能发给当前授权卖家店铺的微淘粉丝),发送成功则返回为空,发送失败则返回失败的买家列表和发送成功的买家和优惠券的number。注:如果所有买家都发放失败的话,is_success也为true,建议调用者根据返回的集合判断是否送入的买家都发放成功了

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
coupon_id Number 必须 48552 优惠券的id
buyer_nick String [] 可选 张三,历史
  • 最大列表长度:100
  • 买家昵称用半角','号分割
    open_uids String [] 可选 asd
  • 最大列表长度:999
  • asd

    响应参数

    名称 类型 示例值 描述
    failure_buyers ErrorMessage [] 没有发送成功的买家
    • └ buyer_nick
    • String
    • 张三
    • 买家昵称
    • └ reason
    • String
    • 买家不存在
    • 发送失败的原因
    • └ open_uid
    • String
    • asas
    • asas
    coupon_results CouponResult [] 发送成功的买家的昵称和优惠券的number
    • └ coupon_number
    • Number
    • 122345456
    • 已经发放优惠券的编号
    • └ buyer_nick
    • String
    • 买家昵称
    • 张三
    • └ open_uid
    • String
    • asas
    • asasa

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    PromotionCouponSnsSendRequest req = new PromotionCouponSnsSendRequest();
    req.setCouponId(48552L);
    req.setBuyerNick("张三,历史");
    req.setOpenUids("asd");
    PromotionCouponSnsSendResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <promotion_coupon_sns_send_response>
        <failure_buyers>
            <error_message>
                <buyer_nick>张三</buyer_nick>
                <reason>买家不存在</reason>
            </error_message>
        </failure_buyers>
        <coupon_results>
            <coupon_result>
                <coupon_number>122345456</coupon_number>
                <buyer_nick>买家昵称</buyer_nick>
            </coupon_result>
        </coupon_results>
    </promotion_coupon_sns_send_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>

    错误码解释

    错误码 错误描述 解决方案
    isv.coupon-error 优惠券不存在或者优惠券已经过期 检查优惠券
    isp.promotiontop-service-unavailable 系统异常 系统异常
    isv.error-unauthorized 卖家没有订购优惠券的服务 卖家没有订购优惠券的服务,必须订购优惠券或者是商城的用户
    isv.coupon-error 优惠券不存在或者优惠券已经过期 检查优惠券
    isp.promotiontop-service-unavailable 系统异常 系统异常
    isv.error-unauthorized 卖家没有订购优惠券的服务 卖家没有订购优惠券的服务,必须订购优惠券或者是商城的用户

    API工具

    如何获得此API

    FAQ

    返回
    顶部