Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparkinzy/kwaishop-sdk
kwaishop sdk
https://github.com/sparkinzy/kwaishop-sdk
Last synced: 9 days ago
JSON representation
kwaishop sdk
- Host: GitHub
- URL: https://github.com/sparkinzy/kwaishop-sdk
- Owner: Sparkinzy
- License: mit
- Created: 2020-12-11T08:02:42.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T03:35:33.000Z (almost 4 years ago)
- Last Synced: 2024-11-09T07:23:50.809Z (9 days ago)
- Language: PHP
- Size: 78.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 快手电商SDK
## 配置项
config.php
```phpreturn [
'app_key' => '123',
'app_secret' => '123',
'sign_secret' => '123',
'state' => time(),
'redirect_uri' => 'http://kuaishou.xxx.com',
'debug' => false,
'access_token' => 'access_token',
'log'=>[
'name'=>'kuaishou',
'file'=> __DIR__.'/kuaishou.log',
'level'=>'debug',
'permission'=> 0777
]
];
```## 授权
```php$config = include __DIR__.'/config.php';
$kwaishop = new \Sparkinzy\KwaishopSdk\Kwaishop($config);
# 自动跳转到授权页面
$kwaishop->authorize();```
## 获取token
```php
$config = include __DIR__.'/config.php';
$kwaishop = new \Sparkinzy\KwaishopSdk\Kwaishop($config);
$result = $kwaishop->token();
```## 获取商家信息
```php
$kwaishop = new \Sparkinzy\KwaishopSdk\Kwaishop($config);
$user = $kwaishop->user->request('open.user.seller.get');
```## 获取商品类目列表
```php
''""$kwaishop = new \Sparkinzy\KwaishopSdk\Kwaishop($config);
// 获取商品类目列表
$categories = $kwaishop->item->request('open.item.category');
// 获取商品列表
$param = [
'kwaiItemId'=>null,
'relItemId'=> null,
'itemStatus'=> null,
'itemType'=> null,
'pageNumber'=> 1,
'pageSize'=>20
];
$list = $kwaishop->item->request('open.item.list',$param);// 新增商品
$param = [
'relItemId'=>null,
'title'=> null,
'imageUrls'=> null,
'details'=> null,
'expressFee'=> 1,
'categoryId'=>20,
];
$item = $kwaishop->item->request('open.item.add',$param,'POST');```