PHP code example of tcdev / ship-station
1. Go to this page and download the library: Download tcdev/ship-station library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tcdev / ship-station example snippets
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