PHP code example of ledc / hanlian

1. Go to this page and download the library: Download ledc/hanlian library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ledc / hanlian example snippets


use Ledc\HanLian\Config;
use Ledc\HanLian\MerchantApi;

$env_config = [
    'use_test' => true,
    'api_host' => Config::API_HOST_TEST, // 服务器地址
    'app_key' => Config::APP_KEY, // 测试环境或正式环境的appKey
    'app_secret' => Config::APP_SECRET, // 测试环境或正式环境的appSecret
    'warehouse_no' => Config::WARE_HOUSE_NO // 测试环境或正式环境的仓库编码
];
$config = new Config($env_config);
$api = new MerchantApi($config);

//新增销售单
$api->createOrder();
//销售单审核
$api->verifyOrder();
//分销商授权库存查询
$api->searchWarehouse();
//查询销售单
$api->queryOrder();
//查询报关状态单
$api->customsStatus();
//报关状态回执(适用于商家自行报关的客户)
$api->updateCustoms();