華磊物流接口,php語(yǔ)言開(kāi)發(fā)實(shí)例
電子商務(wù)
admin
發(fā)布時(shí)間:2025-12-30 09:14:57
瀏覽: 次
有些電商平臺(tái)需要對(duì)接物流接口,這樣可以在會(huì)員下單后自動(dòng)對(duì)接物流接口,給第三方物流自動(dòng)下單,會(huì)員也可以在訂單詳情中查看物流單號(hào),進(jìn)一步跟蹤物流信息。
公司最近對(duì)接一個(gè)華磊物流接口,用php語(yǔ)言開(kāi)發(fā),閑話不說(shuō),直接上代碼和截圖。
//配置信息:淼信荷蘭小包
$product_id = 4901; //產(chǎn)品id
$format = 'lbl_NL_XIN.frx'; //打印類型
$printType = 1; //打印類型
$customer_id = '18081';
$customer_userid = '14581';
$order_customerinvoicecode=$_POST['order_customerinvoicecode'];
$amount=sprintf("%.2f",$_POST['amount']);
$consignee_name=$_POST['consignee_name'];
$consignee_city=$_POST['consignee_city'];
$consignee_mobile=$_POST['consignee_mobile'];
$consignee_postcode=$_POST['consignee_postcode'];
$consignee_state=$_POST['consignee_state'];
$country=$_POST['country'];
$consignee_address=$_POST['consignee_address'];
$invoice_title=$_POST['invoice_title'];
$invoice_weight=$_POST['invoice_weight'];
$data = Array(
'buyerid' => '',
'consignee_address' => $consignee_address,
'consignee_city' => $consignee_city,
'consignee_mobile' => $consignee_mobile,
'consignee_name' => $consignee_name,
'trade_type' => 'ZYXT',
'consignee_postcode' => $consignee_postcode,
'consignee_state' => $consignee_state,
'consignee_telephone' => $consignee_mobile,
'country' => $country,
'customer_id' => $customer_id,
'customer_userid' => $customer_userid,
'orderInvoiceParam' => Array(
'0' => Array
(
'invoice_amount' => $amount,
'invoice_pcs' => 1,
'invoice_title' => $invoice_title,
'invoice_weight' => $invoice_weight,
'item_id' => '',
'item_transactionid' => '',
'sku' => $invoice_title,
'sku_code' => 'HL'.rand(100,999),
),
),
'order_customerinvoicecode' => $order_customerinvoicecode,
'product_id' => $product_id,
'weight' => $invoice_weight,
'product_imagepath' => '',
);
$this->WriteLog($this->FileName,"data:".urldecode(json_encode($data)));
$result = $this->curlRequest('http://146.56.219.238:8082/createOrderApi.htm', "param=" . json_encode($data));
$this->WriteLog($this->FileName,"result:".urldecode($result['result']));
截圖如下:

如果需要開(kāi)發(fā)相關(guān)的物流接口,請(qǐng)聯(lián)系我們:QQ 804752009
公司最近對(duì)接一個(gè)華磊物流接口,用php語(yǔ)言開(kāi)發(fā),閑話不說(shuō),直接上代碼和截圖。
//配置信息:淼信荷蘭小包
$product_id = 4901; //產(chǎn)品id
$format = 'lbl_NL_XIN.frx'; //打印類型
$printType = 1; //打印類型
$customer_id = '18081';
$customer_userid = '14581';
$order_customerinvoicecode=$_POST['order_customerinvoicecode'];
$amount=sprintf("%.2f",$_POST['amount']);
$consignee_name=$_POST['consignee_name'];
$consignee_city=$_POST['consignee_city'];
$consignee_mobile=$_POST['consignee_mobile'];
$consignee_postcode=$_POST['consignee_postcode'];
$consignee_state=$_POST['consignee_state'];
$country=$_POST['country'];
$consignee_address=$_POST['consignee_address'];
$invoice_title=$_POST['invoice_title'];
$invoice_weight=$_POST['invoice_weight'];
$data = Array(
'buyerid' => '',
'consignee_address' => $consignee_address,
'consignee_city' => $consignee_city,
'consignee_mobile' => $consignee_mobile,
'consignee_name' => $consignee_name,
'trade_type' => 'ZYXT',
'consignee_postcode' => $consignee_postcode,
'consignee_state' => $consignee_state,
'consignee_telephone' => $consignee_mobile,
'country' => $country,
'customer_id' => $customer_id,
'customer_userid' => $customer_userid,
'orderInvoiceParam' => Array(
'0' => Array
(
'invoice_amount' => $amount,
'invoice_pcs' => 1,
'invoice_title' => $invoice_title,
'invoice_weight' => $invoice_weight,
'item_id' => '',
'item_transactionid' => '',
'sku' => $invoice_title,
'sku_code' => 'HL'.rand(100,999),
),
),
'order_customerinvoicecode' => $order_customerinvoicecode,
'product_id' => $product_id,
'weight' => $invoice_weight,
'product_imagepath' => '',
);
$this->WriteLog($this->FileName,"data:".urldecode(json_encode($data)));
$result = $this->curlRequest('http://146.56.219.238:8082/createOrderApi.htm', "param=" . json_encode($data));
$this->WriteLog($this->FileName,"result:".urldecode($result['result']));
截圖如下:

如果需要開(kāi)發(fā)相關(guān)的物流接口,請(qǐng)聯(lián)系我們:QQ 804752009
相關(guān)推薦
- Opencart 3.x版本支付插件開(kāi)發(fā)PHP開(kāi)發(fā)實(shí)例
- php語(yǔ)言的拉卡拉支付接口的開(kāi)發(fā)實(shí)例
- wordpress支付插件開(kāi)發(fā),php支付插件開(kāi)發(fā)實(shí)例
- Telegram機(jī)器人開(kāi)發(fā)實(shí)例 php語(yǔ)言
- 如果利用京東聯(lián)盟API把京東的商品展示在自己的網(wǎng)站(PH
- 谷歌Google驗(yàn)證碼的開(kāi)發(fā)實(shí)例,PHP版本源碼
- 騰訊云域名解析API開(kāi)發(fā)的若干經(jīng)驗(yàn)(PHP版本開(kāi)發(fā)實(shí)例)
- 工商銀行在線支付接口,php語(yǔ)言,在ecshop,shopex等的wap
- 銀聯(lián)權(quán)益分銷平臺(tái)行業(yè)應(yīng)用接口開(kāi)發(fā)實(shí)例(php語(yǔ)言)
- 中國(guó)銀聯(lián)手機(jī)移動(dòng)支付接口(最新版),php語(yǔ)言,在帝國(guó),dede

售前咨詢專員