PHP code example of bittools / bseller-php
1. Go to this page and download the library: Download bittools/bseller-php 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/ */
bittools / bseller-php example snippets
Token = '6A9E013C42EB7152E0536AF3A8C0EDC8';
/** @var \BSeller\Api $api */
$api = new BSeller\Api($authToken);
/** @var \BSeller\Api\EntityInterface\Catalog\Product\Variation $entityInterface */
$entityInterface = $api->productVariations()
->entityInterface();
$entityInterface
->setNome('Cor')
->setId(1)
->addSpecification(1, 'Azul')
->addSpecification(2, 'Amarelo')
->addSpecification(3, 'Vermelho')
->addSpecification(4, 'Rosa')
->addSpecification(5, 'Branco');
$response = $entityInterface->create();
if ($response->success()) {
echo 'SUCCESS!';
}