1. Go to this page and download the library: Download kylin987/jd-sp-api-sdk 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/ */
kylin987 / jd-sp-api-sdk example snippets
com\jd\openapi\apiClient\Configuration;
use com\jd\openapi\apiClient\sp\product\v0\api\SkusApi;
use com\jd\openapi\apiClient\sp\product\v0\model\ListSkusRequest;
$config = Configuration::getDefaultConfiguration()
->setAppKey('YOUR_APP_KEY')
->setAppSecret('YOUR_APP_SECRET')
->setAccessToken('YOUR_ACCESS_TOKEN')
->setRequestIdentity('vender'); // 商品域接口需要业务身份头时使用
$skusApi = new SkusApi($config);
$request = new ListSkusRequest([
'page' => 1,
'page_size' => 10,
'scope_set' => ['skuName'],
]);
$response = $skusApi->listSkus($request);