PHP code example of gadoma / walmart-api-php-client

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

    

gadoma / walmart-api-php-client example snippets


// composer autoload
apiKey = 'yourWalmartApiKey';

//Basic components used by the Services
$httpClient        = new \GuzzleHttp\Client();
$errorHandler      = new \WalmartApiClient\Exception\Handler\ApiExceptionHandler();
$transportService  = new \WalmartApiClient\Http\TransportService($httpClient, $errorHandler, $apiUrl);
$entityFactory     = new \WalmartApiClient\Factory\EntityFactory();
$collectionFactory = new \WalmartApiClient\Factory\CollectionFactory();

//Actual Services you will use for interacting with the API
$productService  = new \WalmartApiClient\Service\ProductService($transportService, $entityFactory, $collectionFactory);
$offerService    = new \WalmartApiClient\Service\OfferService($transportService, $entityFactory, $collectionFactory);
$reviewService   = new \WalmartApiClient\Service\ReviewService($transportService, $entityFactory, $collectionFactory);
$taxonomyService = new \WalmartApiClient\Service\TaxonomyService($transportService, $entityFactory, $collectionFactory);


$apiKey = 'yourWalmartApiKey';
$linkSharePublisherId = 'yourId';

$httpClient        = new \GuzzleHttp\Client();
$errorHandler      = new \WalmartApiClient\Exception\Handler\ApiExceptionHandler();
$transportService  = new \WalmartApiClient\Http\TransportService($httpClient, $errorHandler, $apiUrl, $linkSharePublisherId);

bash
curl -sS https://getcomposer.org/installer | php
javascript
{
    "walmart-api-php-client": "^1.0"
    }
}
bash
php composer.phar install
bash
php composer.phar