Remove products
Use deletePromotionProducts to remove products from an existing promotion.
Request parameters
Parameter
Type / Description
promotionCode
Required (string)
The code corresponding to the promotion that you want to remove products from.
promotionProducts
Required (array of objects)
Array of products to remove from the promotion. Each product object contains the following fields:
promotionProducts.Code
Required (string)
System generated product code.
promotionProducts.PricingConfigurationCode
Required (string)
System generated pricing configuration code.
promotionProducts.PricingOptionCodes
Required (array of strings)
Pricing option codes that you control.
Request sample
<?php
require ('PATH_TO_AUTH');
$promotionCode = 'MY_PROMO_CODE_1';
// Define the first product to remove from the promotion
$newProduct1 = new stdClass;
$newProduct1->Code = '';
$newProduct1->PricingConfigurationCode = '';
$newProduct1->PricingOptionCodes = ['',''];
// Define another product to remove from the promotion
$newProduct2 = new stdClass;
$newProduct2->Code = '';
$newProduct2->PricingOptionCodes = [''];
$productPromotion = [$newProduct1, $newProduct2];
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'deletePromotionProducts',
'params' => array($sessionID, $promotionCode, $productPromotion)
);
var_dump (callRPC($jsonRpcRequest, $host));Response
Parameter
Type / Description
Status
Boolean
True or False.
Last updated
Was this helpful?