Skip to main content

Remove products from a promotion

Remove products from a promotion

Last updated: 29-Sep-2021
Rate this article:


Use deletePromotionProducts via SOAP API 4.0 to remove products from an existing promotion.


Parameter Type/Description


Required (string)


Output of the Login method.


Required (string)


The code corresponding to the promotion that you want to remove products from.


Required (object)



Required (string)



System generated product code.



Required (string)



System generated pricing configuration code.



Required (array of strings)



Pricing option codes that you control.


Parameter Type/Description
status Boolean
  True or False



class Client
    protected static $merchantCode;
    protected static $loginDate;
    protected static $hash;
    protected static $baseUrl;
    protected static $callCount = 0;
    protected static $sessionId = '';

    protected static $client;

    public static function setCredentials($code, $key)
        static::$merchantCode = $code;
        static::$loginDate = gmdate('Y-m-d H:i:s');
        static::$hash = hash_hmac('md5', strlen($code) . $code . strlen(static::$loginDate) . static::$loginDate, $key);
        static::$sessionId = static::login();

    public static function setBaseUrl($url)
        static::$baseUrl = $url;

    public static function login()
        $client = static::getClient();
        return $client->login(static::$merchantCode, static::$loginDate, static::$hash);

    public static function __callStatic($name, $arguments = array())
        $client = static::getClient();

        array_unshift($arguments, static::$sessionId);
        $response = call_user_func_array(array($client, $name), $arguments);

        return $response;

    protected static function getClient()
        $opts = array(
            'http'=> ['user_agent' => 'PHPSoapClient'],
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false,

        if (null === static::$client) {
            static::$client = new \SoapClient(static::$baseUrl . '?wsdl', [
                'location' => static::$baseUrl,
                'cache_wsdl' => WSDL_CACHE_NONE,
                'stream_context' => stream_context_create($opts),

        return static::$client;

Client::setCredentials('YOUR_MERCHANT_CODE', 'YOUR_SECRET_KEY');

// Define first product to remove from proomotion
$products1 = new stdClass;
$products1->Code = 'YOUR_PRODUCT_CODE';
$products1->PricingConfigurationCode = 'YOUR_PRICING_CONFIGURATION_CODE';
$products1->PricingOptionCodes = ['code1','code2','code3'];

// Define second product to remove from promotion
$products2 = new stdClass;
$products2->Code = 'YOUR_PRODUCT_CODE2';
$products2->PricingConfigurationCode = 'YOUR_PRICING_CONFIGURATION_CODE2';

$promotionProducts = [$products1, products2]; // array of product objects to be removed from the promotion

// Retrieve promotion details
$promotionCode = 'YOUR_PROMOTION_CODE'; // code of the promotion that you want to remove products from
$response = Client::deletePromotionProducts ($promotionCode,$promotionProducts);


Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo