京东联盟高级API - 京东联盟订单接口 京东客接口

查询京东联盟推广订单及佣金信息,会随着订单状态变化更新数据,支持按下单时间、完成时间或状态更新时间查询,通常可按更新时间每分钟或者每小时调用一次来获取订单的最新状态。

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

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

2、获取接口秘钥apikey

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


3、事先准备好京东联盟订单接口所需要的key参数,获取方式:打开并登录京东联盟(https://union.jd.com/index)=》我的推广=》我的工具=》我的API

4、PHP代码调用示例

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的接口秘钥';
//京东联盟订单接口
$apiurl = "http://api.tbk.dingdanxia.com/jd/order_details";
 
 
//开始调用
$result = curl_post($apiurl, array(
    //接口秘钥
        "apikey"     => $apikey,
	    "time"       =>2020070812,
        //代表查询2020年7月8日 12-13点之间的更新订单
        "pageNo"     =>1,
        "pageSize"   =>20,
        "type"       =>1,
        //订单时间查询类型(1:下单时间,2:完成时间,3:更新时间)
        "key"        =>京东联盟获取的key参数


 
));
 
 
//打印结果
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】",
	"data": [{
		"ext1": "",
		"finishTime": 1568110886000,
		"orderEmt": 2,
		"orderId": 102345177250,
		"orderTime": 1567750299000,
		"parentId": 0,
		"payMonth": 20191018,
		"plus": 0,
		"popId": 789438,
		"skuList": [{
			"actualCosPrice": 23,
			"actualFee": 2.28,
			"cid1": 1672,
			"cid2": 2599,
			"cid3": 13667,
			"commissionRate": 11,
			"cpActId": 0,
			"estimateCosPrice": 23,
			"estimateFee": 2.28,
			"ext1": "",
			"finalRate": 90,
			"frozenSkuNum": 0,
			"payMonth": 20191018,
			"pid": "",
			"popId": 789438,
			"positionId": 1152810895,
			"price": 23,
			"siteId": 0,
			"skuId": 27916941095,
			"skuName": "沉香倒流香佛系流云檀香香粒高山流水瀑布塔香卧室熏香艾草倒流香炉创意摆件沉香炉倒流 香薰 樱花 玻璃瓶装 送小荷花",
			"skuNum": 1,
			"skuReturnNum": 0,
			"subSideRate": 90,
			"subUnionId": "",
			"subsidyRate": 0,
			"traceType": 2,
			"unionAlias": "",
			"unionRole": 1,
			"unionTag": "00000100",
			"unionTrafficGroup": 4,
			"validCode": 17
		}],
		"unionId": 1000521676,
		"validCode": 17
	}]
}			  

接口文档:https://www.dingdanxia.com/doc/98/94

在线测试:https://www.dingdanxia.com/apitest/98/94

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

抵扣说明:

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

余额充值