Discount Service

DiscountService is used to manage products. You can add, update and find products in addition to managing follow up sequences, tags and action sets.


DiscountService.addFreeTrial

Adds a Free trial

Required Parameters

Parameter Name Type Definition
name string The name of the free trial
description string The description for free trial
freeTrialDays int The number of days free trial last
hidePrice int The option to show or hide price
subscriptionPlanId int The Id of the subscription

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addFreeTrial</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>freeTrialDays</int></value>
    </param>
    <param>
      <value><int>hidePrice</int></value>
    </param>
    <param>
      <value><int>subscriptionPlanId</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>1</i4></value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addFreeTrial("test", "test description", 5, 0, 1);

DiscountService.getFreeTrial

Returns the options and values of the free trial id passed

Required Parameters

Parameter Name Type Definition
trialId int The Id for free trial

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getFreeTrial</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>trialId</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>freeTrialDays</name>
            <value>9</value>
          </member>
          <member>
            <name>subscriptionPlanId</name>
            <value>5</value>
          </member>
          <member>
            <name>description</name>
            <value>test free trial</value>
          </member>
          <member>
            <name>name</name>
            <value>free</value>
          </member>
          <member>
            <name>hidePrice</name>
            <value>1</value>
          </member>
          <member>
            <name>applyDiscountToCommission</name>
            <value>1</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->getFreeTrial(1);

DiscountService.addOrderTotalDiscount

Adds a order total discount

Required Parameters

Parameter Name Type Definition
name string The name of commission
description string Description for commission
applyDiscountToCommission int Do you want to apply the discount to the commission?
percentOrAmt int Percentage
amt int The amount
payType string This will either be gross or net

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addOrderTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>perentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
    <param>
      <value><string>payType</string></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          3
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addOrderTotalDiscount("test", "test description", 0, 1, 5.00, "Gross");

DiscountService.getOrderTotalDiscount

Adds a order total discount

Required Parameters

Parameter Name Type Definition
id int The Id of the discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getOrderTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              amount
            </name>
            <value>
              5.0
            </value>
          </member>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              discount
            </value>
          </member>
          <member>
            <name>
              pctOrAmt
            </name>
            <value>
              3
            </value>
          </member>
          <member>
            <name>
              payType
            </name>
            <value>
              Gross
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->getOrderTotalDiscount(1);

DiscountService.addCategoryDiscount

Adds a category discount

Required Parameters

Parameter Name Type Definition
name string The category discount name
description string The description of category discount
applyDiscountToCommission int Boolean integer to determine whether or not a discount is applied to commission
amt int The amount of discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          5
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addCategoryDiscount("test", "test description", 0, 5.00);

DiscountService.getCategoryDiscount

Returns the options and values of the category discount id passed

Required Parameters

Parameter Name Type Definition
id int The Id of category discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              cat discount
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->getCategoryDiscount(1);

Assigns a product to a category discount

Required Parameters

Parameter Name Type Definition
id int The Id of category discount
productId int The Id of product

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addCategoryAssignmentToCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          1
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addCategoryAssignmentToCategoryDiscount(1, 2);

Returns the options and values of the category assignment for category discount passed

Required Parameters

Parameter Name Type Definition
id int The Id of category discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getCategoryAssignmentsForCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>
                    id
                  </name>
                  <value>
                    1
                  </value>
                </member>
                <member>
                  <name>
                    specialItemId
                  </name>
                  <value>
                    5
                  </value>
                </member>
                <member>
                  <name>
                    productCategoryId
                  </name>
                  <value>
                    3
                  </value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->getCategoryAssignmentsForCategoryDiscount(1);

DiscountService.addProductTotalDiscount

Add a product total discount

Required Parameters

Parameter Name Type Definition
name string The Id of category discount
description string The Id of category discount
applyDiscountToCommission int The Id of category discount
productId int The Id of category discount
percentOrAmt int The Id of category discount
amt int The Id of category discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addProductTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>percentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          7
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addProductTotalDiscount("test discount", "discount for a product", 0, 3, 3, 5);

DiscountService.getProductTotalDiscount

Returns the options and values of the product total discount id passed

Required Parameters

Parameter Name Type Definition
id string Id of product discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getProductTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              prod discount total
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
          <member>
            <name>
              productId
            </name>
            <value>
              3
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->getProductTotalDiscount(1);

DiscountService.addShippingTotalDiscount

Adds a shipping total discount

Required Parameters

Parameter Name Type Definition
name string Name of shipping discount
description string Description of shipping discount
applyDiscountToCommission int Determines whether or not to apply discount to commission
percentOrAmt int Percent or amount of discount
amt int Amount of discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addShippingTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>percentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          9
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addShippingTotalDiscount("test", "test description", 0, 2, 18.00);

DiscountService.getShippingTotalDiscount

Returns the options and values of the shipping total discount id passed

Required Parameters

Parameter Name Type Definition
id int Id of shipping discount

Sample Request

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getShippingTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              amount
            </name>
            <value>
              1.0
            </value>
          </member>
          <member>
            <name>
              description
            </name>
            <value>
              Test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              shipping discount
            </value>
          </member>
          <member>
            <name>
              pctOrAmt
            </name>
            <value>
              5
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$app->addShippingTotalDiscount(6);