https://github.com/zacksleo/newegg-sdk
sdk for newegg api
https://github.com/zacksleo/newegg-sdk
Last synced: about 1 year ago
JSON representation
sdk for newegg api
- Host: GitHub
- URL: https://github.com/zacksleo/newegg-sdk
- Owner: zacksleo
- Created: 2019-08-07T09:24:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-17T01:25:09.000Z (almost 7 years ago)
- Last Synced: 2025-03-09T05:39:18.993Z (over 1 year ago)
- Language: PHP
- Homepage: https://developer.newegg.com/newegg_marketplace_api
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
newegg-sdk
sdk for newegg api.
## Installing
```shell
$ composer require zacksleo/newegg-sdk -vvv
```
## Usage
### Create Client
```php
$newegg = new Newegg([
'key' => 'app_key',
'secret' => 'app_secret',
'seller_id' => 'seller_id',
'debug' => false,
'log' => [
'name' => 'newegg',
'file' => '/path/to/logs/newegg.log',
'level' => 'error',
'permission' => 0777,
],
]);
```
### Api Call
调用时,支持两种方式,一种是链式调用
```php
$res = $newegg->ordermgmt->order->chinaorderinfo([
'PageIndex' => 1,
'PageSize' => 1,
'RequestCriteria' => [
'OrderNumberList'=> [
'OrderNumber'=> ['orderNumber'],
],
],
]);
```
```php
$res = $newegg->servicemgmt->rma->rmainfo([
'PageInfo'=> [
'PageIndex' => 1,
'PageSize' => 1,
],
'KeywordsType' => 2,
'KeywordsValue' => 'OrderNumber',
]);
```
另一种是使用 request 方法
```php
$res = $newegg->request([
'ordermgmt.orderstatus.orders.'.$orderNumber => null,
], [
'Action' => 2,
'Value' => [
'Shipment' => [
'Header' => [
'SellerID' => 'seller_id',
'SONumber' => $orderNumber,
],
'PackageList' => [
'Package' => array_values($packages),
],
],
],
]);
```
## Contributing
You can contribute in one of three ways:
1. File bug reports using the [issue tracker](https://github.com/zacksleo/newegg-sdk/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/zacksleo/newegg-sdk/issues).
3. Contribute new features or update the wiki.
_The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._
## License
MIT