企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
#### 1\. 下载SDK * [PHP-SDK下载](https://resource.duobaoyu.com.cn/supply/dby-php-sdk-2023-8-9.zip "PHP-SDK下载") #### [](https://duobaoyu.com.cn/documentcenter?onlyFlag=59cc154d45fce1f012a65584d1f3168a#2-%E4%BD%BF%E7%94%A8sdk%E5%8F%91%E8%B5%B7%E8%AF%B7%E6%B1%82)2\. 使用SDK发起请求 * 以商品下单为例 ~~~php <?php require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/dbyAutoload.php'); require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/sdk/client/DbyClient.php'); require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/sdk/openapi/scm/order/ScmOrderSubmitRequest.php'); $dbyClient = new DbyClient("http://xxxxx/open/api","your appKey", "your appSecret"); $req = new ScmOrderSubmitRequest(); $req->setTradeNo('1656600661919111120');//19位业务交易单号 $req->setConsigneeName("张三"); $req->setConsigneeMobile("15972335850"); $req->setConsigneeProvinceCode("42"); $req->setConsigneeCityCode("4201"); $req->setConsigneeCountyCode("420106"); $req->setConsigneeTownCode("420106010"); $req->setConsigneeAddress("安腾国际"); $req->setOrderRemark("测试下单"); //商品 $skuInfo1 = new ScmOrderSubmitRequest_SkuInfos(); $skuInfo1->setSkuCode('50146447546'); $skuInfo1->setSkuNum(1); $skuInfo2 = new ScmOrderSubmitRequest_SkuInfos(); $skuInfo2->setSkuCode('50146447547'); $skuInfo2->setSkuNum(1); $skuInfos = array($skuInfo1, $skuInfo2); $req->setSkuInfos($skuInfos); $res = $dbyClient->execute($req); ~~~