1. Go to this page and download the library: Download hkonnet/laravel-shipstation 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/ */
use Hkonnet\LaravelShipStation\ShipStation;
$shipStation = new ShipStation();
// Fetch an order by orderId == 123, orderId is defined by ShipStation
$order = $shipStation->orders->get([], $endpoint = 123); // returns \stdClass
// Fetch an orderId by the orderNumber, which may be user defined
$order = $shipStation->orders->getOrderId('ORD-789'); // returns integer
use Hkonnet\LaravelShipStation\ShipStation;
$shipStation = new ShipStation();
$address = new LaravelShipStation\Models\Address();
$address->name = "Joe Campo";
$address->street1 = "123 Main St";
$address->city = "Cleveland";
$address->state = "OH";
$address->postalCode = "44127";
$address->country = "US";
$address->phone = "2165555555";
$item = new LaravelShipStation\Models\OrderItem();
$item->lineItemKey = '1';
$item->sku = '580123456';
$item->name = "Awesome sweater.";
$item->quantity = '1';
$item->unitPrice = '29.99';
$item->warehouseLocation = 'Warehouse A';
$order = new LaravelShipStation\Models\Order();
$order->orderNumber = '1';
$order->orderDate = '2016-05-09';
$order->orderStatus = 'awaiting_shipment';
$order->amountPaid = '29.99';
$order->taxAmount = '0.00';
$order->shippingAmount = '0.00';
$order->internalNotes = 'A note about my order.';
$order->billTo = $address;
$order->shipTo = $address;
$order->items[] = $item;
// This will var_dump the newly created order, and order should be wrapped in an array.
var_dump($shipStation->orders->post([$order], 'createorder'));
// or with the helper: $shipStation->orders->create([$order]); would be the same.