淘宝联盟高级API - 淘宝联盟订单接口 淘宝客订单接口

全新淘宝客订单查询接口,实时掌握订单数据,获取淘宝客订单数据,字段完整,快速查询淘客订单,可按照订单淘客创建时间查询,订单淘客付款时间查询,订单淘客结算时间查询。

1、注册订单侠开放平台账号

注册地址: https://www.dingdanxia.com/user/register/index.html  

2、获取接口秘钥apikey

登录个人中心 - 系统设置 - 接口管理 找到接秘钥apikey,apikey 接口秘钥是调用接口的唯一凭证,请妥善保管! 

3、授权淘宝联盟账号、填写推广位PID

登录个人中心 - 授权管理 - 淘宝授权, 授权自己的淘宝联盟账号,填写推广位pid (什么是推广位pid?

4、PHP代码调用示例

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的接口秘钥';
//淘宝联盟订单接口
$apiurl = "http://api.tbk.dingdanxia.com/tbk/order_details";


//开始调用
$result = curl_post($apiurl, array(
    //接口秘钥
        "apikey"     => $apikey,
	//开始时间
	"start_time" => "2019-05-12 12:00:00",
	//订单查询结束时间,订单开始时间至订单结束时间,中间时间段日常要求不超过3个小时,但如618、双11、年货节等大促期间预估时间段不可超过20分钟,超过会提示错误,调用时请务必注意时间段的选择,以保证亲能正常调用!
	"end_time"   => "2019-05-12 12:20:00"

));


//打印结果
print_r($result);

/**
 * post请求
 * @param string $url
 * @param array $params
 * @param int $timeout
 */
function curl_post($url, $params, $timeout = 3) {
    try {
        foreach ($params as $key => $val) {
            $post[] = "{$key}={$val}";
        }
        $post_data  = implode('&', $post);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        return curl_exec($ch);
    }
    catch (Exception $e) {
        return false;
    }
}

5、接口返回结果

{
    "code": 200,
    "msg": "请求成功【success】",
    "has_next": false,
    "has_pre": false,
    "page_no": 1,
    "page_size": 20,
    "position_index": "1557662727_wBOtXU2A4H2|1557662727_wBOtXU6MdJ2",
    "data": [
        {
            "adzone_id": 44105700493,
            "adzone_name": "渠道专享",
            "alimama_rate": "0.00",
            "alimama_share_fee": "0.00",
            "click_time": "2019-05-12 20:04:42",
            "flow_source": "--",
            "income_rate": "1.50",
            "item_category_name": "女装",
            "item_id": 588868343018,
            "item_img": "//img.alicdn.com/bao/uploaded/i2/2858216695/O1CN01GAGLr31zKMAiYAHql_!!2858216695.jpg",
            "item_link": "http://item.taobao.com/item.htm?id=588868343018",
            "item_num": 1,
            "item_price": "298.00",
            "item_title": "欧洲站2019春夏装新款欧货潮韩版时尚修身蓝色收腰网纱连衣裙女装",
            "order_type": "淘宝",
            "pub_id": 128849468,
            "pub_share_fee": "0.00",
            "pub_share_pre_fee": "0.00",
            "pub_share_rate": "100.00",
            "refund_tag": 0,
            "seller_nick": "不吃鱼的大脸猫",
            "seller_shop_title": "BOBO 华尔兹666号街",
            "site_id": 45454135,
            "site_name": "立打折优惠券网",
            "subsidy_fee": "0.00",
            "subsidy_rate": "0.00",
            "subsidy_type": "--",
            "terminal_type": "PC",
            "tk_create_time": "2019-05-12 20:05:27",
            "tk_order_role": 2,
            "tk_status": 13,
            "tk_total_rate": "1.50",
            "total_commission_fee": "0.00",
            "total_commission_rate": "1.50",
            "trade_id": "441443136205144387",
            "trade_parent_id": "441443136203144387"
        },
        {
            "adzone_id": 44105700493,
            "adzone_name": "渠道专享",
            "alimama_rate": "0.00",
            "alimama_share_fee": "0.00",
            "click_time": "2019-05-12 20:04:42",
            "flow_source": "--",
            "income_rate": "1.50",
            "item_category_name": "女装",
            "item_id": 588868343018,
            "item_img": "//img.alicdn.com/bao/uploaded/i3/2858216695/O1CN01G0Ed1g1zKMAkviBPV_!!2858216695.jpg",
            "item_link": "http://item.taobao.com/item.htm?id=588868343018",
            "item_num": 1,
            "item_price": "397.00",
            "item_title": "欧洲站2019春夏装新款欧货潮韩版时尚修身蓝色收腰网纱连衣裙女装",
            "order_type": "淘宝",
            "pub_id": 128849468,
            "pub_share_fee": "0.00",
            "pub_share_pre_fee": "0.00",
            "pub_share_rate": "100.00",
            "refund_tag": 0,
            "seller_nick": "不吃鱼的大脸猫",
            "seller_shop_title": "BOBO 华尔兹666号街",
            "site_id": 45454135,
            "site_name": "立打折优惠券网",
            "subsidy_fee": "0.00",
            "subsidy_rate": "0.00",
            "subsidy_type": "--",
            "terminal_type": "PC",
            "tk_create_time": "2019-05-12 20:05:27",
            "tk_order_role": 2,
            "tk_status": 13,
            "tk_total_rate": "1.50",
            "total_commission_fee": "0.00",
            "total_commission_rate": "1.50",
            "trade_id": "441443136204144387",
            "trade_parent_id": "441443136203144387"
        }
    ]
}

接口文档:https://www.dingdanxia.com/doc/60/8

在线测试:https://www.dingdanxia.com/apitest/60/8

实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值