Add products
Use addPromotionProducts to add products to an existing promotion.
Request parameters
Parameter
Type / Description
sessionID
Required (string) Output of the Login method.
promotionCode
Required (string) The code corresponding to the promotion that you want to add products to.
promotionProducts
Required (object)
promotionProducts.Code
Required (string) System generated product code.
promotionProducts.pricingConfigurationCode
Optional (string) System generated pricing configuration code.
promotionProducts.pricingOptionCodes
Optional (array of strings) Pricing option codes that you control.
Request sample
<?php
require ('PATH_TO_AUTH');
// Define a product to add to the promotion
$newProduct1 = new stdClass;
$newProduct1->Code = '';
$newProduct1->PricingConfigurationCode = '';
$newProduct1->PricingOptionCodes = ['',''];
// Define another product to add to the promotion
$newProduct2 = new stdClass;
$newProduct2->Code = '';
$newProduct2->PricingOptionCodes = [''];
$productPromotion = [$newProduct1, $newProduct2];
try {
$updatedPromotion = $client->addPromotionProducts($promotionCode, $productPromotion);
}
catch (SoapFault $e) {
echo "UpdatedPromotion: " . $e->getMessage();
exit;
}
var_dump("UpdatedPromotion", $updatedPromotion);Response parameters
Parameter
Type
PromotionProducts
Object
Last updated
Was this helpful?