PHP code example of dw / skyhub-client

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

    

dw / skyhub-client example snippets



declare(strict_types=1);

// Considero que já existe um autoloader compatível com a PSR-4 registrado

use DW\SkyHub\SkyHubClient;

$client = new SkyHubClient("[email protected]", "api-key", "account-manager-key");

$data = [
    'sku' => 'foo',
    'name' => 'foo',
    'description' => 'foo',
    'status' => 'enabled',
    'qty' => 0,
    'price' => 99.99,
    'promotional_price' => 0,
    'cost' => 0,
    'weight' => 0,
    'height' => 0,
    'width' => 0,
    'length' => 0,
    'brand' => 'foo',
    'ean' => 'foo',
    'nbm' => 'foo',
    'categories' => [
        0 => [
        'code' => 'foo',
        'name' => 'foo',
        ],
    ],
    'images' => [
        0 => 'http://url.produto.com/img.jpg'
    ],
    'specifications' => [
        0 => [
            'key' => 'foo',
            'value' => 'foo',
        ],
    ],
    'variations' => [
        0 => [
            'sku' => 'foo',
            'qty' => 0,
            'ean' => 'foo',
            'images' => [
                0 => 'http://url.produto.com/img.jpg'
            ],
            'specifications' => [
                0 => [
                    'key' => 'foo',
                    'value' => 'foo',
                ],
            ],
        ],
    ],
    'variation_attributes' => [
        0 => 'foo',
        1 => 'foo',
        2 => 'foo',
    ],
];

$response = $client->product->create($data);

var_dump($response);
composer
php composer.phar test