大淘客,让选品更简单! |

{{item.type_name}}:

API 市场 / 订单查询
 

订单查询
吐槽建议
应用场景:
当处理淘系佣金结算、查看返利、查询订单数据的时候,调用该接口,获取订单数据,统计金额
接口说明:
返回用户某段时间内的所有淘系订单,实时掌握订单数据,明确返佣金额。如需单独提量接口可联系QQ:3001138400 2023/5/18-部分字段将更新:https://qn.taobao.com/headline/news/10698445?spm=a211vu.12026430.0.0.1fff3929P0kYHO
订单接口使用攻略
使用人数: 1000+
订单查询 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

请求地址:https://openapi.dataoke.com/api/tb-service/get-order-details 复制

请求方式:GET

公共参数:
请求参数:

注:请求参数须区分大小写

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/tb-service/get-order-details";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.0");
paraMap.put("appKey", appKey);
paraMap.put("pageSize", "2");
paraMap.put("endTime", "2020-07-10 19:00:00");
paraMap.put("startTime", "2020-07-10 16:00:00");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkGetOrderDetailsRequest request = new DtkGetOrderDetailsRequest();
request.setVersion("v1.0.0");
request.setQueryType(3);
request.setStartTime("2021-07-13 11:30:00");
request.setEndTime("2021-07-13 12:00:00");
request.setPositionIndex("1626147000_|1626150601_");
request.setPageSize(20);
request.setMemberType(2);
request.setTkStatus(12);
request.setJumpType(1);
request.setPageNo(1);
request.setOrderScene(1);
DtkApiResponse < DtkGetOrderDetailsResponse > execute = client.execute(request);
 //淘系订单查询
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/tb-service/get-order-details";
    $url = $host . '?' . http_build_query($data);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $output = curl_exec($ch);
    $a = curl_error($ch);
    if(!empty($a)){
        return json_encode(array('code'=>10003, 'msg'=>$a));
    }
    curl_close($ch);
    return $output;

    SDK调用示例
    $client = new GetOrderDetails();
    $client->setAppKey("xxxxxxxxx");
    $client->setAppSecret("xxxxxxxxxxxxxxxxxxxxxxxxx");
    $client->setVersion("v1.0.0");

    $res = $client->setParams([])->request();

package main

import (
	"fmt"
	"gitee.com/dtk-developer/openapi-sdk-go/sdk"
)

func main() {
	// 1.初始化所需要的参数appKey, appSecret, version
	var (
		appKey = "xxxxxxxxxx"
		appSecret = "xxxxxxxxxx"
		version = "v1.3.1"
	)

	// 2.初始化开放平台api的客户端句柄
	oa := &sdk.OpenApi{}
	oa.AppKey = appKey
	oa.AppSecret = appSecret
	oa.Version = version
	client :=  oa.GetClient()

	// 3.准备请求参数
	params := map[string]string {
		"queryType": "1",
	}

	// 4.业务请求,示例使用淘系订单查询和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.GetOrderDetails(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)

	// 复用client句柄
	params = map[string]string {
		// 指定接口版本
		"version": "v1.0.0",
		"content": "1👈¥fym8XiJU9Oi¥ https://s.click.taobao.com/Ys3TNlu  包邮 漫花抽纸10包4层加厚280张/包纸巾卫生纸家用实惠装面巾纸",
	}
	resp, err = client.ParseContent(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)
}
返回示例:
{
    "time": 1594891757171,
    "code": 0,
    "msg": "成功",
    "data": {
        "has_pre": false,
        "has_next": true,
        "page_no": 1,
        "results": {
            "publisher_order_dto": [
                {
                    "terminal_type": "无线",
                    "item_category_name": "洗护清洁剂/卫生巾/纸/香薰",
                    "tk_paid_time": "2020-07-10 18:53:03",
                    "adzone_id": 53457500119,
                    "alipay_total_price": "32.64",
                    "seller_shop_title": "众九州医药保健",
                    "alimama_share_fee": "0.05",
                    "trade_id": "1112294658659816352",
                    "click_time": "2020-07-10 18:51:58",
                    "subsidy_rate": "0.00",
                    "refund_tag": 0,
                    "item_title": "【3支装】厦门美商薄荷膏清凉提神醒脑防困防瞌睡防蚊考研旅游",
                    "order_type": "淘宝",
                    "tb_paid_time": "2020-07-10 18:52:53",
                    "tk_order_role": 2,
                    "total_commission_fee": "0.00",
                    "pub_id": 116971121,
                    "item_img": "//img.alicdn.com/tfscom/i3/54701812/O1CN01XDhkj51PFwGekZJtr_!!54701812.jpg",
                    "alimama_rate": "10.00",
                    "item_id": 43907626661,
                    "item_price": "40.80",
                    "tb_deposit_time": "--",
                    "tk_status": 12,
                    "total_commission_rate": "1.50",
                    "trade_parent_id": "1112294658659816352",
                    "subsidy_type": "--",
                    "tk_create_time": "2020-07-10 18:52:56",
                    "pub_share_fee": "0.00",
                    "item_num": 1,
                    "tk_commission_fee_for_media_platform": "0.00",
                    "income_rate": "1.50",
                    "site_name": "番薯君",
                    "pub_share_pre_fee": "0.49",
                    "tk_commission_rate_for_media_platform": "0.00",
                    "tk_deposit_time": "--",
                    "tk_total_rate": "1.50",
                    "pub_share_rate": "100.00",
                    "adzone_name": "番薯君优惠器",
                    "site_id": 24922285,
                    "item_link": "http://item.taobao.com/item.htm?id=43907626661",
                    "deposit_price": "0.00",
                    "seller_nick": "歌手2007",
                    "subsidy_fee": "0.00",
                    "flow_source": "--",
                    "tk_commission_pre_fee_for_media_platform": "0.00"
                },
                {
                    "terminal_type": "无线",
                    "item_category_name": "其他",
                    "tk_paid_time": "2020-07-10 18:40:04",
                    "adzone_id": 120772866,
                    "alipay_total_price": "0.00",
                    "seller_shop_title": "创梦空间食品专营店",
                    "alimama_share_fee": "0.00",
                    "trade_id": "599091492522365496",
                    "click_time": "2020-07-10 18:39:20",
                    "subsidy_rate": "0.01",
                    "refund_tag": 0,
                    "item_title": "赠品红杯",
                    "order_type": "天猫",
                    "tb_paid_time": "2020-07-10 18:39:54",
                    "tk_order_role": 2,
                    "total_commission_fee": "0.00",
                    "pub_id": 116971121,
                    "item_img": "//img.alicdn.com/tfscom/i1/3906500494/O1CN017rPooj1FWI9oaOM62_!!0-item_pic.jpg",
                    "alimama_rate": "10.00",
                    "item_id": 588187231794,
                    "item_price": "10.00",
                    "tb_deposit_time": "--",
                    "tk_status": 12,
                    "total_commission_rate": "1.50",
                    "trade_parent_id": "599091492519365496",
                    "subsidy_type": "天猫",
                    "tk_create_time": "2020-07-10 18:40:00",
                    "pub_share_fee": "0.00",
                    "item_num": 1,
                    "tk_commission_fee_for_media_platform": "0.00",
                    "income_rate": "1.51",
                    "site_name": "爱分享(手机客户端专享)_116971121",
                    "pub_share_pre_fee": "0.00",
                    "tk_commission_rate_for_media_platform": "0.00",
                    "tk_deposit_time": "--",
                    "tk_total_rate": "1.51",
                    "pub_share_rate": "100.00",
                    "adzone_name": "爱分享",
                    "site_id": 15572247,
                    "item_link": "http://item.taobao.com/item.htm?id=588187231794",
                    "deposit_price": "0.00",
                    "seller_nick": "创梦空间食品专营店",
                    "subsidy_fee": "0.00",
                    "flow_source": "--",
                    "tk_commission_pre_fee_for_media_platform": "0.00"
                }
            ]
        },
        "position_index": "1594377600_IfQpGv889W2|1594378376_1kajVdFgapW2",
        "page_size": 2
    }
}
常见错误码:
{
    "time": 1594888322820,
    "code": 0,
    "msg": "成功",
    "data": {
        "error_response": {
            "msg": "Remote service error",
            "code": 15,
            "sub_msg": "开始时间或结束时间参数非法",
            "sub_code": "2000",
            "request_id": "6ha6khl7fef4"
        }
    }
}
错误码列表: