淘寶開放平臺交易API - 查詢賣家已賣出的增量交易資料

chatGPT發表於2023-05-19

淘寶開放平臺(Taobao Open Platform)是基於淘寶各類電子商務業務的開放平臺,提供外部合作伙伴參與服務淘寶使用者的各類原材料,如業務API、賬號體系、資料推送,奇門閘道器等。

搜尋當前會話使用者作為賣家已賣出的增量交易資料(只能獲取到三個月以內的交易資訊)

1. 一次請求只能查詢時間跨度為一天的增量交易記錄,即end_modified - start_modified <= 1天。
2. 返回的資料結果是以訂單的修改時間倒序排列的,透過從後往前翻頁的方式可以避免漏單問題。
3. 返回的資料結果只包含了訂單的部分資料,可透過taobao.trade.fullinfo.get獲取訂單詳情。
適用返利系統、ERP、OMS軟體等,需要透過商品API介面獲取商品詳情資訊,或者訂單詳情來滿足業務場景需要。具體包括:商品的標題、價格、SKU、主圖、評價、訂單詳情、使用者地址、等維度資訊。



一、註冊萬邦開放平臺賬號

二、獲取介面秘鑰apikey

登入個人中心 - 系統設定 - 介面管理 找到接秘鑰apikey,apikey 介面秘鑰是呼叫介面的憑證,請妥善保管!


三、請求引數



四、請求示例

$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TradesSoldIncrementGetRequest;
$req->setFields("tid,type,status,payment,orders,rx_audit_status");
$req->setStartModified("2000-01-01 00:00:00");
$req->setEndModified("2000-01-02 00:00:00");
$req->setStatus("TRADE_NO_CREATE_PAY");
$req->setType("fixed");
$req->setExtType("service");
$req->setBuyerNick("zhangsan");
$req->setRateStatus("RATE_UNBUYER");
$req->setTag("time_card");
$req->setPageNo("1");
$req->setPageSize("40");
$req->setUseHasNext("true");
$req->setBuyerOpenUid("AAHm5d-EAAeGwJedwSHpg8bT");
$resp = $c->execute($req, $sessionKey);

五、響應示例

<trades_sold_increment_get_response>
    <total_results>100</total_results>
    <has_next>true</has_next>
    <trades>
        <trade>
            <seller_nick>我在測試</seller_nick>
            <buyer_nick>我在測試</buyer_nick>
            <buyer_open_uid>AAHk5d-EAAeGwJedwSFu0XXX</buyer_open_uid>
            <title>麥包包</title>
            <type>fixed(一口價)</type>
            <created>2000-01-01 00:00:00</created>
            <sid>NP1021246146</sid>
            <tid>2231958349</tid>
            <acookie_id>1a11a0987628772c002ec7d0eec2a352</acookie_id>
            <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>
            <async_modified>2000-01-01 00:00:00</async_modified>
            <consign_time>2000-01-01 00:00:00</consign_time>
            <received_payment>200.07</received_payment>
            <commission_fee>200.07</commission_fee>
            <alipay_no>2009112081173831</alipay_no>
            <alipay_id>2011082299567459</alipay_id>
            <buyer_area>浙江省杭州市</buyer_area>
            <nut_feature>;buyernick:tester;card:123;buyerArea:杭州</nut_feature>
            <pic_path>
            <num_iid>3424234</num_iid>
            <price>200.07</price>
            <cod_fee>12.07</cod_fee>
            <cod_status>EW_CREATED(訂單已建立)</cod_status>
            <shipping_type>free</shipping_type>
            <num>1</num>
            <point_fee>0</point_fee>
            <real_point_fee>0</real_point_fee>
            <buyer_obtain_point_fee>0</buyer_obtain_point_fee>
            <receiver_name>東方不敗</receiver_name>
            <receiver_state>浙江省</receiver_state>
            <receiver_city>杭州市</receiver_city>
            <receiver_district>西湖區</receiver_district>
            <receiver_town>三墎鎮</receiver_town>
            <receiver_address>淘寶城911號</receiver_address>
            <receiver_zip>223700</receiver_zip>
            <receiver_mobile>13512501826</receiver_mobile>
            <receiver_phone>13819175372</receiver_phone>
            <seller_flag>1</seller_flag>
            <is_lgtype>true</is_lgtype>
            <lg_aging_type>次日達</lg_aging_type>
            <lg_aging>2012-06-19 15:16:14</lg_aging>
            <is_brand_sale>true</is_brand_sale>
            <is_force_wlb>true</is_force_wlb>
            <has_buyer_message>true</has_buyer_message>
            <credit_card_fee>30.5</credit_card_fee>
            <step_trade_status>FRONT_NOPAID_FINAL_NOPAID</step_trade_status>
            <step_paid_fee>525.70</step_paid_fee>
            <mark_desc>該訂單需要延長收貨時間</mark_desc>
            <has_yfx>true</has_yfx>
            <yfx_fee>0.50</yfx_fee>
            <yfx_id>135751716473138</yfx_id>
            <yfx_type>taojinbi</yfx_type>
            <trade_source>ownshop</trade_source>
            <send_time>2000-01-01</send_time>
            <seller_can_rate>true</seller_can_rate>
            <is_part_consign>true</is_part_consign>
            <is_daixiao>true</is_daixiao>
            <is_wt>true</is_wt>
            <orders>
                <order>
                    <title>山寨版測試機器</title>
                    <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>
                    <item_meal_id>2564854632</item_meal_id>
                    <item_meal_name>M8原裝電池:便攜支架:M8專用座充:莫凡保護袋</item_meal_name>
                    <num>1</num>
                    <buyer_rate>true</buyer_rate>
                    <seller_rate>true</seller_rate>
                    <refund_id>2231958349</refund_id>
                    <seller_type>B(商城商家)</seller_type>
                    <cid>123456</cid>
                    <end_time>2012-04-07 00:00:00</end_time>
                    <is_service_order>true</is_service_order>
                    <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_oid>23194074143138</bind_oid>
                    <is_daixiao>true</is_daixiao>
                    <ticket_outer_id>123456abcd</ticket_outer_id>
                    <ticket_expdate_key>100FFFFFF02374020000002001020304000A</ticket_expdate_key>
                    <is_www>true</is_www>
                    <store_code>南京QDHEWL-0004</store_code>
                    <tmser_spu_code>裝潢干支裝服務</tmser_spu_code>
                    <sub_order_tax_fee>0</sub_order_tax_fee>
                    <sub_order_tax_rate>0</sub_order_tax_rate>
                    <zhengji_status>1</zhengji_status>
                    <md_qualification>true_access</md_qualification>
                    <md_fee>999</md_fee>
                    <sub_order_tax_promotion_fee>0</sub_order_tax_promotion_fee>
                    <tax_free>true</tax_free>
                    <tax_coupon_discount>0</tax_coupon_discount>
                    <special_refund_type>priceProtect</special_refund_type>
                    <is_devalue_fee>false</is_devalue_fee>
                    <is_idle>1</is_idle>
                </order>
            </orders>
            <service_orders>
                <service_order>
                    <oid>110770592823138</oid>
                    <item_oid>110770592803138</item_oid>
                    <service_id>2342344</service_id>
                    <service_detail_url>
                    <num>1</num>
                    <price>39.09</price>
                    <payment>29.98</payment>
                    <title>滾筒洗衣機</title>
                    <total_fee>39.09</total_fee>
                    <buyer_nick>小倩2005</buyer_nick>
                    <refund_id>2231958349</refund_id>
                    <seller_nick>麥包包</seller_nick>
                    <pic_path>
                    <tmser_spu_code>裝潢干支裝服務</tmser_spu_code>
                </service_order>
            </service_orders>
            <zero_purchase>true</zero_purchase>
            <receiver_country>中國</receiver_country>
            <order_tax_fee>0</order_tax_fee>
            <shop_pick>11</shop_pick>
            <rx_audit_status>0</rx_audit_status>
            <post_gate_declare>true</post_gate_declare>
            <cross_bonded_declare>true</cross_bonded_declare>
            <order_tax_promotion_fee>0</order_tax_promotion_fee>
            <service_type>timedd,jiaju</service_type>
            <is_o2o_passport>true</is_o2o_passport>
            <oaid>2w2RYE45iahnF4aiaJ7pHKCJ3Hwnbgnq2PH3AfpQVyWZNHKS9wNgAAOUfCVt9XZMetogNHwc</oaid>
        </trade>
    </trades></trades_sold_increment_get_response>

六、其他測試




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70026630/viewspace-2953225/,如需轉載,請註明出處,否則將追究法律責任。

相關文章