1. Go to this page and download the library: Download vanilo/cloud-sdk 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 VaniloCloud\Enums\ProductState;
use VaniloCloud\WriteModels\ProductCreate;
$api = VaniloCloud\ApiClient::sandbox();
$productCreate = new ProductCreate();
$productCreate
->setName('William Black Bookshelf')
->setSku('WBB-030')
->setState(ProductState::ACTIVE);
$api->createProduct($productCreate);
// "WBB-030"
use VaniloCloud\WriteModels\ProductUpdate;
$api = VaniloCloud\ApiClient::sandbox();
$productUpdate = new ProductUpdate();
$productUpdate
->setName('William Black Bookshelf 030')
->setStock(1337)
->setDescription('A black bookshelf.');
$api->updateProduct('WBB-030', $productUpdate);
// true
use VaniloCloud\Enums\ProductState;
use VaniloCloud\WriteModels\MasterProductCreate;
$api = VaniloCloud\ApiClient::sandbox();
$masterProductCreate = new MasterProductCreate();
$masterProductCreate
->setName('My Master Product');
$api->createMasterProduct($masterProductCreate);
// "1"
use VaniloCloud\WriteModels\MasterProductUpdate;
$api = VaniloCloud\ApiClient::sandbox();
$masterProductUpdate = new MasterProductUpdate();
$masterProductUpdate
->setDescription('This is my Master Product.');
$api->updateMasterProduct(1, $masterProductUpdate);
// true