获取CRM单表交易的详情
1. 只有单笔订单的情况下Trade数据结构中才包含商品相关的信息
2. 获取到的Order中的payment字段在单笔子订单时包含物流费用,多笔子订单时不包含物流费用
3. 获取红包优惠金额可以使用字段 coupon_fee
4. 请按需获取字段,减少TOP系统的压力
点击查看更多交易API说明
| 名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
|---|---|---|---|---|---|
| fields | String | 必须 | tid,type,status,payment,orders,promotion_details | 需要返回的字段列表,多个字段用半角逗号分隔,可选值为返回示例中能看到的所有字段。 | |
| tid | Number | 必须 | 123456789 | 交易编号 |
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| trade | Trade | 交易主订单信息 | |
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TradeSimpleGetRequest req = new TradeSimpleGetRequest();
req.setFields("tid,type,status,payment,orders,promotion_details");
req.setTid(123456789L);
TradeSimpleGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
<trade_simple_get_response>
<trade>
<buyer_open_uid>AAHk5d-EAAeGwJedwSFu0XXX</buyer_open_uid>
<title>麦包包</title>
<type>fixed(一口价)</type>
<created>2000-01-01 00:00:00</created>
<tid>2231958349</tid>
<seller_rate>true</seller_rate>
<buyer_rate>true</buyer_rate>
<status>TRADE_NO_CREATE_PAY</status>
<payment>200.07</payment>
<discount_fee>200.07</discount_fee>
<adjust_fee>200.07</adjust_fee>
<post_fee>200.07</post_fee>
<total_fee>200.07</total_fee>
<pay_time>2000-01-01 00:00:00</pay_time>
<end_time>2000-01-01 00:00:00</end_time>
<modified>2000-01-01 00:00:00</modified>
<consign_time>2000-01-01 00:00:00</consign_time>
<received_payment>200.07</received_payment>
<buyer_memo>上衣要大一号</buyer_memo>
<seller_memo>好的</seller_memo>
<buyer_message>要送的礼物的,不要忘记的哦</buyer_message>
<pic_path>http://img08.taobao.net/bao/uploaded/i8/T1jVXXXePbXXaoPB6a_091917.jpg</pic_path>
<num_iid>3424234</num_iid>
<price>200.07</price>
<shipping_type>free</shipping_type>
<num>1</num>
<receiver_state>浙江省</receiver_state>
<receiver_city>杭州市</receiver_city>
<available_confirm_fee>200.07</available_confirm_fee>
<has_post_fee>true</has_post_fee>
<timeout_action_time>2000-01-01 00:00:00</timeout_action_time>
<snapshot_url>T1mURbXopZXXXe3rLI.1257513712679_snap</snapshot_url>
<step_trade_status>FRONT_NOPAID_FINAL_NOPAID</step_trade_status>
<step_paid_fee>525.70</step_paid_fee>
<can_rate>true</can_rate>
<seller_can_rate>true</seller_can_rate>
<orders>
<order>
<title>山寨版测试机器</title>
<pic_path>http://img08.taobao.net/bao/uploaded/i8/T1jVXXXePbXXaoPB6a_091917.jpg</pic_path>
<price>200.07</price>
<num_iid>2342344</num_iid>
<sku_id>5937146</sku_id>
<outer_iid>152e442aefe88dd41cb0879232c0dcb0</outer_iid>
<outer_sku_id>81893848</outer_sku_id>
<refund_status>SUCCESS(退款成功)</refund_status>
<status>TRADE_NO_CREATE_PAY</status>
<oid>2231958349</oid>
<total_fee>200.07</total_fee>
<payment>200.07</payment>
<discount_fee>200.07</discount_fee>
<adjust_fee>1.01</adjust_fee>
<divide_order_fee>21.00</divide_order_fee>
<part_mjz_discount>21.00</part_mjz_discount>
<sku_properties_name>颜色:桔色;尺码:M</sku_properties_name>
<num>1</num>
<snapshot_url>T1mURbXopZXXXe3rLI.1257513712679_snap</snapshot_url>
<timeout_action_time>2000-01-01 00:00:00</timeout_action_time>
<buyer_rate>true</buyer_rate>
<seller_rate>true</seller_rate>
<refund_id>2231958349</refund_id>
<cid>123456</cid>
<is_oversold>true</is_oversold>
<end_time>2012-04-07 00:00:00</end_time>
<order_from>jhs</order_from>
<consign_time>2013-01-13 15:23:00</consign_time>
<shipping_type>post</shipping_type>
<logistics_company>顺风快递</logistics_company>
<invoice_no>05432465</invoice_no>
<bind_oids>193741211090019,193741211080019</bind_oids>
<item_meal_id>2564854632</item_meal_id>
<expand_card_expand_price_used_suborder>10.01</expand_card_expand_price_used_suborder>
<expand_card_basic_price_used_suborder>10.01</expand_card_basic_price_used_suborder>
<customization>{ "itemId": 123, "skuId": 123, "text": [ { "id": 44, "content": "home" } ], "pic": [ { "id": 44, "url": "sn" } ] ,"dingzhi":";pluginId:182;dingzhiId:157886;"}</customization>
<is_idle>1</is_idle>
</order>
</orders>
<promotion_details>
<promotion_details>
<id>22331764490705</id>
<promotion_name>满就减钱</promotion_name>
<discount_fee>10.00</discount_fee>
<gift_item_name>晨光签字笔</gift_item_name>
<gift_item_id>13233791195</gift_item_id>
<gift_item_num>1</gift_item_num>
<promotion_desc>双11促销,满就送</promotion_desc>
<promotion_id>mjs</promotion_id>
</promotion_details>
</promotion_details>
<service_orders>
<service_orders>
<oid>110770592823138</oid>
<item_oid>110770592803138</item_oid>
<service_id>2342344</service_id>
<service_detail_url>http://wt.taobao.com/plan.htm?plan_id=planId</service_detail_url>
<num>1</num>
<price>39.09</price>
<payment>29.98</payment>
<title>滚筒洗衣机</title>
<total_fee>39.09</total_fee>
<refund_id>2231958349</refund_id>
<seller_nick>麦包包</seller_nick>
<pic_path>http://img08.taobao.com/bao/upload/i8/T1jVXXXePb_a0908.jpg</pic_path>
<tmser_spu_code>家装干支装服务</tmser_spu_code>
</service_orders>
</service_orders>
<trade_from>WAP,JHS</trade_from>
<seller_nick>我在测试</seller_nick>
<expandcard_info>
<basic_price>0.01</basic_price>
<expand_price>0.01</expand_price>
<basic_price_used>0.01</basic_price_used>
<expand_price_used>0.01</expand_price_used>
</expandcard_info>
<expand_card_basic_price>0.01</expand_card_basic_price>
<expand_card_expand_price>0.01</expand_card_expand_price>
<expand_card_basic_price_used>0.01</expand_card_basic_price_used>
<expand_card_expand_price_used>0.01</expand_card_expand_price_used>
<is_part_consign>true</is_part_consign>
<rx_audit_status>0</rx_audit_status>
<coupon_fee>100</coupon_fee>
<seller_flag>1</seller_flag>
<ouid>AAHk5d123</ouid>
<real_receiver_open_id>AAEnVKOdAOIduo9TH9hjf-zb</real_receiver_open_id>
<real_receiver_display_nick>这是一个昵称</real_receiver_display_nick>
<post_fee_type>giftprepaid</post_fee_type>
<real_post_fee>11</real_post_fee>
<refund_post_fee>8</refund_post_fee>
<gift_post_fee_role>0</gift_post_fee_role>
</trade>
</trade_simple_get_response>
<error_response>
<code>50</code>
<msg>Remote service error</msg>
<sub_code>isv.invalid-parameter</sub_code>
<sub_msg>非法参数</sub_msg>
</error_response>
| 错误码 | 错误描述 | 解决方案 |
|---|---|---|
| isv.invalid-permission | 必须是此交易的买家或卖家才能获取交易详细信息 | 保证传入的订单ID和卖家SessionKey信息是一致的 |
| isv.trade-not-exist | 交易不存在 | 订单已进入历史库,不再提供实时查询,出现此错误请清除本地数据库该订单,不要重试 |
| isv.invalid-parameter:tid | 订单ID不存在,或者使用了子订单ID来查询 | 请填写正确的订单ID,或使用主订单ID来查询 |
| isv.trade-service-access-frequency | 交易慢查询访问太频繁 | 缩短查询订单的时间范围,减少超时查询的次数,或者等待一段时间后再来查询 |
| isp.trade-service-degrade | 单位时间内慢查询过多,服务被降级 | 请稍后重试。 |
| isp.commission-service-unavailable | 佣金服务不可用 | 重试 |
| isp.trade-service-unavailable | 交易服务不可用 | 适当重试 |
| isp.trade-service-failed | 服务不可用 | 重试 |
| isp.call-limited | 交易服务限流 | 请稍后重试 |
| isp.remote-connection-error | 交易服务连接依赖的远程服务错误 | 请稍后重试 |
| isp.remote-service-timeout | 交易服务处理超时 | 请稍后重试 |
| isv.invalid-parameter | 请求参数有误 | 请传入正确的参数 |
| isv.astrolabe-trade-closured | 门店发货拦截订单 | 重试 |
| isp.contextPrepareError | 交易服务不可用 | 重试 |
| isv.trade-hold | 订单已经被星盘拦截 | 对接星盘发货系统 |