aidilrozi / shopee-api-sdk
Shopee Partner API PHP SDK
dev-master
2020-08-06 02:31 UTC
Requires
- php: >=7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- phpstan/phpstan: ^0.12.14
- phpunit/phpunit: ^7.5
- squizlabs/php_codesniffer: ^3.5
This package is not auto-updated.
Last update: 2024-09-27 20:58:15 UTC
README
这是一个 Shopee Partner API 的 PHP 客户端。
要求
安装
执行以下命令获取包:
$ composer require Aidilrozi/shopee-api-sdk
用法
创建 Shopee 客户端的实例,然后使用它来访问 Shopee Partner API。
<?php require_once __DIR__ . '/vendor/autoload.php'; $client = new \Shopee\Client([ 'secret' => SHOPEE_SECRET, 'partner_id' => SHOPEE_PARTNER_ID, 'shopid' => SHOPEE_SHOP_ID, ]);
示例
获取商品详情
$response = $client->item->getItemDetail(['item_id' => 1978]);
或者,您也可以在请求中使用参数模型。
$parameters = (new \Shopee\Nodes\Item\Parameters\GetItemDetail()) ->setItemId(1978); $response = $client->item->getItemDetail($parameters);
许可协议
有关许可权利和限制,请参阅LICENSE 文件(BSD 3-Clause)。