文档中心 > API类目 > 淘宝互动平台开放招募

taobao.interaction.tblife.shop.item.buy (商城道具购买)

商城道具购买

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
input OpenRequest 必须 请求信息
  • param
  • OpenShopItemBuyParam
  • 必须
  • 业务参数
  • └ biz_code
  • String
  • 必须
  • xxx
  • 业务场景
  • └ item_id
  • Number
  • 必须
  • 1
  • 商品id
  • └ idempotent_id
  • String
  • 必须
  • xxx
  • 幂等id
  • └ point_type
  • String
  • 必须
  • xxx
  • 扣减币种
  • └ spend_num
  • Number
  • 必须
  • 1000
  • 扣减数量

响应参数

名称 类型 示例值 描述
output OpenResponse 响应信息
  • └ trace_id
  • String
  • xxx
  • 追踪id
  • └ msg
  • String
  • xxx
  • 响应信息(通常用于请求报错时,返回报错信息)
  • └ code
  • String
  • xxx
  • 响应码
  • └ success
  • Boolean
  • true
  • 是否成功
  • └ server_time
  • Number
  • 1669352100137
  • 服务器时间

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
InteractionTblifeShopItemBuyRequest req = new InteractionTblifeShopItemBuyRequest();
InteractionTblifeShopItemBuyRequest.OpenRequest obj1 = new InteractionTblifeShopItemBuyRequest.OpenRequest();
InteractionTblifeShopItemBuyRequest.OpenShopItemBuyParam obj2 = new InteractionTblifeShopItemBuyRequest.OpenShopItemBuyParam();
obj2.setBizCode("xxx");
obj2.setItemId(1L);
obj2.setIdempotentId("xxx");
obj2.setPointType("xxx");
obj2.setSpendNum(1000L);
obj1.setParam(obj2);
req.setInput(obj1);
InteractionTblifeShopItemBuyResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<interaction_tblife_shop_item_buy_response>
    <output>
        <trace_id>xxx</trace_id>
        <msg>xxx</msg>
        <code>xxx</code>
        <success>true</success>
        <server_time>1669352100137</server_time>
    </output>
</interaction_tblife_shop_item_buy_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

返回
顶部