PHP code example of rapidwebltd / amazon-mws-config-generator

1. Go to this page and download the library: Download rapidwebltd/amazon-mws-config-generator 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/ */

    

rapidwebltd / amazon-mws-config-generator example snippets


 use RapidWeb\AmazonMwsConfigGenerator\ConfigGenerator;

// Create an Amazon config, setting all variable as necessary
$amazonConfig = new ConfigGenerator;
$amazonConfig->setStoreName('My Shop');
$amazonConfig->setMerchantId('ABC');
$amazonConfig->setMarketplaceId('ABC');
$amazonConfig->setKeyId('ABC');
$amazonConfig->setSecretKey('ABC');
$amazonConfig->setMWSAuthToken('ABC');
$amazonConfig->setAmazonServiceURL('https://mws.amazonservices.com/');
$amazonConfig->setLogPath('/tmp/amazon-log.txt');
$amazonConfig->setMuteLog(false);
$amazonConfig->setConfigPath('/tmp/config/');

// Save out Amazon config to a file
$configPath = $amazonConfig->save();

// Pass in the generated config path to class you wish to use
$amz=new AmazonFeed(null, false, null, $configPath);

// Use as normal...
$amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_");
$amz->setFeedContent($feed);
$amz->submitFeed();
return $amz->getResponse();

// Delete previously generated amazon config (for temporary use)
$amazonConfig->delete();