For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update coupon

Use the updatePromotionCoupon method to add single or multiple coupons to a promotion.

Updating a promotion with multiple coupons causes any existing single coupon to be removed.

Request parameters

Parameter
Type / Description

promotionCode

Required (string)

The code corresponding to the promotion that you want to update.

promotionCoupon

Required (object)

promotionCoupon.type

Required (string)

Coupon type. Available values:

  • SINGLE (use in conjunction with Code)

  • MULTIPLE (use in conjunction with Codes)

promotionCoupon.Code/Codes

Required (string / array of strings)

Coupon code (for SINGLE) or array of coupon codes (for MULTIPLE).

Request sample

<?php

require ('PATH_TO_AUTH');

// Promotion code corresponding to the promotion you want to add coupons to
$promotionCode = '';

// Define single coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'SINGLE';
$promotionCoupon->Code = 'YOUR_CODE_HERE';

// Define multiple coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'MULTIPLE';
$promotionCoupon->Codes = ['YOUR_CODE_1', 'YOUR_CODE_2'];

try {
    $updatedPromotion = $client->addPromotionCoupon ($sessionID, $promotionCode, $promotionCoupon);
}

catch (SoapFault $e) {
    echo "UpdatedPromotion: " . $e->getMessage();
    exit;
}

var_dump("UpdatedPromotion", $updatedPromotion);

Response parameters

Parameter
Type

promotionCoupon

Object

Last updated

Was this helpful?