PHP code example of mikkelson / visualsoft-php-soap-api

1. Go to this page and download the library: Download mikkelson/visualsoft-php-soap-api 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/ */

    

mikkelson / visualsoft-php-soap-api example snippets




use Mikkelson\Visualsoft;

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


$vs->helloWorld();

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

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

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

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

$order_ref = 'SO1000';
$vs->getNewOrders(true);

composer