DiscountService is used to manage products. You can add, update and find products in addition to managing follow up sequences, tags and action sets.
Adds a Free trial
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 |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><i4>1</i4></value> </param> </params> </methodResponse>
$app->addFreeTrial("test", "test description", 5, 0, 1);
Returns the options and values of the free trial id passed
Parameter Name | Type | Definition |
---|---|---|
trialId | int | The Id for free trial |
<?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>
<?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>
$app->getFreeTrial(1);
Adds a order total discount
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 |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 3 </i4> </value> </param> </params> </methodResponse>
$app->addOrderTotalDiscount("test", "test description", 0, 1, 5.00, "Gross");
Adds a order total discount
Parameter Name | Type | Definition |
---|---|---|
id | int | The Id of the order |
<?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>
<?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>
$app->getOrderTotalDiscount(1);
Adds a category discount
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 |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 5 </i4> </value> </param> </params> </methodResponse>
$app->addCategoryDiscount("test", "test description", 0, 5.00);
Returns the options and values of the category discount id passed
Parameter Name | Type | Definition |
---|---|---|
id | int | The Id of category discount |
<?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>
<?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>
$app->getCategoryDiscount(1);
Assigns a product to a category discount
Parameter Name | Type | Definition |
---|---|---|
id | int | The Id of category discount |
productId | int | The Id of product |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 1 </i4> </value> </param> </params> </methodResponse>
$app->addCategoryAssignmentToCategoryDiscount(1, 2);
Returns the options and values of the category assignment for category discount passed
Parameter Name | Type | Definition |
---|---|---|
id | int | The Id of category discount |
<?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>
<?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>
$app->getCategoryAssignmentsForCategoryDiscount(1);
Add a product total discount
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 |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 7 </i4> </value> </param> </params> </methodResponse>
$app->addProductTotalDiscount("test discount", "discount for a product", 0, 3, 3, 5);
Returns the options and values of the product total discount id passed
Parameter Name | Type | Definition |
---|---|---|
id | string | Id of product discount |
<?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>
<?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>
$app->getProductTotalDiscount(1);
Adds a shipping total discount
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 |
<?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>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 9 </i4> </value> </param> </params> </methodResponse>
$app->addShippingTotalDiscount("test", "test description", 0, 2, 18.00);
Returns the options and values of the shipping total discount id passed
Parameter Name | Type | Definition |
---|---|---|
id | int | Id of shipping discount |
<?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>
<?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>
$app->addShippingTotalDiscount(6);