Taobao (tmall) captures store order decryption data, prints the electronic form, pushes the order and saves it in the erp software

foreword 


Recently, a manufacturer proposed to collect the order details data of Taobao (tmall) stores into the background ERP management system, and to realize the function of printing electronic face sheets offline. To take over this demand, apply for a Taobao (tmall) developer account according to the guidelines given by Du Niang, but. . . The open platform closes the order transmission interface, which is only open to the manufacturer's self-developed software, and it is also necessary to rent Jushi Tower. A series of operations is really heavenly, there is no way to go through it, and finally there is no way to use the interface provided by the third-party supplier to realize the curve to save the country.

Implementation ideas

Method 1: Provide a Google browser plug-in to install in the Google browser extension program, and then the user manually logs in to the Taobao store, decrypts the GOOGLE-COOKIE to get the cookie in the login of the Taobao website, and automatically downloads the order data from the Taobao order page through the cookie. The disadvantage of this method is that the cookie will have an expiration date, and the cookie value needs to be updated continuously.
Method 2: connect to the relevant interface of Taobao (tmall) open platform, purchase store authorization according to the service link of Taobao application market provided by the third party, and call the interface after obtaining the store authorization to analyze the order data, including product information and logistics information , order number, customer mobile phone number, address and other important information are saved; and then compared with the local business system to insert and save, including return information, and open the express bird interface to realize the printing of electronic face sheets.

Click to get the request key and secret

Code request example (CURL, PHP, PHPsdk, Java, C#, Python…)

# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://wx19970108018/taobao/custom/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&method="
headers = {
    "Accept-Encoding": "gzip",
    "Connection": "close"
}
if __name__ == "__main__":
    r = requests.get(url, headers=headers)
    json_obj = r.json()
    print(json_obj)

Method 1 Code Response Example

 

 Method 2 code response example:

{"response":{"code":0,"message":"ok","data":[{"receiver":{"address_detail":"南湖街道南湖新村西街(黄金大白楼)3单元503室","city":"长春市","country":"","district":"朝阳区","matched":true,"mobile":"13331570019","name":"赵文子昇","oaid":"1umfLygxZbkdgxw2c8XONfg15XmbkmNv491vvXSiaBcyC41nSxsWA5qkJFJ4xaJ3x1dLoSUj","phone":"","privacy_protection":false,"secret_no_expire_time":"","state":"吉林省","tid":"16659180859002439983","town":"南湖街道"},"code":0,"message":"success","tid":"16659180859024393983"}],"trace_id":"","is_error":true,"version":"2.0","length":532},"data_from":"top.fw","error":"","reason":"","error_code":"0000","cache":0,"api_info":"today:3679 max:15000 all[3679=3679+0+0];expires:2022-10-20","execution_time":"0.431","server_time":"Beijing\/2022-09-09 09:55:37","client_ip":"106.6.37.179","call_args":[],"api_type":"taobao","translate_language":"zh-CN","translate_engine":"google_cn","server_memory":"7.55MB","request_id":"gw-2.631a9d191b29a","last_id":"12049194060"}

 

Guess you like

Origin blog.csdn.net/Andyfu2019/article/details/126776124