├── .github └── workflows │ ├── php-cs-fixer.yml │ └── run-test.yml ├── .php-cs-fixer.cache ├── .php_cs.dist.php ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── config └── config.php ├── phpunit.xml └── src ├── Api ├── AfterSale.php ├── Alliance.php ├── AntiSpam.php ├── BaseRequest.php ├── Bats.php ├── Brand.php ├── BuyIn.php ├── Coupons.php ├── CrossBorder.php ├── DutyFree.php ├── FreightTemplate.php ├── Iop.php ├── Logistics.php ├── Material.php ├── Member.php ├── OpenCloud.php ├── Order.php ├── OrderCode.php ├── Product.php ├── Recycle.php ├── Security.php ├── Shop.php ├── Sms.php ├── Spu.php ├── Storage.php ├── SupplyChain.php ├── Token.php ├── Topup.php ├── WareHouse.php └── Yunc.php ├── DouDian.php ├── DouDianFacade.php └── DouDianServiceProvider.php /.github/workflows/php-cs-fixer.yml: -------------------------------------------------------------------------------- 1 | name: Check & fix styling 2 | 3 | on : 4 | push : 5 | branches : [ main ] 6 | 7 | jobs: 8 | php-cs-fixer: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v2 14 | with: 15 | ref: ${{ github.head_ref }} 16 | 17 | - name: Run PHP CS Fixer 18 | uses: docker://oskarstark/php-cs-fixer-ga 19 | with: 20 | args: --config=.php_cs.dist.php --allow-risky=yes 21 | 22 | - name: Commit changes 23 | uses: stefanzweifel/git-auto-commit-action@v4 24 | with: 25 | commit_message: Fix styling -------------------------------------------------------------------------------- /.github/workflows/run-test.yml: -------------------------------------------------------------------------------- 1 | name : run-tests 2 | 3 | on : 4 | push : 5 | branches : [ main ] 6 | tags-ignore : 7 | - '*.*' 8 | paths-ignore : 9 | - README.md 10 | - LICENSE 11 | - CHANGELOG.md 12 | pull_request : 13 | branches : [ main ] 14 | paths-ignore : 15 | - README.md 16 | - LICENSE 17 | - CHANGELOG.md 18 | 19 | jobs : 20 | test : 21 | runs-on : ${{ matrix.os }} 22 | strategy : 23 | fail-fast : true 24 | matrix : 25 | os : [ ubuntu-latest ] 26 | php : [ 7.2 ] 27 | stability : [ prefer-stable ] 28 | 29 | name : P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} 30 | 31 | steps : 32 | - name : Checkout code 33 | uses : actions/checkout@v2 34 | 35 | - name : Setup PHP 36 | uses : shivammathur/setup-php@v2 37 | with : 38 | php-version : ${{ matrix.php }} 39 | extensions : dom, curl, libxml, mbstring, zip, pcntl, openssl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo 40 | coverage : none 41 | 42 | - name : Setup problem matchers 43 | run : | 44 | echo "::add-matcher::${{ runner.tool_cache }}/php.json" 45 | echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" 46 | 47 | - name : Cache Composer packages 48 | id : composer-cache 49 | uses : actions/cache@v2 50 | with : 51 | path : vendor 52 | key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} 53 | restore-keys : | 54 | ${{ runner.os }}-php- 55 | 56 | - name : Install dependencies 57 | run : | 58 | composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --dev 59 | 60 | - name : Execute tests 61 | run : vendor/bin/phpunit 62 | -------------------------------------------------------------------------------- /.php-cs-fixer.cache: -------------------------------------------------------------------------------- 1 | {"php":"8.1.3","version":"3.7.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/DouDianServiceProvider.php":2138042692,"src\/DouDianFacade.php":299803777,"src\/Api\/Brand.php":1053700468,"src\/Api\/BuyIn.php":808887064,"src\/Api\/Iop.php":809136214,"src\/Api\/BaseRequest.php":2706786837,"src\/Api\/OrderCode.php":1009326020,"src\/Api\/Shop.php":2770670322,"src\/Api\/Member.php":833749056,"src\/Api\/OpenCloud.php":1218677796,"src\/Api\/Sms.php":3479366602,"src\/Api\/WareHouse.php":1908586438,"src\/Api\/Security.php":2264263871,"src\/Api\/Order.php":424369698,"src\/Api\/Bats.php":1838554985,"src\/Api\/DutyFree.php":1806956255,"src\/Api\/Alliance.php":1010034920,"src\/Api\/Recycle.php":3839630464,"src\/Api\/Yunc.php":1655296279,"src\/Api\/Coupons.php":3325886391,"src\/Api\/Logistics.php":495092292,"src\/Api\/Spu.php":774640965,"src\/Api\/Material.php":2443228685,"src\/Api\/CrossBorder.php":2547903492,"src\/Api\/AntiSpam.php":3367862619,"src\/Api\/SupplyChain.php":237319272,"src\/Api\/FreightTemplate.php":2623295641,"src\/Api\/AfterSale.php":2428811751,"src\/Api\/Token.php":746770428,"src\/Api\/Topup.php":3213849202,"src\/Api\/Product.php":2345005487,"src\/Api\/Storage.php":1355493865,"src\/DouDian.php":2767338295,"tests\/DouDianTest.php":541102744,"tests\/TestCase.php":4001590423}} -------------------------------------------------------------------------------- /.php_cs.dist.php: -------------------------------------------------------------------------------- 1 | in([ 5 | __DIR__ . '/src', 6 | __DIR__ . '/tests', 7 | ]) 8 | ->name('*.php') 9 | ->notName('*.blade.php') 10 | ->ignoreDotFiles(true) 11 | ->ignoreVCS(true); 12 | 13 | return (new PhpCsFixer\Config()) 14 | ->setRules([ 15 | '@PSR12' => true, 16 | 'array_syntax' => ['syntax' => 'short'], 17 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], 18 | 'no_unused_imports' => true, 19 | 'not_operator_with_successor_space' => true, 20 | 'trailing_comma_in_multiline' => true, 21 | 'phpdoc_scalar' => true, 22 | 'unary_operator_spaces' => true, 23 | 'binary_operator_spaces' => true, 24 | 'blank_line_before_statement' => [ 25 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 26 | ], 27 | 'phpdoc_single_line_var_spacing' => true, 28 | 'phpdoc_var_without_name' => true, 29 | 'class_attributes_separation' => [ 30 | 'elements' => [ 31 | 'method' => 'one', 32 | ], 33 | ], 34 | 'method_argument_space' => [ 35 | 'on_multiline' => 'ensure_fully_multiline', 36 | 'keep_multiple_spaces_after_comma' => true, 37 | ], 38 | 'single_trait_insert_per_statement' => true, 39 | ]) 40 | ->setFinder($finder); 41 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.0 - 2021-02-09 4 | 5 | - 第一版发布 6 | - 已对接所有API接口 7 | 8 | ## 1.0.1 - 2021-04-13 9 | - 新增两个订单相关的接口 10 | 11 | ## 1.0.2 - 2021-04-30 12 | - 修复一处拼写错误 13 | - 新增电子免单相关接口 14 | 15 | ## 1.0.3 - 2021-05-28 16 | - 新增`BIC质检API`、`BTAS质检API`、`仓库作业API` 17 | - 同步更新官方物流和订单相关接口 18 | 19 | ## 1.0.4 - 2021-06-07 20 | - 新增`设置sku发货时效`接口 21 | 22 | ## 1.0.5 - 2021-06-29 23 | - 增加`小流量测试`接口 24 | - 增加`商户登陆风险检查`接口 25 | - 同步官方文档 26 | 27 | ## 1.0.6 - 2021-07-07 28 | - 增加SPU相关接口 29 | - 增加`会员等级更新`接口 30 | - 同步官方文档 31 | 32 | ## 1.0.7 - 2021-07-20 33 | - 增加`跨境API`、`代发API`、`卡券API` 34 | - 同步官方文档其他接口 35 | 36 | ## 1.0.8 - 2021-08-11 37 | - 增加`仓库作业API`、`精选联盟API` 38 | - 同步官方文档其他接口 39 | - 修复`代发API`类名错误的BUG 40 | 41 | ## 1.0.9 - 2021-09-01 42 | - 同步官方文档其他接口 43 | - 集成Github Action 44 | 45 | ## 1.1.0 - 2021-09-08 46 | - 同步官方文档其他接口 47 | - 优化Github Action 48 | 49 | ## 1.1.1 - 2021-09-29 50 | - 同步官方文档其他接口 51 | 52 | ## 1.1.2 - 2021-10-19 53 | - 同步官方文档其他接口 54 | - 增加多店铺支持 55 | - 修复无法多次更新access_token的问题 56 | 57 | ## 1.1.3 - 2021-10-27 58 | - 同步官方文档其他接口 59 | 60 | ## 1.1.4 - 2021-12-02 61 | - 同步官方文档其他接口 62 | - 修复access_token的存取,感谢 [@shubo83](https://github.com/shubo83) 提交PR. 63 | 64 | ## 1.1.5 - 2022-01-22 65 | - 同步官方文档其他接口 66 | - 新增短信相关接口 67 | 68 | ## 1.1.6 - 2022-04-22 69 | - 同步官方文档其他接口 -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 11 | extremely unfair for them to suffer abuse or anger for their hard work. 12 | 13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the 14 | world that developers are civilized and selfless people. 15 | 16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient 17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 18 | 19 | ## Viability 20 | 21 | When requesting or submitting new features, first consider whether it might be useful to others. Open 22 | source projects are used by many developers, who may have entirely different needs to your own. Think about 23 | whether or not your feature is likely to be used by other users of the project. 24 | 25 | ## Procedure 26 | 27 | Before filing an issue: 28 | 29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 30 | - Check to make sure your feature suggestion isn't already present within the project. 31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 32 | - Check the pull requests tab to ensure that the feature isn't already in progress. 33 | 34 | Before submitting a pull request: 35 | 36 | - Check the codebase to ensure that your feature doesn't already exist. 37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 38 | 39 | ## Requirements 40 | 41 | If the project maintainer has any additional requirements, you will find them listed here. 42 | 43 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). 44 | 45 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 46 | 47 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 48 | 49 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 50 | 51 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 52 | 53 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 54 | 55 | **Happy coding**! 56 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Abbotton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 抖音小店SDK for Laravel 2 | 3 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/abbotton/laravel-doudian.svg?style=flat-square)](https://packagist.org/packages/abbotton/laravel-doudian) 4 | [![Build Status](https://img.shields.io/travis/abbotton/laravel-doudian/master.svg?style=flat-square)](https://travis-ci.org/abbotton/laravel-doudian) 5 | [![Quality Score](https://img.shields.io/scrutinizer/g/abbotton/laravel-doudian.svg?style=flat-square)](https://scrutinizer-ci.com/g/abbotton/laravel-doudian) 6 | [![Total Downloads](https://img.shields.io/packagist/dt/abbotton/laravel-doudian.svg?style=flat-square)](https://packagist.org/packages/abbotton/laravel-doudian) 7 | 8 | ## 安装 9 | 10 | 1、通过`composer`安装扩展包。 11 | ```bash 12 | composer require abbotton/laravel-doudian 13 | ``` 14 | 2、发布配置文件。 15 | ```bash 16 | php artisan vendor:publish --provider="Abbotton\DouDian\DouDianServiceProvider" 17 | ``` 18 | 3、修改`config/doudian.php`中相关配置。 19 | ## 使用 20 | 21 | ``` php 22 | $response = app('doudian')->shop->getShopCategory(['cid' => 0]); 23 | dd($response); 24 | ``` 25 | 26 | 支持多个授权店铺之间切换,默认不传参为最早授权的店铺 27 | 28 | ``` php 29 | app('doudian')->setShopId($shopId)->order->orderDetail(["shop_order_id"=>'5557097346351159555']); 30 | ``` 31 | 32 | ### 测试 33 | 34 | ``` bash 35 | composer test 36 | ``` 37 | 38 | ### 更新记录 39 | 40 | 查看[CHANGELOG](CHANGELOG.md)获取更详细的更新说明. 41 | 42 | ## License 43 | 44 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 45 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "abbotton/laravel-doudian", 3 | "description": "抖音小店开放平台SDK", 4 | "keywords": [ 5 | "abbotton", 6 | "doudian", 7 | "抖音小店", 8 | "抖店开放平台", 9 | "今日特卖", 10 | "抖店", 11 | "jinritemai" 12 | ], 13 | "homepage": "https://github.com/abbotton/laravel-doudian", 14 | "license": "MIT", 15 | "type": "library", 16 | "authors": [ 17 | { 18 | "name": "Abbotton", 19 | "email": "uctoo@foxmail.com", 20 | "role": "Developer" 21 | } 22 | ], 23 | "require": { 24 | "php": ">=7.2", 25 | "guzzlehttp/guzzle": ">=6.5", 26 | "illuminate/support": ">=6.0" 27 | }, 28 | "require-dev": { 29 | "orchestra/testbench": ">=4.0", 30 | "phpunit/phpunit": "^8.0" 31 | }, 32 | "autoload": { 33 | "psr-4": { 34 | "Abbotton\\DouDian\\": "src" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "psr-4": { 39 | "Abbotton\\DouDian\\Tests\\": "tests" 40 | } 41 | }, 42 | "scripts": { 43 | "test": "vendor/bin/phpunit" 44 | }, 45 | "config": { 46 | "sort-packages": true 47 | }, 48 | "extra": { 49 | "laravel": { 50 | "providers": [ 51 | "Abbotton\\DouDian\\DouDianServiceProvider" 52 | ], 53 | "aliases": { 54 | "DouDian": "Abbotton\\DouDian\\DouDianFacade" 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | env('DOUDIAN_APP_KEY'), 5 | 'app_secret' => env('DOUDIAN_APP_SECRET'), 6 | ]; 7 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | tests 19 | 20 | 21 | 22 | 23 | src/ 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/Api/AfterSale.php: -------------------------------------------------------------------------------- 1 | httpPost('afterSale/addOrderRemark', $params); 23 | } 24 | 25 | /** 26 | * 商家处理换货申请. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function buyerExchange(array $params): array 36 | { 37 | return $this->httpPost('afterSale/buyerExchange', $params); 38 | } 39 | 40 | /** 41 | * 商家确认是否收到换货. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function buyerExchangeConfirm(array $params): array 51 | { 52 | return $this->httpPost('afterSale/buyerExchangeConfirm', $params); 53 | } 54 | 55 | /** 56 | * 卖家提交举证信息. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function submitEvidence(array $params = []): array 66 | { 67 | return $this->httpPost('afterSale/submitEvidence', $params); 68 | } 69 | 70 | /** 71 | * 延长售后收货时限. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function timeExtend(array $params): array 81 | { 82 | return $this->httpPost('afterSale/timeExtend', $params); 83 | } 84 | 85 | /** 86 | * 售后单列表查询(推荐使用). 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function refundListSearch(array $params = []): array 96 | { 97 | return $this->httpPost('trade/refundListSearch', $params); 98 | } 99 | 100 | /** 101 | * 提供给商家获取售后单详情信息. 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function detail(array $params = []): array 111 | { 112 | return $this->httpPost('afterSale/Detail', $params); 113 | } 114 | 115 | /** 116 | * 打开售后通道,使用户可以发起超级售后. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function openAfterSaleChannel(array $params = []): array 126 | { 127 | return $this->httpPost('afterSale/OpenAfterSaleChannel', $params); 128 | } 129 | 130 | /** 131 | * 售后列表接口. 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function List(array $params = []): array 141 | { 142 | return $this->httpPost('afterSale/List', $params); 143 | } 144 | 145 | /** 146 | * 商家经过质检确认用户退货入仓无误后,售后小助手自动同意退款. 147 | * 148 | * @param array $params 149 | * 150 | * @throws RequestException 151 | * @throws InvalidArgumentException 152 | * 153 | * @return array 154 | */ 155 | public function returnGoodsToWareHouseSuccess(array $params = []): array 156 | { 157 | return $this->httpPost('afterSale/returnGoodsToWareHouseSuccess', $params); 158 | } 159 | 160 | /** 161 | * 商家在未发货仅退款途中取消发货状态,小助手自动同意退款. 162 | * 163 | * @param array $params 164 | * 165 | * @throws RequestException 166 | * @throws InvalidArgumentException 167 | * 168 | * @return array 169 | */ 170 | public function cancelSendGoodsSuccess(array $params = []): array 171 | { 172 | return $this->httpPost('afterSale/CancelSendGoodsSuccess', $params); 173 | } 174 | 175 | /** 176 | * 申请物流拦截. 177 | * 178 | * @param array $params 179 | * 180 | * @throws RequestException 181 | * @throws InvalidArgumentException 182 | * 183 | * @return array 184 | */ 185 | public function applyLogisticsIntercept(array $params = []): array 186 | { 187 | return $this->httpPost('afterSale/applyLogisticsIntercept', $params); 188 | } 189 | 190 | /** 191 | * 售后审核处理原因列表查询接口. 192 | * 193 | * @param array $params 194 | * 195 | * @throws RequestException 196 | * @throws InvalidArgumentException 197 | * 198 | * @return array 199 | */ 200 | public function rejectReasonCodeList(array $params = []): array 201 | { 202 | return $this->httpPost('afterSale/rejectReasonCodeList', $params); 203 | } 204 | 205 | /** 206 | * 售后审核接口聚合版. 207 | * 208 | * @param array $params 209 | * 210 | * @return array 211 | * @throws InvalidArgumentException 212 | * 213 | * @throws RequestException 214 | */ 215 | public function operate(array $params = []): array 216 | { 217 | return $this->httpPost('afterSale/operate', $params); 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /src/Api/Alliance.php: -------------------------------------------------------------------------------- 1 | httpPost('alliance/getOrderList', $params); 23 | } 24 | 25 | /** 26 | * 检索精选联盟商品. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function materialsProductsSearch(array $params): array 36 | { 37 | return $this->httpPost('alliance/materialsProductsSearch', $params); 38 | } 39 | 40 | /** 41 | * 团长活动创建/编辑接口. 42 | * 43 | * @param array $params 44 | * @return array 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | */ 48 | public function colonelActivityCreateOrUpdate(array $params): array 49 | { 50 | return $this->httpPost('alliance/colonelActivityCreateOrUpdate', $params); 51 | } 52 | 53 | /** 54 | * 创建活动时候可选择的类目接口. 55 | * 56 | * @param array $params 57 | * @return array 58 | * @throws InvalidArgumentException 59 | * @throws RequestException 60 | */ 61 | public function activityProductCategoryList(array $params): array 62 | { 63 | return $this->httpPost('alliance/activityProductCategoryList', $params); 64 | } 65 | 66 | /** 67 | * 团长活动查询接口. 68 | * 69 | * @param array $params 70 | * @return array 71 | * @throws InvalidArgumentException 72 | * @throws RequestException 73 | */ 74 | public function instituteColonelActivityList(array $params): array 75 | { 76 | return $this->httpPost('alliance/instituteColonelActivityList', $params); 77 | } 78 | 79 | /** 80 | * 专属团长活动删除接口(下线+删除). 81 | * 82 | * @param array $params 83 | * @return array 84 | * @throws InvalidArgumentException 85 | * @throws RequestException 86 | */ 87 | public function instituteColonelActivityOperate(array $params): array 88 | { 89 | return $this->httpPost('alliance/instituteColonelActivityOperate', $params); 90 | } 91 | 92 | /** 93 | * 活动商品查询接口. 94 | * 95 | * @param array $params 96 | * @return array 97 | * @throws InvalidArgumentException 98 | * @throws RequestException 99 | */ 100 | public function colonelActivityProduct(array $params): array 101 | { 102 | return $this->httpPost('alliance/colonelActivityProduct', $params); 103 | } 104 | 105 | /** 106 | * 专属团长活动商品审核接口. 107 | * 108 | * @param array $params 109 | * @return array 110 | * @throws InvalidArgumentException 111 | * @throws RequestException 112 | */ 113 | public function colonelActivityProductAudit(array $params): array 114 | { 115 | return $this->httpPost('alliance/colonelActivityProductAudit', $params); 116 | } 117 | 118 | /** 119 | * 专属团长活动商品延时接口. 120 | * 121 | * @param array $params 122 | * @return array 123 | * @throws InvalidArgumentException 124 | * @throws RequestException 125 | */ 126 | public function colonelActivityProductExtension(array $params): array 127 | { 128 | return $this->httpPost('alliance/colonelActivityProductExtension', $params); 129 | } 130 | 131 | /** 132 | * 类目查询. 133 | * 134 | * @param array $params 135 | * @return array 136 | * @throws InvalidArgumentException 137 | * @throws RequestException 138 | */ 139 | public function materialsProductCategory(array $params): array 140 | { 141 | return $this->httpPost('alliance/materialsProductCategory', $params); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/Api/AntiSpam.php: -------------------------------------------------------------------------------- 1 | httpPost('antispam/userLogin', $params); 23 | } 24 | 25 | /** 26 | * 用户在ISV查看订单、下载订单时, 上报事件到风控系统. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function orderQuery(array $params): array 36 | { 37 | return $this->httpPost('antispam/orderQuery', $params); 38 | } 39 | 40 | /** 41 | * 支持使用在ISV系统商户发送(外部系统或模块,如快递平台)场景. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function orderSend(array $params): array 51 | { 52 | return $this->httpPost('antispam/orderSend', $params); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Api/BaseRequest.php: -------------------------------------------------------------------------------- 1 | config = $config; 32 | $this->shop_id = $shop_id; 33 | if (! isset($config['app_key']) || ! $config['app_key']) { 34 | throw new \InvalidArgumentException('配置有误, 请填写app_key'); 35 | } 36 | 37 | if (! isset($config['app_secret']) || ! $config['app_secret']) { 38 | throw new \InvalidArgumentException('配置有误, 请填写app_secret'); 39 | } 40 | $this->client = new Client(); 41 | } 42 | 43 | /** 44 | * 发起GET请求 45 | * 46 | * @param string $url 47 | * @param array $params 48 | * @param bool $needSign 49 | * 50 | * @throws RequestException 51 | * @throws InvalidArgumentException 52 | * 53 | * @return array 54 | */ 55 | public function httpGet(string $url, array $params = [], bool $needSign = true): array 56 | { 57 | return $this->request('get', $url, $params, $needSign); 58 | } 59 | 60 | /** 61 | * 发起HTTP请求 62 | * 63 | * @param string $method 64 | * @param string $url 65 | * @param array $params 66 | * @param bool $needSign 67 | * 68 | * @throws RequestException 69 | * @throws InvalidArgumentException 70 | * 71 | * @return array 72 | */ 73 | private function request(string $method, string $url, array $params = [], bool $needSign = true): array 74 | { 75 | $options = []; 76 | if ($needSign) { 77 | $params = $this->generateParams($url, $params); 78 | } 79 | $options['headers'] = [ 80 | 'Content-Type' => 'application/x-www-form-urlencoded', 81 | ]; 82 | $key = $method == 'get' ? 'query' : 'form_params'; 83 | $options[$key] = $params; 84 | 85 | $response = $this->client->request($method, $this->baseUrl.$url, $options); 86 | 87 | return json_decode($response->getBody()->getContents(), true); 88 | } 89 | 90 | /** 91 | * 组合请求参数. 92 | * 93 | * @param string $url 94 | * @param array $params 95 | * 96 | * @throws RequestException 97 | * @throws InvalidArgumentException 98 | * 99 | * @return array 100 | */ 101 | protected function generateParams(string $url, array $params): array 102 | { 103 | $url = str_replace('/', '.', $url); 104 | 105 | $accessToken = ""; 106 | if (! in_array($url, ["token.create","token.refresh"])) { 107 | $accessToken = $this->getAccessToken(); 108 | }; 109 | 110 | $public = [ 111 | 'app_key' => $this->config['app_key'], 112 | 'timestamp' => date('Y-m-d H:i:s'), 113 | 'v' => '2', 114 | 'method' => $url, 115 | 'access_token' => $accessToken, 116 | ]; 117 | 118 | ksort($params); 119 | $param_json = json_encode((object) $params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 120 | 121 | $str = 'app_key'.$public['app_key'].'method'.$url.'param_json'.$param_json.'timestamp'.$public['timestamp'].'v'.$public['v']; 122 | $md5_str = $this->config['app_secret'].$str.$this->config['app_secret']; 123 | $sign = md5($md5_str); 124 | 125 | return array_merge( 126 | $public, 127 | [ 128 | 'param_json' => $param_json, 129 | 'sign' => $sign, 130 | ] 131 | ); 132 | } 133 | 134 | /** 135 | * 获取TOKEN. 136 | * 137 | * @throws RequestException 138 | * @throws InvalidArgumentException 139 | * 140 | * @return mixed|string 141 | */ 142 | private function getAccessToken(): string 143 | { 144 | $oauthToken = Cache::get(self::OAUTH_CACHE_KEY.$this->shop_id, []); 145 | if (! $oauthToken || ! $oauthToken['refresh_token']) { 146 | return $this->requestAccessToken(); 147 | } 148 | 149 | if ($oauthToken['access_token_expired_at'] - time() <= 100 && $oauthToken['refresh_token_expired_at'] > time()) { 150 | return $this->updateAccessToken($oauthToken['refresh_token']); 151 | } 152 | 153 | return $oauthToken['access_token']; 154 | } 155 | 156 | /** 157 | * 请求TOKEN. 158 | * 159 | * @throws RequestException 160 | * @throws InvalidArgumentException 161 | * 162 | * @return string 163 | */ 164 | private function requestAccessToken(): string 165 | { 166 | $param = [ 167 | 'app_id' => $this->config['app_key'], 168 | 'app_secret' => $this->config['app_secret'], 169 | 'grant_type' => 'authorization_self', 170 | ]; 171 | 172 | if ($this->shop_id) { 173 | $param['shop_id'] = $this->shop_id; 174 | } 175 | 176 | $response = $this->httpGet('token/create', $param, true); 177 | if (! $response || $response['code'] > 10000) { 178 | trigger_error("token/create 接口异常[{$response['code']}]"); 179 | } 180 | $response['data']['access_token_expired_at'] = time() + $response['data']['expires_in']; 181 | $response['data']['refresh_token_expired_at'] = strtotime('+14 day'); 182 | 183 | Cache::set(self::OAUTH_CACHE_KEY.$this->shop_id, $response['data']); 184 | 185 | return $response['data']['access_token']; 186 | } 187 | 188 | /** 189 | * 刷新TOKEN. 190 | * 191 | * @param string $refreshToken 192 | * 193 | * @throws RequestException 194 | * @throws InvalidArgumentException 195 | * 196 | * @return string 197 | */ 198 | private function updateAccessToken(string $refreshToken): string 199 | { 200 | $param = [ 201 | 'app_id' => $this->config['app_key'], 202 | 'app_secret' => $this->config['app_secret'], 203 | 'grant_type' => 'refresh_token', 204 | 'refresh_token' => $refreshToken, 205 | ]; 206 | 207 | $response = $this->httpGet('token/refresh', $param, true); 208 | if (! $response || $response['code'] > 10000) { 209 | trigger_error("token/refresh 接口异常[{$response['code']}]"); 210 | } 211 | $response['data']['access_token_expired_at'] = time() + $response['data']['expires_in']; 212 | $response['data']['refresh_token_expired_at'] = strtotime('+14 day'); 213 | 214 | Cache::set(self::OAUTH_CACHE_KEY.$this->shop_id, $response['data']); 215 | 216 | return $response['data']['access_token']; 217 | } 218 | 219 | /** 220 | * 发起POST请求 221 | * 222 | * @param string $url 223 | * @param array $params 224 | * @param bool $needSign 225 | * 226 | * @throws RequestException 227 | * @throws InvalidArgumentException 228 | * 229 | * @return array 230 | */ 231 | public function httpPost(string $url, array $params = [], bool $needSign = true): array 232 | { 233 | return $this->request('post', $url, $params, $needSign); 234 | } 235 | 236 | public function setHttpClient($client) 237 | { 238 | $this->client = $client; 239 | 240 | return $this; 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /src/Api/Bats.php: -------------------------------------------------------------------------------- 1 | httpPost('btas/getInspectionOrder', $params); 23 | } 24 | 25 | /** 26 | * 商家送检调用. 27 | * 28 | * @param array $params 29 | * 30 | * @throws InvalidArgumentException 31 | * @throws RequestException 32 | * 33 | * @return array 34 | */ 35 | public function saveInspectionInfo(array $params): array 36 | { 37 | return $this->httpPost('btas/saveInspectionInfo', $params); 38 | } 39 | 40 | /** 41 | * 获取订单的质检结果. 42 | * 43 | * @param array $params 44 | * 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | * 48 | * @return array 49 | */ 50 | public function getOrderInspectionResult(array $params): array 51 | { 52 | return $this->httpPost('btas/getOrderInspectionResult', $params); 53 | } 54 | 55 | /** 56 | * 商家调用发货. 57 | * 58 | * @param array $params 59 | * 60 | * @throws InvalidArgumentException 61 | * @throws RequestException 62 | * 63 | * @return array 64 | */ 65 | public function shipping(array $params): array 66 | { 67 | return $this->httpPost('btas/shipping', $params); 68 | } 69 | 70 | /** 71 | * 图片质检送检. 72 | * 73 | * @param array $params 74 | * 75 | * @throws InvalidArgumentException 76 | * @throws RequestException 77 | * 78 | * @return array 79 | */ 80 | public function saveInspectionOnline(array $params): array 81 | { 82 | return $this->httpPost('btas/saveInspectionOnline', $params); 83 | } 84 | 85 | /** 86 | * 获取可图片鉴定的品牌. 87 | * 88 | * @param array $params 89 | * 90 | * @throws InvalidArgumentException 91 | * @throws RequestException 92 | * 93 | * @return array 94 | */ 95 | public function listBrand(array $params): array 96 | { 97 | return $this->httpPost('btas/listBrand', $params); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/Api/Brand.php: -------------------------------------------------------------------------------- 1 | httpPost('brand/list', $params); 21 | } 22 | 23 | /** 24 | * 通过前缀匹配召回品牌信息. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function getSug(array $params): array 32 | { 33 | return $this->httpPost('brand/getSug', $params); 34 | } 35 | 36 | /** 37 | * 兼容老品牌id转为新品牌id. 38 | * 39 | * @param array $params 40 | * @return array 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | */ 44 | public function convert(array $params): array 45 | { 46 | return $this->httpPost('brand/convert', $params); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Api/BuyIn.php: -------------------------------------------------------------------------------- 1 | httpPost('buyin/orienPlanCtrl', $params); 23 | } 24 | 25 | /** 26 | * 商品定向计划查询. 27 | * 28 | * @param array $params 29 | * 30 | * @throws InvalidArgumentException 31 | * @throws RequestException 32 | * 33 | * @return array 34 | */ 35 | public function orienPlanList(array $params): array 36 | { 37 | return $this->httpPost('buyin/orienPlanList', $params); 38 | } 39 | 40 | /** 41 | * 向指定定向计划中添加达人. 42 | * 43 | * @param array $params 44 | * 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | * 48 | * @return array 49 | */ 50 | public function orienPlanAuthorsAdd(array $params): array 51 | { 52 | return $this->httpPost('buyin/orienPlanAuthorsAdd', $params); 53 | } 54 | 55 | /** 56 | * 定向计划达人申请审核. 57 | * 58 | * @param array $params 59 | * 60 | * @throws InvalidArgumentException 61 | * @throws RequestException 62 | * 63 | * @return array 64 | */ 65 | public function orienPlanAudit(array $params): array 66 | { 67 | return $this->httpPost('buyin/orienPlanAudit', $params); 68 | } 69 | 70 | /** 71 | * 创建/修改商品定向计划. 72 | * 73 | * @param array $params 74 | * 75 | * @throws InvalidArgumentException 76 | * @throws RequestException 77 | * 78 | * @return array 79 | */ 80 | public function createOrUpdateOrienPlan(array $params): array 81 | { 82 | return $this->httpPost('buyin/createOrUpdateOrienPlan', $params); 83 | } 84 | 85 | /** 86 | * 查询定向计划作者列表. 87 | * 88 | * @param array $params 89 | * 90 | * @throws InvalidArgumentException 91 | * @throws RequestException 92 | * 93 | * @return array 94 | */ 95 | public function orienPlanAuthors(array $params): array 96 | { 97 | return $this->httpPost('buyin/orienPlanAuthors', $params); 98 | } 99 | 100 | /** 101 | * 团长活动查询接口. 102 | * 103 | * @param array $params 104 | * 105 | * @throws InvalidArgumentException 106 | * @throws RequestException 107 | * 108 | * @return array 109 | */ 110 | public function activitySearch(array $params): array 111 | { 112 | return $this->httpPost('buyin/activitySearch', $params); 113 | } 114 | 115 | /** 116 | * 商品团长活动提报接口. 117 | * 118 | * @param array $params 119 | * 120 | * @throws InvalidArgumentException 121 | * @throws RequestException 122 | * 123 | * @return array 124 | */ 125 | public function applyActivities(array $params): array 126 | { 127 | return $this->httpPost('buyin/applyActivities', $params); 128 | } 129 | 130 | /** 131 | * 创建/修改商品专属推广计划. 132 | * 133 | * @param array $params 134 | * 135 | * @throws InvalidArgumentException 136 | * @throws RequestException 137 | * 138 | * @return array 139 | */ 140 | public function exclusivePlan(array $params): array 141 | { 142 | return $this->httpPost('buyin/exclusivePlan', $params); 143 | } 144 | 145 | /** 146 | * 创建/修改普通商品推广计划. 147 | * 148 | * @param array $params 149 | * 150 | * @throws InvalidArgumentException 151 | * @throws RequestException 152 | * 153 | * @return array 154 | */ 155 | public function simplePlan(array $params): array 156 | { 157 | return $this->httpPost('buyin/simplePlan', $params); 158 | } 159 | 160 | /** 161 | * 机构查询达人直播间分销订单. 162 | * 163 | * @param array $params 164 | * 165 | * @throws InvalidArgumentException 166 | * @throws RequestException 167 | * 168 | * @return array 169 | */ 170 | public function instituteOrderAds(array $params): array 171 | { 172 | return $this->httpPost('buyin/instituteOrderAds', $params); 173 | } 174 | 175 | /** 176 | * 商品状态查询. 177 | * 178 | * @param array $params 179 | * @return array 180 | * @throws InvalidArgumentException 181 | * @throws RequestException 182 | */ 183 | public function materialsProductStatus(array $params): array 184 | { 185 | return $this->httpPost('buyin/materialsProductStatus', $params); 186 | } 187 | 188 | /** 189 | * 查询机构联盟订单. 190 | * 191 | * @param array $params 192 | * @return array 193 | * @throws InvalidArgumentException 194 | * @throws RequestException 195 | */ 196 | public function queryInstituteOrders(array $params): array 197 | { 198 | return $this->httpPost('buyin/queryInstituteOrders', $params); 199 | } 200 | 201 | /** 202 | * 达人PID创建. 203 | * 204 | * @param array $params 205 | * @return array 206 | * @throws InvalidArgumentException 207 | * @throws RequestException 208 | */ 209 | public function kolPidCreate(array $params): array 210 | { 211 | return $this->httpPost('buyin/kolPidCreate', $params); 212 | } 213 | 214 | /** 215 | * 达人PID查询接口. 216 | * 217 | * @param array $params 218 | * @return array 219 | * @throws InvalidArgumentException 220 | * @throws RequestException 221 | */ 222 | public function kolPidList(array $params): array 223 | { 224 | return $this->httpPost('buyin/kolPidList', $params); 225 | } 226 | 227 | /** 228 | * 达人PID 编辑. 229 | * 230 | * @param array $params 231 | * @return array 232 | * @throws InvalidArgumentException 233 | * @throws RequestException 234 | */ 235 | public function kolPidEdit(array $params): array 236 | { 237 | return $this->httpPost('buyin/kolPidEdit', $params); 238 | } 239 | 240 | /** 241 | * 达人PID删除. 242 | * 243 | * @param array $params 244 | * @return array 245 | * @throws InvalidArgumentException 246 | * @throws RequestException 247 | */ 248 | public function kolPidDel(array $params): array 249 | { 250 | return $this->httpPost('buyin/kolPidDel', $params); 251 | } 252 | 253 | /** 254 | * 商品分销转链. 255 | * 256 | * @param array $params 257 | * @return array 258 | * @throws InvalidArgumentException 259 | * @throws RequestException 260 | */ 261 | public function kolProductShare(array $params): array 262 | { 263 | return $this->httpPost('buyin/kolProductShare', $params); 264 | } 265 | 266 | /** 267 | * 机构PID创建. 268 | * 269 | * @param array $params 270 | * @return array 271 | * @throws InvalidArgumentException 272 | * @throws RequestException 273 | */ 274 | public function institutePidCreate(array $params): array 275 | { 276 | return $this->httpPost('buyin/institutePidCreate', $params); 277 | } 278 | 279 | /** 280 | * 机构PID 编辑. 281 | * 282 | * @param array $params 283 | * @return array 284 | * @throws InvalidArgumentException 285 | * @throws RequestException 286 | */ 287 | public function institutePidEdit(array $params): array 288 | { 289 | return $this->httpPost('buyin/institutePidEdit', $params); 290 | } 291 | 292 | /** 293 | * 机构PID删除. 294 | * 295 | * @param array $params 296 | * @return array 297 | * @throws InvalidArgumentException 298 | * @throws RequestException 299 | */ 300 | public function institutePidDel(array $params): array 301 | { 302 | return $this->httpPost('buyin/institutePidDel', $params); 303 | } 304 | 305 | /** 306 | * 直播间分销物料查询. 307 | * 308 | * @param array $params 309 | * @return array 310 | * @throws InvalidArgumentException 311 | * @throws RequestException 312 | */ 313 | public function liveShareMaterial(array $params): array 314 | { 315 | return $this->httpPost('buyin/liveShareMaterial', $params); 316 | } 317 | 318 | /** 319 | * 机构获取达人直播间分享链接. 320 | * 321 | * @param array $params 322 | * @return array 323 | * @throws InvalidArgumentException 324 | * @throws RequestException 325 | */ 326 | public function instituteLiveShare(array $params): array 327 | { 328 | return $this->httpPost('buyin/instituteLiveShare', $params); 329 | } 330 | 331 | /** 332 | * 机构PID查询接口. 333 | * 334 | * @param array $params 335 | * @return array 336 | * @throws InvalidArgumentException 337 | * @throws RequestException 338 | */ 339 | public function institutePidList(array $params): array 340 | { 341 | return $this->httpPost('buyin/institutePidList', $params); 342 | } 343 | 344 | /** 345 | * 查询达人直播间分销订单. 346 | * 347 | * @param array $params 348 | * @return array 349 | * @throws InvalidArgumentException 350 | * @throws RequestException 351 | */ 352 | public function kolOrderAds(array $params): array 353 | { 354 | return $this->httpPost('buyin/kolOrderAds', $params); 355 | } 356 | 357 | /** 358 | * 查询机构下团长活动特殊申请. 359 | * 360 | * @param array $params 361 | * @return array 362 | * @throws InvalidArgumentException 363 | * @throws RequestException 364 | */ 365 | public function specialApplyList(array $params): array 366 | { 367 | return $this->httpPost('buyin/colonel/specialApplyList', $params); 368 | } 369 | 370 | /** 371 | * 团长活动特殊申请审核. 372 | * 373 | * @param array $params 374 | * @return array 375 | * @throws InvalidArgumentException 376 | * @throws RequestException 377 | */ 378 | public function specialApplyDeal(array $params): array 379 | { 380 | return $this->httpPost('buyin/colonel/specialApplyDeal', $params); 381 | } 382 | 383 | /** 384 | * 查询达人视角商品详情. 385 | * 386 | * @param array $params 387 | * @return array 388 | * @throws InvalidArgumentException 389 | * @throws RequestException 390 | */ 391 | public function kolMaterialsProductsDetails(array $params): array 392 | { 393 | return $this->httpPost('buyin/kolMaterialsProductsDetails', $params); 394 | } 395 | 396 | /** 397 | * 查询机构联盟MCN机构订单. 398 | * 399 | * @param array $params 400 | * @return array 401 | * @throws InvalidArgumentException 402 | * @throws RequestException 403 | */ 404 | public function instituteOrderMCN(array $params): array 405 | { 406 | return $this->httpPost('buyin/instituteOrderMCN', $params); 407 | } 408 | 409 | /** 410 | * 机构查询团长订单. 411 | * 412 | * @param array $params 413 | * @return array 414 | * @throws InvalidArgumentException 415 | * @throws RequestException 416 | */ 417 | public function instituteOrderColonel(array $params): array 418 | { 419 | return $this->httpPost('buyin/instituteOrderColonel', $params); 420 | } 421 | 422 | /** 423 | * 店铺会员绑定渠道关系创建. 424 | * 425 | * @param array $params 426 | * @return array 427 | * @throws InvalidArgumentException 428 | * @throws RequestException 429 | */ 430 | public function shopPidMemberCreate(array $params): array 431 | { 432 | return $this->httpPost('buyin/shopPidMemberCreate', $params); 433 | } 434 | 435 | /** 436 | * 查询商品 SKU. 437 | * 438 | * @param array $params 439 | * @return array 440 | * @throws InvalidArgumentException 441 | * @throws RequestException 442 | */ 443 | public function productSkus(array $params): array 444 | { 445 | return $this->httpPost('buyin/productSkus', $params); 446 | } 447 | 448 | /** 449 | * 商家可参与的团长活动查询接口. 450 | * 451 | * @param array $params 452 | * @return array 453 | * @throws InvalidArgumentException 454 | * @throws RequestException 455 | */ 456 | public function shopActivityList(array $params): array 457 | { 458 | return $this->httpPost('buyin/ShopActivityList', $params); 459 | } 460 | 461 | /** 462 | * 延长推广待处理/已处理记录查询. 463 | * 464 | * @param array $params 465 | * @return array 466 | * @throws InvalidArgumentException 467 | * @throws RequestException 468 | */ 469 | public function activityProductExtendList(array $params): array 470 | { 471 | return $this->httpPost('buyin/activityProductExtendList', $params); 472 | } 473 | 474 | /** 475 | * 商家处理团长活动商品的推广延期申请. 476 | * 477 | * @param array $params 478 | * @return array 479 | * @throws InvalidArgumentException 480 | * @throws RequestException 481 | */ 482 | public function activityProductExtendApprove(array $params): array 483 | { 484 | return $this->httpPost('buyin/activityProductExtendApprove', $params); 485 | } 486 | 487 | /** 488 | * 团长可参与的二级团长活动查询接口. 489 | * 490 | * @param array $params 491 | * @return array 492 | * @throws InvalidArgumentException 493 | * @throws RequestException 494 | */ 495 | public function originColonelEnrollableActivityList(array $params): array 496 | { 497 | return $this->httpPost('buyin/originColonelEnrollableActivityList', $params); 498 | } 499 | 500 | /** 501 | * 获取团长活动详情. 502 | * 503 | * @param array $params 504 | * @return array 505 | * @throws InvalidArgumentException 506 | * @throws RequestException 507 | */ 508 | public function colonelActivityDetail(array $params): array 509 | { 510 | return $this->httpPost('buyin/colonelActivityDetail', $params); 511 | } 512 | 513 | /** 514 | * 团长获取可提报二级团长活动的商品列表. 515 | * 516 | * @param array $params 517 | * @return array 518 | * @throws InvalidArgumentException 519 | * @throws RequestException 520 | */ 521 | public function originColonelUnappliedProductList(array $params): array 522 | { 523 | return $this->httpPost('buyin/originColonelUnappliedProductList', $params); 524 | } 525 | 526 | /** 527 | * 团长报名二级团长活动. 528 | * 529 | * @param array $params 530 | * @return array 531 | * @throws InvalidArgumentException 532 | * @throws RequestException 533 | */ 534 | public function originColonelApplyActivities(array $params): array 535 | { 536 | return $this->httpPost('buyin/originColonelApplyActivities', $params); 537 | } 538 | 539 | /** 540 | * 商品选品来源转链. 541 | * 542 | * @param array $params 543 | * @return array 544 | * @throws InvalidArgumentException 545 | * @throws RequestException 546 | */ 547 | public function instPickSourceConvert(array $params): array 548 | { 549 | return $this->httpPost('buyin/instPickSourceConvert', $params); 550 | } 551 | 552 | /** 553 | * 机构选品GMV查询接口. 554 | * 555 | * @param array $params 556 | * @return array 557 | * @throws InvalidArgumentException 558 | * @throws RequestException 559 | */ 560 | public function instGmv(array $params): array 561 | { 562 | return $this->httpPost('buyin/instGmv', $params); 563 | } 564 | 565 | /** 566 | * 机构选品GMV明细查询接口. 567 | * 568 | * @param array $params 569 | * @return array 570 | * @throws InvalidArgumentException 571 | * @throws RequestException 572 | */ 573 | public function instGmvDetail(array $params): array 574 | { 575 | return $this->httpPost('buyin/instGmvDetail', $params); 576 | } 577 | 578 | /** 579 | * 分销直播间商品列表. 580 | * 581 | * @param array $params 582 | * @return array 583 | * @throws InvalidArgumentException 584 | * @throws RequestException 585 | */ 586 | public function distributionLiveProductList(array $params): array 587 | { 588 | return $this->httpPost('buyin/distributionLiveProductList', $params); 589 | } 590 | 591 | /** 592 | * 商品口令转商品解析. 593 | * 594 | * @param array $params 595 | * @return array 596 | * @throws InvalidArgumentException 597 | * @throws RequestException 598 | */ 599 | public function shareCommandParse(array $params): array 600 | { 601 | return $this->httpPost('buyin/shareCommandParse', $params); 602 | } 603 | 604 | /** 605 | * 检索精选联盟商品,需达人授权. 606 | * 607 | * @param array $params 608 | * @return array 609 | * @throws InvalidArgumentException 610 | * @throws RequestException 611 | */ 612 | public function kolMaterialsProductsSearch(array $params): array 613 | { 614 | return $this->httpPost('buyin/kolMaterialsProductsSearch', $params); 615 | } 616 | 617 | /** 618 | * 获取达人直播间分享链接. 619 | * 620 | * @param array $params 621 | * @return array 622 | * @throws InvalidArgumentException 623 | * @throws RequestException 624 | */ 625 | public function kolLiveShare(array $params): array 626 | { 627 | return $this->httpPost('buyin/kolLiveShare', $params); 628 | } 629 | } 630 | -------------------------------------------------------------------------------- /src/Api/Coupons.php: -------------------------------------------------------------------------------- 1 | httpPost('coupons/cancelVerify', $params); 23 | } 24 | 25 | /** 26 | * 卡券废弃接口. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function abandon(array $params): array 36 | { 37 | return $this->httpPost('coupons/abandon', $params); 38 | } 39 | 40 | /** 41 | * 卡券同步. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function syncV2(array $params): array 51 | { 52 | return $this->httpPost('coupons/syncV2', $params); 53 | } 54 | 55 | /** 56 | * 卡券核销接口V2版本. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function verifyV2(array $params): array 66 | { 67 | return $this->httpPost('coupons/verifyV2', $params); 68 | } 69 | 70 | /** 71 | * 卡券核销次数更新. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function certVerifyUpdate(array $params): array 81 | { 82 | return $this->httpPost('coupons/certVerifyUpdate', $params); 83 | } 84 | 85 | /** 86 | * 三方卡券列表查询. 87 | * 88 | * @param array $params 89 | * 90 | * @return array 91 | * @throws InvalidArgumentException 92 | * 93 | * @throws RequestException 94 | */ 95 | public function list(array $params): array 96 | { 97 | return $this->httpPost('coupons/list', $params); 98 | } 99 | 100 | /** 101 | * 三方卡券延期. 102 | * 103 | * @param array $params 104 | * 105 | * @return array 106 | * @throws InvalidArgumentException 107 | * 108 | * @throws RequestException 109 | */ 110 | public function extendCertValidEndByOrder(array $params): array 111 | { 112 | return $this->httpPost('coupons/extendCertValidEndByOrder', $params); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/Api/CrossBorder.php: -------------------------------------------------------------------------------- 1 | httpPost('crossBorder/orderList', $params); 23 | } 24 | 25 | /** 26 | * 入库和提货出库回告. 27 | * 28 | * @param array $params 29 | * 30 | * @throws InvalidArgumentException 31 | * @throws RequestException 32 | * 33 | * @return array 34 | */ 35 | public function warehouseInOutboundEvent(array $params): array 36 | { 37 | return $this->httpPost('crossborder/warehouseInOutboundEvent', $params); 38 | } 39 | 40 | /** 41 | * 库存盘点回告. 42 | * 43 | * @param array $params 44 | * 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | * 48 | * @return array 49 | */ 50 | public function stockTaking(array $params): array 51 | { 52 | return $this->httpPost('crossborder/stockTaking', $params); 53 | } 54 | 55 | /** 56 | * 库存类型变动回告. 57 | * 58 | * @param array $params 59 | * 60 | * @throws InvalidArgumentException 61 | * @throws RequestException 62 | * 63 | * @return array 64 | */ 65 | public function stockTransform(array $params): array 66 | { 67 | return $this->httpPost('crossborder/stockTransform', $params); 68 | } 69 | 70 | /** 71 | * 服务商锁单结果回告. 72 | * 73 | * @param array $params 74 | * 75 | * @throws InvalidArgumentException 76 | * @throws RequestException 77 | * 78 | * @return array 79 | */ 80 | public function OrderInterception(array $params): array 81 | { 82 | return $this->httpPost('crossborder/OrderInterception', $params); 83 | } 84 | 85 | /** 86 | * 运单信息回告. 87 | * 88 | * @param array $params 89 | * 90 | * @throws InvalidArgumentException 91 | * @throws RequestException 92 | * 93 | * @return array 94 | */ 95 | public function takingLogisticsInfo(array $params): array 96 | { 97 | return $this->httpPost('crossborder/takingLogisticsInfo', $params); 98 | } 99 | 100 | /** 101 | * 服务商回传仓储. 102 | * 103 | * @param array $params 104 | * 105 | * @throws InvalidArgumentException 106 | * @throws RequestException 107 | * 108 | * @return array 109 | */ 110 | public function orderOperate(array $params): array 111 | { 112 | return $this->httpPost('crossBorder/orderOperate', $params); 113 | } 114 | 115 | /** 116 | * 服务商回告清关状态. 117 | * 118 | * @param array $params 119 | * 120 | * @throws InvalidArgumentException 121 | * @throws RequestException 122 | * 123 | * @return array 124 | */ 125 | public function orderCustomClearance(array $params): array 126 | { 127 | return $this->httpPost('crossborder/orderCustomClearance', $params); 128 | } 129 | 130 | /** 131 | * 服务商回传国际干线作业节点. 132 | * 133 | * @param array $params 134 | * 135 | * @throws InvalidArgumentException 136 | * @throws RequestException 137 | * 138 | * @return array 139 | */ 140 | public function orderLogisticsTrace(array $params): array 141 | { 142 | return $this->httpPost('crossborder/orderLogisticsTrace', $params); 143 | } 144 | 145 | /** 146 | * 获取交易订单状态. 147 | * 148 | * @param array $params 149 | * 150 | * @return array 151 | * @throws RequestException 152 | * 153 | * @throws InvalidArgumentException 154 | */ 155 | public function getTradeOrderStatus(array $params): array 156 | { 157 | return $this->httpPost('crossBorder/getTradeOrderStatus', $params); 158 | } 159 | 160 | /** 161 | * 服务商回告海关税费. 162 | * 163 | * @param array $params 164 | * 165 | * @return array 166 | * @throws RequestException 167 | * 168 | * @throws InvalidArgumentException 169 | */ 170 | public function customsTaxInfo(array $params): array 171 | { 172 | return $this->httpPost('crossBorder/customsTaxInfo', $params); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /src/Api/DutyFree.php: -------------------------------------------------------------------------------- 1 | httpPost('dutyFree/orderConfirm', $params); 23 | } 24 | 25 | /** 26 | * 海南项目服务商回传实操节点. 27 | * 28 | * @param array $params 29 | * 30 | * @return array 31 | * @throws RequestException 32 | * 33 | * @throws InvalidArgumentException 34 | */ 35 | public function orderOperate(array $params): array 36 | { 37 | return $this->httpPost('dutyFree/orderOperate', $params); 38 | } 39 | 40 | /** 41 | * 商家拉单. 42 | * 43 | * @param array $params 44 | * 45 | * @return array 46 | * @throws RequestException 47 | * 48 | * @throws InvalidArgumentException 49 | */ 50 | public function orderList(array $params): array 51 | { 52 | return $this->httpPost('dutyFree/orderList', $params); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Api/FreightTemplate.php: -------------------------------------------------------------------------------- 1 | httpPost('freightTemplate/update', $params); 23 | } 24 | 25 | /** 26 | * 创建运费模板. 27 | * 28 | * @param array $params 29 | * 30 | * @return array 31 | * @throws RequestException 32 | * 33 | * @throws InvalidArgumentException 34 | */ 35 | public function create(array $params): array 36 | { 37 | return $this->httpPost('freightTemplate/create', $params); 38 | } 39 | 40 | /** 41 | * 运费模板查询. 42 | * 43 | * @param array $params 44 | * 45 | * @return array 46 | * @throws InvalidArgumentException 47 | * 48 | * @throws RequestException 49 | */ 50 | public function list(array $params = []): array 51 | { 52 | return $this->httpPost('freightTemplate/list', $params); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Api/Iop.php: -------------------------------------------------------------------------------- 1 | httpPost('iop/roleGet'); 21 | } 22 | 23 | /** 24 | * 根据更新时间查询代打订单列表. 25 | * 26 | * @param array $params 27 | * 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | * 31 | * @return array 32 | */ 33 | public function orderList(array $params): array 34 | { 35 | return $this->httpPost('iop/orderList', $params); 36 | } 37 | 38 | /** 39 | * 电子面单取号. 40 | * 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | * 44 | * @return array 45 | */ 46 | public function waybillGet(): array 47 | { 48 | return $this->httpPost('iop/waybillGet'); 49 | } 50 | 51 | /** 52 | * 取消电子面单. 53 | * 54 | * @param array $params 55 | * 56 | * @throws InvalidArgumentException 57 | * @throws RequestException 58 | * 59 | * @return array 60 | */ 61 | public function waybillCancel(array $params): array 62 | { 63 | return $this->httpPost('iop/waybillCancel', $params); 64 | } 65 | 66 | /** 67 | * 电子面单回传并发货. 68 | * 69 | * @param array $params 70 | * 71 | * @throws InvalidArgumentException 72 | * @throws RequestException 73 | * 74 | * @return array 75 | */ 76 | public function waybillReturn(array $params): array 77 | { 78 | return $this->httpPost('iop/waybillReturn', $params); 79 | } 80 | 81 | /** 82 | * 更新电子面单. 83 | * 84 | * @param array $params 85 | * 86 | * @throws InvalidArgumentException 87 | * @throws RequestException 88 | * 89 | * @return array 90 | */ 91 | public function waybillUpdate(array $params): array 92 | { 93 | return $this->httpPost('iop/waybillUpdate', $params); 94 | } 95 | 96 | /** 97 | * 订单详情. 98 | * 99 | * @param array $params 100 | * 101 | * @throws InvalidArgumentException 102 | * @throws RequestException 103 | * 104 | * @return array 105 | */ 106 | public function orderInfo(array $params): array 107 | { 108 | return $this->httpPost('iop/orderInfo', $params); 109 | } 110 | 111 | /** 112 | * 【商家】分配代发订单. 113 | * 114 | * @param array $params 115 | * @return array 116 | * @throws InvalidArgumentException 117 | * @throws RequestException 118 | */ 119 | public function sellerDistribute(array $params): array 120 | { 121 | return $this->httpPost('iop/sellerDistribute', $params); 122 | } 123 | 124 | /** 125 | * 【商家】查看代发订单详情. 126 | * 127 | * @param array $params 128 | * @return array 129 | * @throws InvalidArgumentException 130 | * @throws RequestException 131 | */ 132 | public function sellerOrderInfo(array $params): array 133 | { 134 | return $this->httpPost('iop/sellerOrderInfo', $params); 135 | } 136 | 137 | /** 138 | * 【商家】查看代发订单列表. 139 | * 140 | * @param array $params 141 | * @return array 142 | * @throws InvalidArgumentException 143 | * @throws RequestException 144 | */ 145 | public function sellerOrderList(array $params): array 146 | { 147 | return $this->httpPost('iop/sellerOrderList', $params); 148 | } 149 | 150 | /** 151 | * 【商家】查询厂商管理列表. 152 | * 153 | * @param array $params 154 | * @return array 155 | * @throws InvalidArgumentException 156 | * @throws RequestException 157 | */ 158 | public function sellerSupplierList(array $params): array 159 | { 160 | return $this->httpPost('iop/sellerSupplierList', $params); 161 | } 162 | 163 | /** 164 | * 【商家】取消分配代发订单. 165 | * 166 | * @param array $params 167 | * @return array 168 | * @throws InvalidArgumentException 169 | * @throws RequestException 170 | */ 171 | public function sellerCancleDistribute(array $params): array 172 | { 173 | return $this->httpPost('iop/sellerCancleDistribute', $params); 174 | } 175 | 176 | /** 177 | * 【厂家】查询商家列表. 178 | * 179 | * @param array $params 180 | * @return array 181 | * @throws InvalidArgumentException 182 | * @throws RequestException 183 | */ 184 | public function getSellerList(array $params): array 185 | { 186 | return $this->httpPost('iop/getSellerList', $params); 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /src/Api/Logistics.php: -------------------------------------------------------------------------------- 1 | httpPost('order/logisticsAdd', $params); 23 | } 24 | 25 | /** 26 | * 一个父订单可发多个物流包裹. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function addMultiPack(array $params): array 36 | { 37 | return $this->httpPost('order/logisticsAddMultiPack', $params); 38 | } 39 | 40 | /** 41 | * 支持多个子订单发同一个物流包裹. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function addSinglePack(array $params): array 51 | { 52 | return $this->httpPost('order/logisticsAddSinglePack', $params); 53 | } 54 | 55 | /** 56 | * 获取快递公司列表. 57 | * 58 | * @throws RequestException 59 | * @throws InvalidArgumentException 60 | * 61 | * @return array 62 | */ 63 | public function companyList(): array 64 | { 65 | return $this->httpPost('order/logisticsCompanyList'); 66 | } 67 | 68 | /** 69 | * 修改发货物流 70 | * 71 | * @param array $params 72 | * 73 | * @throws RequestException 74 | * @throws InvalidArgumentException 75 | * 76 | * @return array 77 | */ 78 | public function edit(array $params): array 79 | { 80 | return $this->httpPost('order/logisticsEdit', $params); 81 | } 82 | 83 | /** 84 | * 修改包裹里的物流信息. 85 | * 86 | * @param array $params 87 | * 88 | * @throws RequestException 89 | * @throws InvalidArgumentException 90 | * 91 | * @return array 92 | */ 93 | public function editByPack(array $params): array 94 | { 95 | return $this->httpPost('order/logisticsEditByPack', $params); 96 | } 97 | 98 | /** 99 | * 根据省获取全量四级地址. 100 | * 101 | * @param array $params 102 | * 103 | * @throws InvalidArgumentException 104 | * @throws RequestException 105 | * 106 | * @return array 107 | */ 108 | public function getAreasByProvince(array $params): array 109 | { 110 | return $this->httpPost('address/getAreasByProvince', $params); 111 | } 112 | 113 | /** 114 | * 获取四级地址全量省份信息. 115 | * 116 | * @throws InvalidArgumentException 117 | * @throws RequestException 118 | * 119 | * @return array 120 | */ 121 | public function getProvince(): array 122 | { 123 | return $this->httpPost('address/getProvince'); 124 | } 125 | 126 | /** 127 | * 顺丰新下单接口. 128 | * 129 | * @param array $params 130 | * 131 | * @throws InvalidArgumentException 132 | * @throws RequestException 133 | * 134 | * @return array 135 | */ 136 | public function createSFOrder(array $params): array 137 | { 138 | return $this->httpPost('logistics/createSFOrder', $params); 139 | } 140 | 141 | /** 142 | * 用于ISV/商家ERP系统 端发起取消已获取的电子面单号. 143 | * 144 | * @param array $params 145 | * 146 | * @throws InvalidArgumentException 147 | * @throws RequestException 148 | * 149 | * @return array 150 | */ 151 | public function cancelOrder(array $params): array 152 | { 153 | return $this->httpPost('logistics/cancelOrder', $params); 154 | } 155 | 156 | /** 157 | * 查询地址快递是否可以送达. 158 | * 159 | * @param array $params 160 | * 161 | * @throws InvalidArgumentException 162 | * @throws RequestException 163 | * 164 | * @return array 165 | */ 166 | public function getOutRange(array $params): array 167 | { 168 | return $this->httpPost('logistics/getOutRange', $params); 169 | } 170 | 171 | /** 172 | * 查询商家和物流商的订购关系以及物流单号使用情况. 173 | * 174 | * @param array $params 175 | * 176 | * @throws InvalidArgumentException 177 | * @throws RequestException 178 | * 179 | * @return array 180 | */ 181 | public function listShopNetsite(array $params): array 182 | { 183 | return $this->httpPost('logistics/listShopNetsite', $params); 184 | } 185 | 186 | /** 187 | * 商家ERP/ISV 向字节电子面单系统获取单号和打印信息. 188 | * 189 | * @param array $params 190 | * 191 | * @throws InvalidArgumentException 192 | * @throws RequestException 193 | * 194 | * @return array 195 | */ 196 | public function newCreateOrder(array $params): array 197 | { 198 | return $this->httpPost('logistics/newCreateOrder', $params); 199 | } 200 | 201 | /** 202 | * 更新收件人信息 以及发件人名字联系方式信息,不支持顺丰速递面单信息更新. 203 | * 204 | * @param array $params 205 | * 206 | * @throws InvalidArgumentException 207 | * @throws RequestException 208 | * 209 | * @return array 210 | */ 211 | public function updateOrder(array $params): array 212 | { 213 | return $this->httpPost('logistics/updateOrder', $params); 214 | } 215 | 216 | /** 217 | * 提供给isv查询运单轨迹的接口. 218 | * 219 | * @param array $params 220 | * 221 | * @throws InvalidArgumentException 222 | * @throws RequestException 223 | * 224 | * @return array 225 | */ 226 | public function trackNoRouteDetail(array $params): array 227 | { 228 | return $this->httpPost('logistics/trackNoRouteDetail', $params); 229 | } 230 | 231 | /** 232 | * 查询商家自定义区模板(新版). 233 | * 234 | * @param array $params 235 | * 236 | * @throws InvalidArgumentException 237 | * @throws RequestException 238 | * 239 | * @return array 240 | */ 241 | public function getCustomTemplateList(array $params): array 242 | { 243 | return $this->httpPost('logistics/getCustomTemplateList', $params); 244 | } 245 | 246 | /** 247 | * 获取商家所有模版信息. 248 | * 249 | * @param array $params 250 | * @return array 251 | * @throws InvalidArgumentException 252 | * @throws RequestException 253 | */ 254 | public function templateList(array $params): array 255 | { 256 | return $this->httpPost('logistics/templateList', $params); 257 | } 258 | 259 | /** 260 | * 获取面单信息. 261 | * 262 | * @param array $params 263 | * @return array 264 | * @throws InvalidArgumentException 265 | * @throws RequestException 266 | */ 267 | public function waybillApply(array $params): array 268 | { 269 | return $this->httpPost('logistics/waybillApply', $params); 270 | } 271 | 272 | /** 273 | * 追加子母件. 274 | * 275 | * @param array $params 276 | * @return array 277 | * @throws InvalidArgumentException 278 | * @throws RequestException 279 | */ 280 | public function appendSubOrder(array $params): array 281 | { 282 | return $this->httpPost('logistics/appendSubOrder', $params); 283 | } 284 | 285 | /** 286 | * 订单放行/回退. 287 | * 288 | * @param array $params 289 | * @return array 290 | * @throws InvalidArgumentException 291 | * @throws RequestException 292 | */ 293 | public function deliveryNotice(array $params): array 294 | { 295 | return $this->httpPost('logistics/deliveryNotice', $params); 296 | } 297 | 298 | /** 299 | * 查询商家电子面单密钥. 300 | * 301 | * @param array $params 302 | * @return array 303 | * @throws InvalidArgumentException 304 | * @throws RequestException 305 | */ 306 | public function getShopKey(array $params): array 307 | { 308 | return $this->httpPost('logistics/getShopKey', $params); 309 | } 310 | 311 | /** 312 | * isv轨迹订阅. 313 | * 314 | * @param array $params 315 | * @return array 316 | * @throws InvalidArgumentException 317 | * @throws RequestException 318 | */ 319 | public function registerPackageRoute(array $params): array 320 | { 321 | return $this->httpPost('logistics/registerPackageRoute', $params); 322 | } 323 | 324 | /** 325 | * 查询商家自定义模板(新版). 326 | * 327 | * @param array $params 328 | * @return array 329 | * @throws InvalidArgumentException 330 | * @throws RequestException 331 | */ 332 | public function getDesignTemplateList(array $params): array 333 | { 334 | return $this->httpPost('logistics/getDesignTemplateList', $params); 335 | } 336 | 337 | /** 338 | * 一段码推送(包含末端中心、集包地、大头笔)(仅用于兼容老物流网关). 339 | * 340 | * @param array $params 341 | * @return array 342 | * @throws InvalidArgumentException 343 | * @throws RequestException 344 | */ 345 | public function pushFirstSortCode(array $params): array 346 | { 347 | return $this->httpPost('power/pushFirstSortCode', $params); 348 | } 349 | 350 | /** 351 | * 个性化集包编码推送(仅用于兼容老物流网关). 352 | * 353 | * @param array $params 354 | * @return array 355 | * @throws InvalidArgumentException 356 | * @throws RequestException 357 | */ 358 | public function pushCustomSortCode(array $params): array 359 | { 360 | return $this->httpPost('power/pushCustomSortCode', $params); 361 | } 362 | 363 | /** 364 | * 三段码推送(仅用于兼容老物流网关). 365 | * 366 | * @param array $params 367 | * @return array 368 | * @throws InvalidArgumentException 369 | * @throws RequestException 370 | */ 371 | public function pushThirdSortCode(array $params): array 372 | { 373 | return $this->httpPost('power/pushThirdSortCode', $params); 374 | } 375 | 376 | /** 377 | * 二段码推送(仅用于兼容老物流网关). 378 | * 379 | * @param array $params 380 | * @return array 381 | * @throws InvalidArgumentException 382 | * @throws RequestException 383 | */ 384 | public function pushSecondSortCode(array $params): array 385 | { 386 | return $this->httpPost('power/pushSecondSortCode', $params); 387 | } 388 | } 389 | -------------------------------------------------------------------------------- /src/Api/Material.php: -------------------------------------------------------------------------------- 1 | httpPost('alliance/materialsProductsDetails', $params); 21 | } 22 | 23 | /** 24 | * 创建文件夹. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function createFolder(array $params): array 32 | { 33 | return $this->httpPost('material/createFolder', $params); 34 | } 35 | 36 | /** 37 | * 将文件夹移动到回收站. 38 | * 39 | * @param array $params 40 | * @return array 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | */ 44 | public function moveFolderToRecycleBin(array $params): array 45 | { 46 | return $this->httpPost('material/moveFolderToRecycleBin', $params); 47 | } 48 | 49 | /** 50 | * 编辑/移动文件夹. 51 | * 52 | * @param array $params 53 | * @return array 54 | * @throws InvalidArgumentException 55 | * @throws RequestException 56 | */ 57 | public function editFolder(array $params): array 58 | { 59 | return $this->httpPost('material/editFolder', $params); 60 | } 61 | 62 | /** 63 | * 移动素材到回收站. 64 | * 65 | * @param array $params 66 | * @return array 67 | * @throws InvalidArgumentException 68 | * @throws RequestException 69 | */ 70 | public function moveMaterialToRecycleBin(array $params): array 71 | { 72 | return $this->httpPost('material/moveMaterialToRecycleBin', $params); 73 | } 74 | 75 | /** 76 | * 从回收站中恢复素材. 77 | * 78 | * @param array $params 79 | * @return array 80 | * @throws InvalidArgumentException 81 | * @throws RequestException 82 | */ 83 | public function recoverMaterial(array $params): array 84 | { 85 | return $this->httpPost('material/recoverMaterial', $params); 86 | } 87 | 88 | /** 89 | * 编辑素材. 90 | * 91 | * @param array $params 92 | * @return array 93 | * @throws InvalidArgumentException 94 | * @throws RequestException 95 | */ 96 | public function editMaterial(array $params): array 97 | { 98 | return $this->httpPost('material/editMaterial', $params); 99 | } 100 | 101 | /** 102 | * 从回收站恢复文件夹. 103 | * 104 | * @param array $params 105 | * @return array 106 | * @throws InvalidArgumentException 107 | * @throws RequestException 108 | */ 109 | public function recoverFolder(array $params): array 110 | { 111 | return $this->httpPost('material/recoverFolder', $params); 112 | } 113 | 114 | /** 115 | * 彻底删除素材. 116 | * 117 | * @param array $params 118 | * @return array 119 | * @throws InvalidArgumentException 120 | * @throws RequestException 121 | */ 122 | public function deleteMaterial(array $params): array 123 | { 124 | return $this->httpPost('material/deleteMaterial', $params); 125 | } 126 | 127 | /** 128 | * 彻底删除文件夹. 129 | * 130 | * @param array $params 131 | * @return array 132 | * @throws InvalidArgumentException 133 | * @throws RequestException 134 | */ 135 | public function deleteFolder(array $params): array 136 | { 137 | return $this->httpPost('material/deleteFolder', $params); 138 | } 139 | 140 | /** 141 | * 查素材详情. 142 | * 143 | * @param array $params 144 | * @return array 145 | * @throws InvalidArgumentException 146 | * @throws RequestException 147 | */ 148 | public function queryMaterialDetail(array $params): array 149 | { 150 | return $this->httpPost('material/queryMaterialDetail', $params); 151 | } 152 | 153 | /** 154 | * 同步上传素材. 155 | * 156 | * @param array $params 157 | * @return array 158 | * @throws InvalidArgumentException 159 | * @throws RequestException 160 | */ 161 | public function uploadImageSync(array $params): array 162 | { 163 | return $this->httpPost('material/uploadImageSync', $params); 164 | } 165 | 166 | /** 167 | * 素材中心--异步上传视频接口. 168 | * 169 | * @param array $params 170 | * @return array 171 | * @throws InvalidArgumentException 172 | * @throws RequestException 173 | */ 174 | public function uploadVideoAsync(array $params): array 175 | { 176 | return $this->httpPost('material/uploadVideoAsync', $params); 177 | } 178 | 179 | /** 180 | * 搜索素材. 181 | * 182 | * @param array $params 183 | * @return array 184 | * @throws InvalidArgumentException 185 | * @throws RequestException 186 | */ 187 | public function searchMaterial(array $params): array 188 | { 189 | return $this->httpPost('material/searchMaterial', $params); 190 | } 191 | 192 | /** 193 | * 搜索文件夹. 194 | * 195 | * @param array $params 196 | * @return array 197 | * @throws InvalidArgumentException 198 | * @throws RequestException 199 | */ 200 | public function searchFolder(array $params): array 201 | { 202 | return $this->httpPost('material/searchFolder', $params); 203 | } 204 | 205 | /** 206 | * 查看文件夹详情. 207 | * 208 | * @param array $params 209 | * @return array 210 | * @throws InvalidArgumentException 211 | * @throws RequestException 212 | */ 213 | public function getFolderInfo(array $params): array 214 | { 215 | return $this->httpPost('material/getFolderInfo', $params); 216 | } 217 | 218 | /** 219 | * 批量上传视频到素材中心. 220 | * 221 | * @param array $params 222 | * @return array 223 | * @throws InvalidArgumentException 224 | * @throws RequestException 225 | */ 226 | public function batchUploadVideoAsync(array $params): array 227 | { 228 | return $this->httpPost('material/batchUploadVideoAsync', $params); 229 | } 230 | 231 | /** 232 | * 批量上传图片到素材中心. 233 | * 234 | * @param array $params 235 | * @return array 236 | * @throws InvalidArgumentException 237 | * @throws RequestException 238 | */ 239 | public function batchUploadImageSync(array $params): array 240 | { 241 | return $this->httpPost('material/batchUploadImageSync', $params); 242 | } 243 | 244 | /** 245 | * 获取商家容量详情. 246 | * 247 | * @param array $params 248 | * @return array 249 | * @throws InvalidArgumentException 250 | * @throws RequestException 251 | */ 252 | public function getCapInfo(array $params): array 253 | { 254 | return $this->httpPost('material/get_cap_info', $params); 255 | } 256 | } 257 | -------------------------------------------------------------------------------- /src/Api/Member.php: -------------------------------------------------------------------------------- 1 | httpPost('member/batchUpdate', $params); 23 | } 24 | 25 | /** 26 | * 获取商家推广链接接口. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function getShopShortLink(array $params): array 36 | { 37 | return $this->httpPost('member/getShopShortLink', $params); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Api/OpenCloud.php: -------------------------------------------------------------------------------- 1 | httpPost('openCloud/ddpGetShopList', $params); 21 | } 22 | 23 | /** 24 | * 数据推送,删除绑定的推送店铺. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function ddpDeleteShop(array $params): array 32 | { 33 | return $this->httpPost('openCloud/ddpDeleteShop', $params); 34 | } 35 | 36 | /** 37 | * 数据推送,添加数据推送店铺. 38 | * 39 | * @param array $params 40 | * @return array 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | */ 44 | public function ddpAddShop(array $params): array 45 | { 46 | return $this->httpPost('openCloud/ddpAddShop', $params); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Api/Order.php: -------------------------------------------------------------------------------- 1 | httpPost('order/addOrderRemark', $params); 23 | } 24 | 25 | /** 26 | * 设置店铺支持地址变更审核. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function addressAppliedSwitch(array $params): array 36 | { 37 | return $this->httpPost('order/AddressAppliedSwitch', $params); 38 | } 39 | 40 | /** 41 | * 买家地址变更确认. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function addressConfirm(array $params): array 51 | { 52 | return $this->httpPost('order/addressConfirm', $params); 53 | } 54 | 55 | /** 56 | * 卖家主动修改收货地址 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function addressModify(array $params): array 66 | { 67 | return $this->httpPost('order/addressModify', $params); 68 | } 69 | 70 | /** 71 | * 获取服务单列表. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function getServiceList(array $params): array 81 | { 82 | return $this->httpPost('order/getServiceList', $params); 83 | } 84 | 85 | /** 86 | * 回复服务请求 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function replyService(array $params): array 96 | { 97 | return $this->httpPost('order/replyService', $params); 98 | } 99 | 100 | /** 101 | * 查询商家服务单详情请求 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function serviceDetail(array $params): array 111 | { 112 | return $this->httpPost('order/serviceDetail', $params); 113 | } 114 | 115 | /** 116 | * 未支付订单改货款. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function updateOrderAmount(array $params): array 126 | { 127 | return $this->httpPost('order/updateOrderAmount', $params); 128 | } 129 | 130 | /** 131 | * 未支付订单邮费修改. 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function updatePostAmount(array $params): array 141 | { 142 | return $this->httpPost('order/updatePostAmount', $params); 143 | } 144 | 145 | /** 146 | * 获取运费险保单详情. 147 | * 148 | * @param array $params 149 | * 150 | * @throws RequestException 151 | * @throws InvalidArgumentException 152 | * 153 | * @return array 154 | */ 155 | public function insurance(array $params): array 156 | { 157 | return $this->httpPost('order/insurance', $params); 158 | } 159 | 160 | /** 161 | * 新版查询订单的详细信息. 162 | * 163 | * @param array $params 164 | * 165 | * @throws InvalidArgumentException 166 | * @throws RequestException 167 | * 168 | * @return array 169 | */ 170 | public function orderDetail(array $params): array 171 | { 172 | return $this->httpPost('order/orderDetail', $params); 173 | } 174 | 175 | /** 176 | * 订单列表查询. 177 | * 178 | * @param array $params 179 | * 180 | * @throws InvalidArgumentException 181 | * @throws RequestException 182 | * 183 | * @return array 184 | */ 185 | public function searchList(array $params): array 186 | { 187 | return $this->httpPost('order/searchList', $params); 188 | } 189 | 190 | /** 191 | * 获取跨境承运单信息. 192 | * 193 | * @param array $params 194 | * 195 | * @throws InvalidArgumentException 196 | * @throws RequestException 197 | * 198 | * @return array 199 | */ 200 | public function getCrossBorderFulfillInfo(array $params): array 201 | { 202 | return $this->httpPost('order/getCrossBorderFulfillInfo', $params); 203 | } 204 | 205 | /** 206 | * 获取App对于商家订单修改地址的审核权限. 207 | * 208 | * @throws InvalidArgumentException 209 | * @throws RequestException 210 | * 211 | * @return array 212 | */ 213 | public function addresSwitchConfig(): array 214 | { 215 | return $this->httpPost('order/addresSwitchConfig'); 216 | } 217 | 218 | /** 219 | * 批量加密接口. 220 | * 221 | * @param array $params 222 | * 223 | * @throws InvalidArgumentException 224 | * @throws RequestException 225 | * 226 | * @return array 227 | */ 228 | public function batchEncrypt(array $params): array 229 | { 230 | return $this->httpPost('order/batchEncrypt', $params); 231 | } 232 | 233 | /** 234 | * 批量脱敏接口. 235 | * 236 | * @param array $params 237 | * 238 | * @throws InvalidArgumentException 239 | * @throws RequestException 240 | * 241 | * @return array 242 | */ 243 | public function batchSensitive(array $params): array 244 | { 245 | return $this->httpPost('order/batchSensitive', $params); 246 | } 247 | 248 | /** 249 | * 批量解密接口. 250 | * 251 | * @param array $params 252 | * 253 | * @throws InvalidArgumentException 254 | * @throws RequestException 255 | * 256 | * @return array 257 | */ 258 | public function batchDecrypt(array $params): array 259 | { 260 | return $this->httpPost('order/batchDecrypt', $params); 261 | } 262 | 263 | /** 264 | * 批量获取索引串接口. 265 | * 266 | * @param array $params 267 | * 268 | * @throws InvalidArgumentException 269 | * @throws RequestException 270 | * 271 | * @return array 272 | */ 273 | public function batchSearchIndex(array $params): array 274 | { 275 | return $this->httpPost('order/BatchSearchIndex', $params); 276 | } 277 | 278 | /** 279 | * 查看商家开票列表. 280 | * 281 | * @param array $params 282 | * 283 | * @throws InvalidArgumentException 284 | * @throws RequestException 285 | * 286 | * @return array 287 | */ 288 | public function invoiceList(array $params): array 289 | { 290 | return $this->httpPost('order/invoiceList', $params); 291 | } 292 | 293 | /** 294 | * 订单商品的序列号上传. 295 | * 296 | * @param array $params 297 | * 298 | * @throws InvalidArgumentException 299 | * @throws RequestException 300 | * 301 | * @return array 302 | */ 303 | public function addSerialNumber(array $params): array 304 | { 305 | return $this->httpPost('order/addSerialNumber', $params); 306 | } 307 | 308 | /** 309 | * 发票信息回传API. 310 | * 311 | * @param array $params 312 | * 313 | * @throws InvalidArgumentException 314 | * @throws RequestException 315 | * 316 | * @return array 317 | */ 318 | public function invoiceUpload(array $params): array 319 | { 320 | return $this->httpPost('order/invoiceUpload', $params); 321 | } 322 | 323 | /** 324 | * 查保单详情. 325 | * 326 | * @param array $params 327 | * 328 | * @throws InvalidArgumentException 329 | * @throws RequestException 330 | * 331 | * @return array 332 | */ 333 | public function policy(array $params): array 334 | { 335 | return $this->httpPost('order/policy', $params); 336 | } 337 | 338 | /** 339 | * 下载账单,生成downloadId. 340 | * 341 | * @param array $params 342 | * 343 | * @throws InvalidArgumentException 344 | * @throws RequestException 345 | * 346 | * @return array 347 | */ 348 | public function downloadSettleItemToShop(array $params): array 349 | { 350 | return $this->httpPost('order/downloadSettleItemToShop', $params); 351 | } 352 | 353 | /** 354 | * 查询账单明细V2. 355 | * 356 | * @param array $params 357 | * 358 | * @return array 359 | * @throws RequestException 360 | * 361 | * @throws InvalidArgumentException 362 | */ 363 | public function getSettleBillDetailV2(array $params): array 364 | { 365 | return $this->httpPost('order/getSettleBillDetailV2', $params); 366 | } 367 | 368 | /** 369 | * 查看是否下载成功并返回下载地址. 370 | * 371 | * @param array $params 372 | * 373 | * @return array 374 | * @throws RequestException 375 | * 376 | * @throws InvalidArgumentException 377 | */ 378 | public function downloadToShop(array $params): array 379 | { 380 | return $this->httpPost('order/downloadToShop', $params); 381 | } 382 | 383 | /** 384 | * 下载资金流水明细文件. 385 | * 386 | * @param array $params 387 | * 388 | * @return array 389 | * @throws RequestException 390 | * 391 | * @throws InvalidArgumentException 392 | */ 393 | public function downloadShopAccountItemFile(array $params): array 394 | { 395 | return $this->httpPost('order/downloadShopAccountItemFile', $params); 396 | } 397 | 398 | /** 399 | * 资金流水明细下载请求. 400 | * 401 | * @param array $params 402 | * 403 | * @return array 404 | * @throws RequestException 405 | * 406 | * @throws InvalidArgumentException 407 | */ 408 | public function downloadShopAccountItem(array $params): array 409 | { 410 | return $this->httpPost('order/downloadShopAccountItem', $params); 411 | } 412 | 413 | /** 414 | * 资金流水明细接口. 415 | * 416 | * @param array $params 417 | * 418 | * @return array 419 | * @throws RequestException 420 | * 421 | * @throws InvalidArgumentException 422 | */ 423 | public function getShopAccountItem(array $params): array 424 | { 425 | return $this->httpPost('order/getShopAccountItem', $params); 426 | } 427 | 428 | /** 429 | * 查询明文手机号报备接口(PS: 官方文档中方法名拼写错误). 430 | * 431 | * @param array $params 432 | * 433 | * @return array 434 | * @throws RequestException 435 | * 436 | * @throws InvalidArgumentException 437 | */ 438 | public function orderReportList(array $params): array 439 | { 440 | return $this->httpPost('order/ordeReportList', $params); 441 | } 442 | 443 | /** 444 | * 商家结算账单. 445 | * 446 | * @param array $params 447 | * 448 | * @return array 449 | * @throws RequestException 450 | * 451 | * @throws InvalidArgumentException 452 | */ 453 | public function getSettleBillDetailV3(array $params): array 454 | { 455 | return $this->httpPost('order/getSettleBillDetailV3', $params); 456 | } 457 | } 458 | -------------------------------------------------------------------------------- /src/Api/OrderCode.php: -------------------------------------------------------------------------------- 1 | httpPost('orderCode/downloadOrderCodeByShop', $params); 23 | } 24 | 25 | /** 26 | * bic流程订单物流发货接口. 27 | * 28 | * @param array $params 29 | * 30 | * @throws InvalidArgumentException 31 | * @throws RequestException 32 | * 33 | * @return array 34 | */ 35 | public function erpShopBindOrderCode(array $params): array 36 | { 37 | return $this->httpPost('orderCode/erpShopBindOrderCode', $params); 38 | } 39 | 40 | /** 41 | * 批量下载bic订单码. 42 | * 43 | * @param array $params 44 | * 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | * 48 | * @return array 49 | */ 50 | public function batchGetOrderCodeByShop(array $params): array 51 | { 52 | return $this->httpPost('orderCode/batchGetOrderCodeByShop', $params); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Api/Product.php: -------------------------------------------------------------------------------- 1 | httpPost('product/addV2', $params); 23 | } 24 | 25 | /** 26 | * 删除商品 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function productDel(array $params): array 36 | { 37 | return $this->httpPost('product/del', $params); 38 | } 39 | 40 | /** 41 | * 获取商品详情. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function productDetail(array $params): array 51 | { 52 | return $this->httpPost('product/detail', $params); 53 | } 54 | 55 | /** 56 | * 设置商品限购. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function editBuyerLimit(array $params): array 66 | { 67 | return $this->httpPost('product/editBuyerLimit', $params); 68 | } 69 | 70 | /** 71 | * 商品编辑新接口. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function productEditV2(array $params): array 81 | { 82 | return $this->httpPost('product/editV2', $params); 83 | } 84 | 85 | /** 86 | * 商品下架. 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function setOffline(array $params): array 96 | { 97 | return $this->httpPost('product/setOffline', $params); 98 | } 99 | 100 | /** 101 | * 商品上架. 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function setOnline(array $params): array 111 | { 112 | return $this->httpPost('product/setOnline', $params); 113 | } 114 | 115 | /** 116 | * 获取商品sku详情. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function skuDetail(array $params): array 126 | { 127 | return $this->httpPost('sku/detail', $params); 128 | } 129 | 130 | /** 131 | * 修改sku编码 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function editCode(array $params): array 141 | { 142 | return $this->httpPost('sku/editCode', $params); 143 | } 144 | 145 | /** 146 | * 编辑sku价格 147 | * 148 | * @param array $params 149 | * 150 | * @throws RequestException 151 | * @throws InvalidArgumentException 152 | * 153 | * @return array 154 | */ 155 | public function editPrice(array $params): array 156 | { 157 | return $this->httpPost('sku/editPrice', $params); 158 | } 159 | 160 | /** 161 | * 获取商品sku列表. 162 | * 163 | * @param array $params 164 | * 165 | * @throws RequestException 166 | * @throws InvalidArgumentException 167 | * 168 | * @return array 169 | */ 170 | public function skuList(array $params): array 171 | { 172 | return $this->httpPost('sku/list', $params); 173 | } 174 | 175 | /** 176 | * 修改sku库存. 177 | * 178 | * @param array $params 179 | * 180 | * @throws RequestException 181 | * @throws InvalidArgumentException 182 | * 183 | * @return array 184 | */ 185 | public function syncStock(array $params): array 186 | { 187 | return $this->httpPost('sku/syncStock', $params); 188 | } 189 | 190 | /** 191 | * 批量同步库存接口. 192 | * 193 | * @param array $params 194 | * 195 | * @throws RequestException 196 | * @throws InvalidArgumentException 197 | * 198 | * @return array 199 | */ 200 | public function syncStockBatch(array $params): array 201 | { 202 | return $this->httpPost('sku/syncStockBatch', $params); 203 | } 204 | 205 | /** 206 | * 获取商品列表新版. 207 | * 208 | * @param array $params 209 | * 210 | * @throws InvalidArgumentException 211 | * @throws RequestException 212 | * 213 | * @return array 214 | */ 215 | public function listV2(array $params): array 216 | { 217 | return $this->httpPost('product/listV2', $params); 218 | } 219 | 220 | /** 221 | * 获取商品列表新版. 222 | * 223 | * @param array $params 224 | * 225 | * @throws InvalidArgumentException 226 | * @throws RequestException 227 | * 228 | * @return array 229 | */ 230 | public function opptyProductApply(array $params): array 231 | { 232 | return $this->httpPost('opptyProduct/apply', $params); 233 | } 234 | 235 | /** 236 | * 机会品线索触达. 237 | * 238 | * @param array $params 239 | * 240 | * @throws InvalidArgumentException 241 | * @throws RequestException 242 | * 243 | * @return array 244 | */ 245 | public function opptyProductClue(array $params): array 246 | { 247 | return $this->httpPost('opptyProduct/clue', $params); 248 | } 249 | 250 | /** 251 | * 机会品提报进度查询. 252 | * 253 | * @param array $params 254 | * 255 | * @throws InvalidArgumentException 256 | * @throws RequestException 257 | * 258 | * @return array 259 | */ 260 | public function opptyProductGetApplyProgress(array $params): array 261 | { 262 | return $this->httpPost('opptyProduct/getApplyProgress', $params); 263 | } 264 | 265 | /** 266 | * 商品每日诊断任务查询API. 267 | * 268 | * @param array $params 269 | * @return array 270 | * @throws InvalidArgumentException 271 | * @throws RequestException 272 | */ 273 | public function qualityTask(array $params): array 274 | { 275 | return $this->httpPost('product/qualityTask', $params); 276 | } 277 | 278 | /** 279 | * 店铺商品质量查询API. 280 | * 281 | * @param array $params 282 | * @return array 283 | * @throws InvalidArgumentException 284 | * @throws RequestException 285 | */ 286 | public function qualityList(array $params): array 287 | { 288 | return $this->httpPost('product/qualityList', $params); 289 | } 290 | 291 | /** 292 | * 商品信息质量分查询API. 293 | * 294 | * @param array $params 295 | * @return array 296 | * @throws InvalidArgumentException 297 | * @throws RequestException 298 | */ 299 | public function qualityDetail(array $params): array 300 | { 301 | return $this->httpPost('product/qualityDetail', $params); 302 | } 303 | 304 | /** 305 | * 根据商品分类获取对应的属性列表. 306 | * 307 | * @param array $params 308 | * @return array 309 | * @throws InvalidArgumentException 310 | * @throws RequestException 311 | */ 312 | public function getCatePropertyV2(array $params): array 313 | { 314 | return $this->httpPost('product/getCatePropertyV2', $params); 315 | } 316 | 317 | /** 318 | * 获取类目下需要填写的资质列表. 319 | * 320 | * @param array $params 321 | * @return array 322 | * @throws InvalidArgumentException 323 | * @throws RequestException 324 | */ 325 | public function qualificationConfig(array $params): array 326 | { 327 | return $this->httpPost('product/qualificationConfig', $params); 328 | } 329 | 330 | /** 331 | * 查询商品发布规则. 332 | * 333 | * @param array $params 334 | * @return array 335 | * @throws InvalidArgumentException 336 | * @throws RequestException 337 | */ 338 | public function getProductUpdateRule(array $params): array 339 | { 340 | return $this->httpPost('product/getProductUpdateRule', $params); 341 | } 342 | 343 | /** 344 | * 新增跨境/海南商品. 345 | * 346 | * @param array $params 347 | * @return array 348 | * @throws InvalidArgumentException 349 | * @throws RequestException 350 | */ 351 | public function addCbProduct(array $params): array 352 | { 353 | return $this->httpPost('product/addCbProduct', $params); 354 | } 355 | 356 | /** 357 | * 编辑一个跨境/海南商品. 358 | * 359 | * @param array $params 360 | * @return array 361 | * @throws InvalidArgumentException 362 | * @throws RequestException 363 | */ 364 | public function editCbProduct(array $params): array 365 | { 366 | return $this->httpPost('product/editCbProduct', $params); 367 | } 368 | 369 | /** 370 | * 审核记录列表. 371 | * 372 | * @param array $params 373 | * @return array 374 | * @throws InvalidArgumentException 375 | * @throws RequestException 376 | */ 377 | public function auditList(array $params): array 378 | { 379 | return $this->httpPost('product/auditList', $params); 380 | } 381 | } 382 | -------------------------------------------------------------------------------- /src/Api/Recycle.php: -------------------------------------------------------------------------------- 1 | httpPost('recycle/createPrice', $params); 23 | } 24 | 25 | /** 26 | * 回收商确认收货操作. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function confirmReceive(array $params): array 36 | { 37 | return $this->httpPost('recycle/confirmReceive', $params); 38 | } 39 | 40 | /** 41 | * 回传质检通过和价格. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function qualityTestingResult(array $params): array 51 | { 52 | return $this->httpPost('recycle/qualityTestingResult', $params); 53 | } 54 | 55 | /** 56 | * 回收商在用户确认前调整报价接口. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function changePrice(array $params): array 66 | { 67 | return $this->httpPost('recycle/changePrice', $params); 68 | } 69 | 70 | /** 71 | * 回收商退货发货. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function applyChangePrice(array $params): array 81 | { 82 | return $this->httpPost('recycle/applyChangePrice', $params); 83 | } 84 | 85 | /** 86 | * 寄售成功. 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function sellSucceed(array $params): array 96 | { 97 | return $this->httpPost('recycle/sellSucceed', $params); 98 | } 99 | 100 | /** 101 | * 回收商退货发货. 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function logisticsBack(array $params): array 111 | { 112 | return $this->httpPost('recycle/logisticsBack', $params); 113 | } 114 | 115 | /** 116 | * 拉取订单列表接口. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function buyerGetOrderList(array $params): array 126 | { 127 | return $this->httpPost('recycle/buyerGetOrderList', $params); 128 | } 129 | 130 | /** 131 | * 获得订单详情. 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function buyerGetOrderDetail(array $params): array 141 | { 142 | return $this->httpPost('recycle/buyerGetOrderDetail', $params); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /src/Api/Security.php: -------------------------------------------------------------------------------- 1 | httpPost('security/batchReportOrderSecurityEvent', $params); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Api/Shop.php: -------------------------------------------------------------------------------- 1 | httpPost('shop/brandList'); 21 | } 22 | 23 | /** 24 | * 获取店铺后台供商家发布商品的类目. 25 | * 26 | * @param array $params 27 | * 28 | * @throws RequestException 29 | * @throws InvalidArgumentException 30 | * 31 | * @return array 32 | */ 33 | public function getShopCategory(array $params): array 34 | { 35 | return $this->httpPost('shop/getShopCategory', $params); 36 | } 37 | 38 | /** 39 | * 售后地址列表接口. 40 | * 41 | * @param array $params 42 | * 43 | * @throws RequestException 44 | * @throws InvalidArgumentException 45 | * 46 | * @return array 47 | */ 48 | public function addressList(array $params): array 49 | { 50 | return $this->httpPost('address/list', $params); 51 | } 52 | 53 | /** 54 | * 店铺创建售后地址接口. 55 | * 56 | * @param array $params 57 | * 58 | * @throws RequestException 59 | * @throws InvalidArgumentException 60 | * 61 | * @return array 62 | */ 63 | public function addressCreate(array $params): array 64 | { 65 | return $this->httpPost('address/create', $params); 66 | } 67 | 68 | /** 69 | * 店铺创建售后地址接口. 70 | * 71 | * @param array $params 72 | * 73 | * @throws RequestException 74 | * @throws InvalidArgumentException 75 | * 76 | * @return array 77 | */ 78 | public function addressUpdate(array $params): array 79 | { 80 | return $this->httpPost('address/update', $params); 81 | } 82 | 83 | /** 84 | * 设置尾款信息. 85 | * 86 | * @param array $params 87 | * 88 | * @return array 89 | * @throws InvalidArgumentException 90 | * 91 | * @throws RequestException 92 | */ 93 | public function setFinalPayment(array $params): array 94 | { 95 | return $this->httpPost('shop/setFinalPayment', $params); 96 | } 97 | 98 | /** 99 | * 查询店铺的应用权益. 100 | * 101 | * @param array $params 102 | * 103 | * @return array 104 | * @throws InvalidArgumentException 105 | * 106 | * @throws RequestException 107 | */ 108 | public function rightsInfo(array $params): array 109 | { 110 | return $this->httpPost('rights/info', $params); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/Api/Sms.php: -------------------------------------------------------------------------------- 1 | httpPost('sms/template/apply', $params); 21 | } 22 | 23 | /** 24 | * 公共模版查询接口. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function publicTemplate(array $params): array 32 | { 33 | return $this->httpPost('sms/public/template', $params); 34 | } 35 | 36 | /** 37 | * 提交短信签名申请单. 38 | * 39 | * @param array $params 40 | * @return array 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | */ 44 | public function signApply(array $params): array 45 | { 46 | return $this->httpPost('sms/sign/apply', $params); 47 | } 48 | 49 | /** 50 | * 撤销短信模板申请单. 51 | * 52 | * @param array $params 53 | * @return array 54 | * @throws InvalidArgumentException 55 | * @throws RequestException 56 | */ 57 | public function templateRevoke(array $params): array 58 | { 59 | return $this->httpPost('sms/template/revoke', $params); 60 | } 61 | 62 | /** 63 | * 查看短信签名申请单. 64 | * 65 | * @param array $params 66 | * @return array 67 | * @throws InvalidArgumentException 68 | * @throws RequestException 69 | */ 70 | public function signApplyList(array $params): array 71 | { 72 | return $this->httpPost('sms/sign/apply/list', $params); 73 | } 74 | 75 | /** 76 | * 短信发送. 77 | * 78 | * @param array $params 79 | * @return array 80 | * @throws InvalidArgumentException 81 | * @throws RequestException 82 | */ 83 | public function send(array $params): array 84 | { 85 | return $this->httpPost('sms/send', $params); 86 | } 87 | 88 | /** 89 | * 批量短信发送. 90 | * 91 | * @param array $params 92 | * @return array 93 | * @throws InvalidArgumentException 94 | * @throws RequestException 95 | */ 96 | public function batchSend(array $params): array 97 | { 98 | return $this->httpPost('sms/batchSend', $params); 99 | } 100 | 101 | /** 102 | * 删除短信签名. 103 | * 104 | * @param array $params 105 | * @return array 106 | * @throws InvalidArgumentException 107 | * @throws RequestException 108 | */ 109 | public function signDelete(array $params): array 110 | { 111 | return $this->httpPost('sms/sign/delete', $params); 112 | } 113 | 114 | /** 115 | * 撤销短信签名申请单. 116 | * 117 | * @param array $params 118 | * @return array 119 | * @throws InvalidArgumentException 120 | * @throws RequestException 121 | */ 122 | public function signApplyRevoke(array $params): array 123 | { 124 | return $this->httpPost('sms/sign/apply/revoke', $params); 125 | } 126 | 127 | /** 128 | * 删除短信模板. 129 | * 130 | * @param array $params 131 | * @return array 132 | * @throws InvalidArgumentException 133 | * @throws RequestException 134 | */ 135 | public function templateDelete(array $params): array 136 | { 137 | return $this->httpPost('sms/template/delete', $params); 138 | } 139 | 140 | /** 141 | * 查询短信发送结果. 142 | * 143 | * @param array $params 144 | * @return array 145 | * @throws InvalidArgumentException 146 | * @throws RequestException 147 | */ 148 | public function sendResult(array $params): array 149 | { 150 | return $this->httpPost('sms/sendResult', $params); 151 | } 152 | 153 | /** 154 | * 查询短信模板申请单. 155 | * 156 | * @param array $params 157 | * @return array 158 | * @throws InvalidArgumentException 159 | * @throws RequestException 160 | */ 161 | public function templateApplyList(array $params): array 162 | { 163 | return $this->httpPost('sms/template/apply/list', $params); 164 | } 165 | 166 | /** 167 | * 查看短信签名. 168 | * 169 | * @param array $params 170 | * @return array 171 | * @throws InvalidArgumentException 172 | * @throws RequestException 173 | */ 174 | public function signSearch(array $params): array 175 | { 176 | return $this->httpPost('sms/sign/search', $params); 177 | } 178 | 179 | /** 180 | * 查询短信模板. 181 | * 182 | * @param array $params 183 | * @return array 184 | * @throws InvalidArgumentException 185 | * @throws RequestException 186 | */ 187 | public function templateSearch(array $params): array 188 | { 189 | return $this->httpPost('sms/template/search', $params); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/Api/Spu.php: -------------------------------------------------------------------------------- 1 | httpPost('spu/getKeyPropertyByCid', $params); 23 | } 24 | 25 | /** 26 | * SPU信息查看. 27 | * 28 | * @param array $params 29 | * 30 | * @throws InvalidArgumentException 31 | * @throws RequestException 32 | * 33 | * @return array 34 | */ 35 | public function getSpuInfoBySpuId(array $params): array 36 | { 37 | return $this->httpPost('spu/getSpuInfoBySpuId', $params); 38 | } 39 | 40 | /** 41 | * 获取spu模板. 42 | * 43 | * @param array $params 44 | * 45 | * @throws InvalidArgumentException 46 | * @throws RequestException 47 | * 48 | * @return array 49 | */ 50 | public function getSpuTpl(array $params): array 51 | { 52 | return $this->httpPost('spu/getSpuTpl', $params); 53 | } 54 | 55 | /** 56 | * 通过关键属性获取SPU信息. 57 | * 58 | * @param array $params 59 | * 60 | * @throws InvalidArgumentException 61 | * @throws RequestException 62 | * 63 | * @return array 64 | */ 65 | public function addShopSpu(array $params): array 66 | { 67 | return $this->httpPost('spu/addShopSpu', $params); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Api/Storage.php: -------------------------------------------------------------------------------- 1 | httpPost('storage/notifySaleReturnStatus'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Api/SupplyChain.php: -------------------------------------------------------------------------------- 1 | httpPost('supplyChain/getOrderByOrderNo', $params); 21 | } 22 | 23 | /** 24 | * 供货单更新发货物流. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function updateConsign(array $params): array 32 | { 33 | return $this->httpPost('supplyChain/updateConsign', $params); 34 | } 35 | 36 | /** 37 | * 供货单发货. 38 | * 39 | * @param array $params 40 | * @return array 41 | * @throws InvalidArgumentException 42 | * @throws RequestException 43 | */ 44 | public function supplyConsign(array $params): array 45 | { 46 | return $this->httpPost('supplyChain/supplyConsign', $params); 47 | } 48 | 49 | /** 50 | * 供货单列表查询. 51 | * 52 | * @param array $params 53 | * @return array 54 | * @throws InvalidArgumentException 55 | * @throws RequestException 56 | */ 57 | public function getSupplyOrderList(array $params): array 58 | { 59 | return $this->httpPost('supplyChain/getSupplyOrderList', $params); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Api/Token.php: -------------------------------------------------------------------------------- 1 | httpPost('token/create', $params); 21 | } 22 | 23 | /** 24 | * 刷新 token API. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function refresh(array $params): array 32 | { 33 | return $this->httpPost('token/refresh', $params); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Api/Topup.php: -------------------------------------------------------------------------------- 1 | httpPost('topup/result', $params); 21 | } 22 | 23 | /** 24 | * 获取叶子类目可选的账号模板id. 25 | * 26 | * @param array $params 27 | * @return array 28 | * @throws InvalidArgumentException 29 | * @throws RequestException 30 | */ 31 | public function accountTemplateList(array $params): array 32 | { 33 | return $this->httpPost('topup/accountTemplateList', $params); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Api/WareHouse.php: -------------------------------------------------------------------------------- 1 | httpPost('sku/stockNum', $params); 23 | } 24 | 25 | /** 26 | * 创建单个区域仓. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function create(array $params): array 36 | { 37 | return $this->httpPost('warehouse/create', $params); 38 | } 39 | 40 | /** 41 | * 批量创建区域仓. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function createBatch(array $params): array 51 | { 52 | return $this->httpPost('warehouse/createBatch', $params); 53 | } 54 | 55 | /** 56 | * 编辑区域仓. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function edit(array $params): array 66 | { 67 | return $this->httpPost('warehouse/edit', $params); 68 | } 69 | 70 | /** 71 | * 查询区域仓. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function info(array $params): array 81 | { 82 | return $this->httpPost('warehouse/info', $params); 83 | } 84 | 85 | /** 86 | * 批量查询区域仓. 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function list(array $params): array 96 | { 97 | return $this->httpPost('warehouse/list', $params); 98 | } 99 | 100 | /** 101 | * 地址与区域仓解绑. 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function removeAddr(array $params): array 111 | { 112 | return $this->httpPost('warehouse/removeAddr', $params); 113 | } 114 | 115 | /** 116 | * 绑定单个地址到区域仓. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function setAddr(array $params): array 126 | { 127 | return $this->httpPost('warehouse/setAddr', $params); 128 | } 129 | 130 | /** 131 | * 批量绑定地址与区域仓. 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function setAddrBatch(array $params): array 141 | { 142 | return $this->httpPost('warehouse/setAddrBatch', $params); 143 | } 144 | 145 | /** 146 | * 设置指定地址下的仓的优先级. 147 | * 148 | * @param array $params 149 | * 150 | * @throws RequestException 151 | * @throws InvalidArgumentException 152 | * 153 | * @return array 154 | */ 155 | public function setPriority(array $params): array 156 | { 157 | return $this->httpPost('warehouse/setPriority', $params); 158 | } 159 | 160 | /** 161 | * 设置sku发货时效. 162 | * 163 | * @param array $params 164 | * 165 | * @throws InvalidArgumentException 166 | * @throws RequestException 167 | * 168 | * @return array 169 | */ 170 | public function setSkuShipTime(array $params): array 171 | { 172 | return $this->httpPost('promise/setSkuShipTime', $params); 173 | } 174 | 175 | /** 176 | * 库存调整(盘点和转移). 177 | * 178 | * @param array $params 179 | * 180 | * @throws InvalidArgumentException 181 | * @throws RequestException 182 | * 183 | * @return array 184 | */ 185 | public function adjustInventory(array $params): array 186 | { 187 | return $this->httpPost('warehouse/adjustInventory', $params); 188 | } 189 | 190 | /** 191 | * 商家发货时效配置推荐. 192 | * 193 | * @param array $params 194 | * 195 | * @throws InvalidArgumentException 196 | * @throws RequestException 197 | * 198 | * @return array 199 | */ 200 | public function deliveryList(array $params): array 201 | { 202 | return $this->httpPost('promise/deliveryList', $params); 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /src/Api/Yunc.php: -------------------------------------------------------------------------------- 1 | httpPost('yunc/cancelOutboundOrderToB', $params); 23 | } 24 | 25 | /** 26 | * 商家入驻仓关系查询. 27 | * 28 | * @param array $params 29 | * 30 | * @throws RequestException 31 | * @throws InvalidArgumentException 32 | * 33 | * @return array 34 | */ 35 | public function shopWarehouseRefQuery(array $params): array 36 | { 37 | return $this->httpPost('yunc/shopWarehouseRefQuery', $params); 38 | } 39 | 40 | /** 41 | * wms入库单回告. 42 | * 43 | * @param array $params 44 | * 45 | * @throws RequestException 46 | * @throws InvalidArgumentException 47 | * 48 | * @return array 49 | */ 50 | public function wmsInboundCallback(array $params): array 51 | { 52 | return $this->httpPost('yunc/wmsInboundCallback', $params); 53 | } 54 | 55 | /** 56 | * 云仓出库接单. 57 | * 58 | * @param array $params 59 | * 60 | * @throws RequestException 61 | * @throws InvalidArgumentException 62 | * 63 | * @return array 64 | */ 65 | public function cloudCreateOutboundOrder(array $params): array 66 | { 67 | return $this->httpPost('yunc/cloudCreateOutboundOrder', $params); 68 | } 69 | 70 | /** 71 | * 销退入库取消. 72 | * 73 | * @param array $params 74 | * 75 | * @throws RequestException 76 | * @throws InvalidArgumentException 77 | * 78 | * @return array 79 | */ 80 | public function cloudCancelInboundOrder(array $params): array 81 | { 82 | return $this->httpPost('yunc/cloudCancelInboundOrder', $params); 83 | } 84 | 85 | /** 86 | * 销退单入库. 87 | * 88 | * @param array $params 89 | * 90 | * @throws RequestException 91 | * @throws InvalidArgumentException 92 | * 93 | * @return array 94 | */ 95 | public function cloudCreateInboundOrder(array $params): array 96 | { 97 | return $this->httpPost('yunc/cloudCreateInboundOrder', $params); 98 | } 99 | 100 | /** 101 | * 云仓出库取消. 102 | * 103 | * @param array $params 104 | * 105 | * @throws RequestException 106 | * @throws InvalidArgumentException 107 | * 108 | * @return array 109 | */ 110 | public function cloudCancelOutboundOrder(array $params): array 111 | { 112 | return $this->httpPost('yunc/cloudCancelOutboundOrder', $params); 113 | } 114 | 115 | /** 116 | * 给外部WMS调用的推送出库信息回传. 117 | * 118 | * @param array $params 119 | * 120 | * @throws RequestException 121 | * @throws InvalidArgumentException 122 | * 123 | * @return array 124 | */ 125 | public function pushOutboundFeedback(array $params): array 126 | { 127 | return $this->httpPost('yunc/pushOutboundFeedback', $params); 128 | } 129 | 130 | /** 131 | * 货品推送接口-ERP(单个). 132 | * 133 | * @param array $params 134 | * 135 | * @throws RequestException 136 | * @throws InvalidArgumentException 137 | * 138 | * @return array 139 | */ 140 | public function erpCargoSinglePush(array $params): array 141 | { 142 | return $this->httpPost('yunc/erpCargoSinglePush', $params); 143 | } 144 | 145 | /** 146 | * erp创建入库单. 147 | * 148 | * @param array $params 149 | * 150 | * @throws RequestException 151 | * @throws InvalidArgumentException 152 | * 153 | * @return array 154 | */ 155 | public function erpInboundCreate(array $params): array 156 | { 157 | return $this->httpPost('yunc/erpInboundCreate', $params); 158 | } 159 | 160 | /** 161 | * 设置指定地址下的仓的优先级. 162 | * 163 | * @param array $params 164 | * 165 | * @throws RequestException 166 | * @throws InvalidArgumentException 167 | * 168 | * @return array 169 | */ 170 | public function erpInboundCancel(array $params): array 171 | { 172 | return $this->httpPost('yunc/erpInboundCancel', $params); 173 | } 174 | 175 | /** 176 | * 库存调整(盘点和转移). 177 | * 178 | * @param array $params 179 | * 180 | * @throws RequestException 181 | * @throws InvalidArgumentException 182 | * 183 | * @return array 184 | */ 185 | public function adjustInventory(array $params): array 186 | { 187 | return $this->httpPost('yunc/adjustInventory', $params); 188 | } 189 | 190 | /** 191 | * toB出库单. 192 | * 193 | * @param array $params 194 | * 195 | * @throws RequestException 196 | * @throws InvalidArgumentException 197 | * 198 | * @return array 199 | */ 200 | public function createOutboundOrderToB(array $params): array 201 | { 202 | return $this->httpPost('yunc/createOutboundOrderToB', $params); 203 | } 204 | 205 | /** 206 | * 仓储系统回传发货信息. 207 | * 208 | * @param array $params 209 | * 210 | * @throws RequestException 211 | * @throws InvalidArgumentException 212 | * 213 | * @return array 214 | */ 215 | public function deliveryInfoNotify(array $params): array 216 | { 217 | return $this->httpPost('wms/deliveryInfoNotify', $params); 218 | } 219 | 220 | /** 221 | * WMS出库明细回传. 222 | * 223 | * @param array $params 224 | * 225 | * @return array 226 | * @throws InvalidArgumentException 227 | * 228 | * @throws RequestException 229 | */ 230 | public function outboundDetailNotify(array $params): array 231 | { 232 | return $this->httpPost('wms/outboundDetailNotify', $params); 233 | } 234 | 235 | /** 236 | * 入库明细回传,WMS回传入库数据时,使用该接口回传. 237 | * 238 | * @param array $params 239 | * 240 | * @return array 241 | * @throws InvalidArgumentException 242 | * 243 | * @throws RequestException 244 | */ 245 | public function inboundDetailNotify(array $params): array 246 | { 247 | return $this->httpPost('wms/inboundDetailNotify', $params); 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /src/DouDian.php: -------------------------------------------------------------------------------- 1 | config = $config; 78 | } 79 | 80 | public function __get($class) 81 | { 82 | $class = '\\Abbotton\\DouDian\\Api\\'.Str::ucfirst($class); 83 | if (! class_exists($class)) { 84 | throw new Exception($class.', Not found', 404); 85 | } 86 | 87 | return new $class($this->config, $this->shop_id); 88 | } 89 | 90 | /** 91 | * 设定店铺ID. 92 | * 93 | * @param int $shopId 94 | * 95 | * @return $this 96 | */ 97 | public function setShopId(int $shopId): self 98 | { 99 | $this->shop_id = $shopId; 100 | 101 | return $this; 102 | } 103 | 104 | /** 105 | * 获取店铺ID. 106 | * 107 | * @return mixed|null 108 | */ 109 | public function getShopId() 110 | { 111 | return $this->shop_id; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/DouDianFacade.php: -------------------------------------------------------------------------------- 1 | $name; 12 | } 13 | 14 | /** 15 | * Get the registered name of the component. 16 | * 17 | * @return string 18 | */ 19 | protected static function getFacadeAccessor() 20 | { 21 | return 'doudian'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DouDianServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->runningInConsole()) { 15 | $this->publishes([ 16 | __DIR__.'/../config/config.php' => config_path('doudian.php'), 17 | ], 'config'); 18 | } 19 | } 20 | 21 | /** 22 | * Register the application services. 23 | */ 24 | public function register() 25 | { 26 | // Automatically apply the package configuration 27 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'doudian'); 28 | 29 | // Register the main class to use with the facade 30 | $this->app->singleton('doudian', function () { 31 | $config = config('doudian'); 32 | 33 | return new DouDian($config); 34 | }); 35 | } 36 | } 37 | --------------------------------------------------------------------------------