采用官方taobao.trade.fullinfo.get( 获取单笔交易的详细信息 )接口拿到店铺订单详情,包括:买家信息,交易创造时间,商品交易数据,商品订单号,付款时间,付款金额,收货人手机号码,收货人姓名,收货人地址,交易状态等,订单接口信息可以明文,接口用于订单同步,erp系统,订单推送业务等,希望能够帮助到有需要的朋友,接口代码对接如下:
1.公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中,点击获取测试key和secret) |
secret | String | 是 | 调用密钥 |
api_name | String | 是 | API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等] |
cache | String | 否 | [yes,no]默认yes,将调用缓存的数据,速度比较快 |
result_type | String | 否 | [json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读 |
lang | String | 否 | [cn,en,ru]翻译语言,默认cn简体中文 |
version | String | 否 | API版本 |
2.请求参数
请求参数:api=
参数说明:其它参数:参考淘宝开放平台接口文档,与淘宝的参数一致 https://open.taobao.com/api.htm?docId=140&docType=2
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
api | String | 淘宝开放平台的接口名(如:taobao.picture.upload( 上传单张图片 )) | |
session | String | 授权换取的session_id | |
[其他参数] | String | 其它参数:参考淘宝开放平台接口文档,与淘宝的参数一致 https://open.taobao.com/api.htm?docId=140&docType=2 |
3. 请求示例(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://vx19970108018/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)
4.响应示例
- {"response":{"code":0,"message":"ok",
- "data":[{"receiver":
- {"address_detail":"福海街道塘尾社区凤塘大道聚源工业区A区A栋3楼东(AE8029)","city":"深圳市","country":"","district":"宝安区","matched":true,"mobile":"19970108018","name":"凌琳+021(AE8029)","oaid":"1wLUB94y0XZIkluxZ2tLrYsfH4pAEcg7P9BqkBx5ibfx4mFFkq7bXHRxg0U1ydvtox1eibCF","phone":"","privacy_protection":false,"secret_no_expire_time":"","state":"广东省","tid":"2401790907780124720","town":"福海街道"},"code":0,"message":"success","tid":"2401790907780124720"}],"trace_id":"","is_error":true,"version":"2.0","length":552},"data_from":"top.fw","error":"","reason":"","error_code":"0000","cache":0,"api_info":"today:179 max:20000 all[179=179+0+0];expires:2022-09-07","execution_time":"0.45","server_time":"Beijing\/2022-06-29 18:40:48","client_ip":"106.6.35.151","call_args":[],"api_type":"taobao","translate_language":"zh-CN","translate_engine":"google_cn","server_memory":"7.55MB","request_id":"gw-2.62bc2c303ab55","last_id":"1048084471"}