收藏
回答

expect_time 传时间戳,下单成功,JT和JD单据的预约时间都为空

https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/express/express-by-business/addOrder.htmlhttps://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/express/express-by-business/addOrder.html

格式我反复验证了没有错误。

{
	"add_source": 0,
	"wx_appid": "wxffa*********6a1",
	"order_id": "9d682*********565f4",
	"openid": "ogHAb*********Xp5q8U",
	"delivery_id": "TEST",
	"biz_id": "test_biz_id",
	"custom_remark": "",
	"tagid": 2,
	"sender": {
		"name": "七七",
		"tel": "",
		"mobile": "177*********78",
		"company": "",
		"post_code": "",
		"country": "",
		"province": "安徽省",
		"city": "芜湖市",
		"area": "镜湖区",
		"address": "三山里"
	},
	"receiver": {
		"name": "*********",
		"tel": "*********",
		"mobile": "",
		"company": "*********",
		"post_code": "",
		"country": "",
		"province": "*********",
		"city": "芜湖市",
		"area": "鸠江区",
		"address": "*********"
	},
	"cargo": {
		"count": 1,
		"weight": 3,
		"space_x": 30,
		"space_y": 28,
		"space_z": 12,
		"detail_list": [{
			"name": "妖怪们快出来",
			"count": 1
		}, {
			"name": "田鼠阿佛",
			"count": 1
		}, {
			"name": "睡觉去,小怪物!",
			"count": 1
		}, {
			"name": "其实我是一条鱼",
			"count": 1
		}, {
			"name": "捣蛋猫米乐",
			"count": 1
		}, {
			"name": "有些时候,我特别喜欢爸爸",
			"count": 1
		}, {
			"name": "拼图王国",
			"count": 1
		}, {
			"name": "睡得好香",
			"count": 1
		}, {
			"name": "奇妙迷宫",
			"count": 1
		}, {
			"name": "测试连起来",
			"count": 1
		}]
	},
	"shop": {
		"wxa_path": "pagesB\/orde*********5218b4165f4-29",
		"img_url": "",
		"goods_name": "",
		"goods_count": "",
		"detail_list": [{
			"goods_name": "妖怪们快出来",
			"goods_img_url": "ht*********medium.png",
			"goods_desc": ""
		}, {
			"goods_name": "田鼠阿佛",
			"goods_img_url": "https*********f83.png",
			"goods_desc": ""
		}, {
			"goods_name": "睡觉去,小怪物!",
			"goods_img_url": "https:\/\/d*********_medium.png",
			"goods_desc": ""
		}, {
			"goods_name": "其实我是一条鱼",
			"goods_img_url": "https*********94573f43.png",
			"goods_desc": ""
		}, {
			"goods_name": "捣蛋猫米乐",
			"goods_img_url": "https:\/*********0dd1ca.png",
			"goods_desc": ""
		}, {
			"goods_name": "有些时候,我特别喜欢爸爸",
			"goods_img_url": "https:\/*********fbbea9.jpg",
			"goods_desc": ""
		}, {
			"goods_name": "拼图王国",
			"goods_img_url": "https:\/\/d*********edium.png",
			"goods_desc": ""
		}, {
			"goods_name": "睡得好香",
			"goods_img_url": "https:\/\/d.m*********77_medium.png",
			"goods_desc": ""
		}, {
			"goods_name": "奇妙迷宫",
			"goods_img_url": "https:\/\/d*********dium.png",
			"goods_desc": ""
		}, {
			"goods_name": "测试连起来",
			"goods_img_url": "https:\/*********60.png",
			"goods_desc": ""
		}]
	},
	"insured": {
		"use_insured": 0,
		"insured_value": 0
	},
	"service": {
		"service_type": 1,
		"service_name": "test_service_name"
	},
	"expect_time": 1681365600,
	"take_mode": 1
}

附上php网络请求的方法
/**
 * 发送post请求
 *
 * @param $url
 * @param array $params
 * @param array $headers
 * @return mixed
 */
function request_post($url , $params = array())
{
    $data_string = json_encode($params,JSON_UNESCAPED_UNICODE);
    // $data_string = $data;
    $curl_con = curl_init();
    curl_setopt($ccurl_con, CURLOPT_URL,$url);
    curl_setopt($curl_con, CURLOPT_HEADER, false);
    curl_setopt($curl_con, CURLOPT_POST, true);
    curl_setopt($curl_con, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($curl_con, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($curl_con, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Content-Length: ' . strlen($data_string))
    );
    curl_setopt($curl_con, CURLOPT_POSTFIELDS, $data_string);
    $res = curl_exec($curl_con);
    $status = curl_getinfo($curl_con);
    curl_close($curl_con);

    if (isset($status['http_code']) && $status['http_code'] == 200) {
        return $res;
    } else {
        return false;
    }
}
最后一次编辑于  2023-04-10
回答关注问题邀请回答
收藏

1 个回答

  • 阿当
    阿当
    01-05

    我也碰到这个问题了,京东快递,传的expect_time是无效的

    01-05
    有用
    回复
登录 后发表内容