注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > API类目 > 采购宝API

taobao.pc.order.render (企业购订单渲染)

企业购订单渲染

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param ContractPlaceOrderReq 可选 渲染/创建订单接口参数
  • └ buyer_nick
  • String
  • 必须
  • 张三
  • 买家昵称
  • └ out_order_id
  • String
  • 必须
  • 10000001
  • 外部订单号
  • └ contract_no
  • String
  • 必须
  • 10000001
  • 合约ID
  • orders
  • ContractOrder []
  • 必须
  • 创单订单信息列表, 当前仅支持单主单, 即列表只包含1个元素
  • items
  • ContractItem []
  • 必须
  • 商品信息列表
  • └ item_id
  • Number
  • 必须
  • 3
  • 商品ID
  • └ sku_id
  • Number
  • 可选
  • 3
  • SKU ID(没有可不传)
  • └ quantity
  • Number
  • 必须
  • 10
  • 商品购买数量
  • └ unit_price
  • Number
  • 必须
  • 3
  • 商品单价
  • address
  • ContractAddress
  • 必须
  • 地址信息
  • └ address_detail
  • String
  • 必须
  • xxxxx
  • 收件地址
  • └ consignee_name
  • String
  • 必须
  • xxxxx
  • 收件人
  • └ mobile_phone
  • String
  • 必须
  • xxxxx
  • 电话号码
  • └ remark
  • String
  • 可选
  • 买家备注
  • 买家备注
  • └ social_credit_code
  • String
  • 必须
  • 社会信用编码
  • 社会信用编码
  • └ buyer_id
  • Number
  • 必须
  • 10000001
  • 买家ID

响应参数

名称 类型 示例值 描述
result Result result
  • └ success
  • Boolean
  • true
  • 操作是否成功
  • └ error_code
  • String
  • 200
  • 结果码
  • └ error_msg
  • String
  • 参数错误
  • 结果描述
  • contract_place_order
  • ContractPlaceOrder
  • 结果
  • └ contract_no
  • String
  • xxxxx
  • 合约ID
  • └ out_order_id
  • String
  • xxxxx
  • 外部订单编号
  • └ biz_order_ids
  • String []
  • Top,Pub
  • 企业购订单号
  • order_items
  • OrderItem []
  • 商品信息(仅渲染接口返回)
  • └ item_id
  • Number
  • 3
  • 商品ID
  • └ sku_id
  • Number
  • 3
  • 商品SKU ID
  • └ buy_amount
  • Number
  • 10
  • 购买数量
  • └ item_price
  • Number
  • 3
  • 商品价格
  • └ can_buy
  • Boolean
  • false
  • 是否可购买

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
PcOrderRenderRequest req = new PcOrderRenderRequest();
PcOrderRenderRequest.ContractPlaceOrderReq obj1 = new PcOrderRenderRequest.ContractPlaceOrderReq();
obj1.setBuyerNick("张三");
obj1.setOutOrderId("10000001");
obj1.setContractNo("10000001");
List<PcOrderRenderRequest.ContractOrder> list3 = new ArrayList<PcOrderRenderRequest.ContractOrder>();
PcOrderRenderRequest.ContractOrder obj4 = new PcOrderRenderRequest.ContractOrder();
list3.add(obj4);
List<PcOrderRenderRequest.ContractItem> list7 = new ArrayList<PcOrderRenderRequest.ContractItem>();
PcOrderRenderRequest.ContractItem obj8 = new PcOrderRenderRequest.ContractItem();
list7.add(obj8);
obj8.setItemId(3L);
obj8.setSkuId(3L);
obj8.setQuantity(10L);
obj8.setUnitPrice(3L);
list5.setItems(list7);
PcOrderRenderRequest.ContractAddress obj10 = new PcOrderRenderRequest.ContractAddress();
obj10.setAddressDetail("xxxxx");
obj10.setConsigneeName("xxxxx");
obj10.setMobilePhone("xxxxx");
list9.setAddress(obj10);
obj4.setRemark("买家备注");
obj4.setSocialCreditCode("社会信用编码");
obj1.setOrders(list3);
obj1.setBuyerId(10000001L);
req.setParam(obj1);
PcOrderRenderResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<pc_order_render_response>
    <result>
        <success>true</success>
        <error_code>200</error_code>
        <error_msg>参数错误</error_msg>
        <contract_place_order>
            <contract_no>xxxxx</contract_no>
            <out_order_id>xxxxx</out_order_id>
            <biz_order_ids>
                <string>Top</string>
                <string>Pub</string>
            </biz_order_ids>
            <order_items>
                <order_item>
                    <item_id>3</item_id>
                    <sku_id>3</sku_id>
                    <buy_amount>10</buy_amount>
                    <item_price>3</item_price>
                    <can_buy>false</can_buy>
                </order_item>
            </order_items>
        </contract_place_order>
    </result>
</pc_order_render_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

返回
顶部