PHP code example of inkpro / smartweb-api

1. Go to this page and download the library: Download inkpro/smartweb-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/ */

    

inkpro / smartweb-api example snippets


$client = new \inkpro\smartwebapi\Client(["Username"=>"myuser", "Password"=>"mypassword"]);

$client = new \inkpro\smartwebapi\Client(
    ["Username"=>"myuser", "Password"=>"mypassword"],
    "https://customwsdl.url"
);

$products = $client->getAllProducts();

$product = $client->getProduct();

@param object $product Product object, should 

$status = $client->deleteProduct($id);

$categories = $client->getAllCategories();

$category = $client->getCategory($categoryId);

$users = $client->getUsers();

$users = $client->getNewsletterUsers();

$status = $client->unsubscribeNewsletterUser($user);

$user = $client->getUser($id);

$user = $client->getUserByEmail($email);

@param object $user User object, corresponding to smartweb UserCreate schema.
* @see https://api.smart-web.dk/doc/Hosted%20Solution%20API/UserCreate.html
$status = $client->createUser($user);

@param object $order OrderData object, corresponding to smartweb Order_Create schema.
$status = $client->createOrder($order);

$order = $client->getOrder($orderId);

* @param DateTime $start The first date to get orders from.
* @param DateTime $end The last date to get orders from.
* @param array $status The status codes of the orders you want to get.
$orders = $client->getOrders($start, $end, $status);

$orders = $client->getUsersOrders($userId);

* @param $order Order to update.
$status = $client->updateOrderComment($order, $comment);

* @param $order Order to update.
$status = $client->updateOrderStatus($order, $status);

* @param $order Order
* @param int $maturity_interval The amount of days from today's date to set the maturity date for the Invoice (0, 8, 14 or 30 days).
$status = $client->createInvoice($order, $maturity_interval);

$images = $client->getProductImages($productId, $shopId);

$orderLines = $client->getOrderLines($orderId);

$orderLines = $client->getOrderLines($orderId);

* @param OrderLine $order_line Orderline to update. Must have Id property.
$status = $client->updateOrderLineStatus($orderline, $status);

$order = $client->getCustomer($orderId);