The purpose of this library is to aid communication with Visualsoft's SOAP API.
This library currently supports version 3 of the Visualsoft WSDL.
To install with Composer:
composer require mikkelson/visualsoft-php-soap-api
After the package installation completes, use the autoloader provided by Composer.
require __DIR__ . '/vendor/autoload.php';Load the package namespace.
use Mikkelson\Visualsoft;Before making useful calls to Visualsoft, you must first set the client.
$credentials = [
'client_id' => 'YOUR VISUALSOFT CLIENT ID',
'username' => 'YOUR VISUALSOFT API USERNAME',
'password' => 'YOUR VISUALSOFT API PASSWORD',
'domain' => 'YOUR VISUALSOFT DOMAIN NAME'
];
$vs = new VisualSoft();
$vs->setClient($credentials);This call returns the string Hello World if successful, useful to test your API connectivity.
$vs->helloWorld();Return a list of all orders from a specified date.
$date = new DateTime();
$vs->getOrdersByDate($date);Returns order data for a specified order using the order id.
$order_id = 1;
$vs->getOrderById($order_id);Returns order data for a specified order using the order reference.
$order_ref = 'SO1000';
$vs->getOrderByRef($order_ref);Updates the status of an order.
$order_id = 1;
$status = 'Order Dispatched'
$tracking = 123456; //Order tracking number
$comments = 'Order dispatched'; // Order comment
//the 5th parameter is optional. Defaults to true. When true, VisualSoft will email the customer informing of the update to the order.
$email_customer = false;
$vs->updateOrderStatus($order_id, $status, $tracking, $comments, $email_customer);Returns all orders that have not yet been marked as downloaded.
Pass in true/false to have the new orders automatically marked as Downloaded. Defaults to false.
$order_ref = 'SO1000';
$vs->getNewOrders(true);