mikkelson/visualsoft-php-soap-api

PHP SOAP bindings for the Visualsoft V3 API

1.2.0 2017-12-11 12:34 UTC

This package is not auto-updated.

Last update: 2024-12-20 16:19:46 UTC


README

The purpose of this library is to aid communication with Visualsoft's SOAP API.

This library currently supports version 3 of the Visualsoft WSDL.

Installation

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';

Usage & Setup

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);

Hello World

This call returns the string Hello World if successful, useful to test your API connectivity.

$vs->helloWorld();

Get Orders By Date

Return a list of all orders from a specified date.

$date = new DateTime();
$vs->getOrdersByDate($date);

Get Order By ID

Returns order data for a specified order using the order id.

$order_id = 1;
$vs->getOrderById($order_id);

Get Order By Reference

Returns order data for a specified order using the order reference.

$order_ref = 'SO1000';
$vs->getOrderByRef($order_ref);

Update Order Status

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);

Get New Orders

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);