-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
084ae74
commit d000d8b
Showing
1 changed file
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,44 @@ | ||
# ship-station | ||
# ShipStation Api Wrapper for PHP | ||
|
||
## Install | ||
--- | ||
``` | ||
composer require michaelb/ship-station | ||
``` | ||
|
||
## Docs | ||
--- | ||
|
||
Using ShipStationApi | ||
```php | ||
|
||
use MichaelB\ShipStation\ShipStationApi; | ||
|
||
$apiKey = ''; // Your ShipStation Api Key | ||
$apiSecret = ''; // Your ShipStation Api Secret | ||
$options = []; // Options to be merged into the normal GuzzleHttp\Client options | ||
|
||
// ShipStationApi Extends GuzzleHttp\Client | ||
$shipstation = new ShipStationApi($apiKey, $apiSecret, $options); | ||
|
||
/* | ||
* Get a service instance | ||
*/ | ||
|
||
// Orders | ||
$orderService = $shipstation->orders; | ||
|
||
// Products | ||
$products = $shipstation->products; | ||
|
||
// ... | ||
|
||
/* | ||
* Use the service | ||
*/ | ||
$order = $orderService->getOrder('1234'); | ||
|
||
// All service methods return a GuzzleHttp\Psr7\Response object | ||
$json = $order->getBody(); // { 'order': {...} } | ||
$status = $order->getStatusCode(); // 200 | ||
``` |