|
Version: 7C
HC7 Build: 7.00.0012 and later
API Build: 1.00.0001 and later
Plan Manager - SellAddOn adds a specified resource to a sold plan. This web service call can be made as http://your-domain.com/HC7API/PlanManager.asmx?op=SellAddOn.
Input Parameters
HostUserName
HostPassword
OwnerName - owner name of sold plan instance
SoldPlanID - unique identification number of sold plan instance to which you want to add the resource
ResourceName - name of resource you want to add
Quantity
OptionalParam
RecurringDiscount - percentage of discount on recurring price
BillingMethod - BillwithPlan/MonthlyBilling
Language
Note : SoldPlanID the unique identification number, can be retrieved using GetSoldPlans.
|
Output Parameters
XML error report in case of Quota Violation embedded in Result Node of Response packet.
Sample Optional Parameters
<Parameters>
<Parameter Name = "RecurringDiscount">5</Parameter>
<Parameter Name = "BillingMethod">BillwithPlan</Parameter>
</Parameters>
Sample SOAP Request
POST /HC7API/PlanManager.asmx HTTP/1.1
Host: your-domain.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/SellAddOn"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SellAddOn xmlns="http://tempuri.org/">
<HostUserName>host</HostUserName>
<HostPassword>host123</HostPassword>
<OwnerName>david</OwnerName>
<SoldPlanID>12</SoldPlanID>
<ResourceName>Domains</ResourceName>
<Quantity>1</Quantity>
<OptionalParam>xml</OptionalParam>
</SellAddOn>
</soap:Body>
</soap:Envelope>
Sample HTTP Request
POST /HC7API/PlanManager.asmx/SellAddOn HTTP/1.1
Host: your-domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HostUserName=host&HostPassword=host123&OwnerName=david&SoldPlanID=12
&ResourceName=Domains&Quantity=1&OptionalParam=xml
Sample C# Code
public PlanManager.Response SellAddOn(string strHostUserName, string strHostPassword, string strOwnerName, int nSoldPlanID, string strResourceName, int nQuantity)
{
try
{
PlanManager.PlanManager oPlan = new PlanManager.PlanManager();
PlanManager.Response oResponse = PlanManager.Response();
XmlDocument oDoc = new XmlDocument();
//Adding root node
XmlNode xOptionalParam = oDoc.CreateNode(XmlNodeType.Element,"Parameters","");
//Adding sub nodes
XmlNode xParameter = oDoc.CreateNode(XmlNodeType.Element,"Parameter","");
XmlAttribute xAttribute = oDoc.CreateAttribute("Name");
xAttribute.Value = "RecurringDiscount";
xParameter.Attributes.Append(xAttribute);
xParameter.InnerText = "5";
xOptionalParam.AppendChild(xParameter);
.......
.......
.......
oResponse = oPlan.SellAddOn(strHostUserName, strHostPassword, strOwnerName, nSoldPlanID,
strResourceName, nQuantity, OptionalParam);
}
catch
{
}
return oResponse;
}
Sample Response
<Response>
<Method>SellAddOn</Method>
<Status>false</Status>
<ErrorCode>70100060</ErrorCode>
<ErrorDescription>
Add-On
cannot be added to plan; you have exceeded the allowed quota for this
resource.
</ErrorDescription>
<Result>
<ResultReport xmlns="">
<ViolatedResources>
<RecordRow>
<ResourceName>Domains</ResourceName>
<DesiredQuantity>1</DesiredQuantity>
<AllocatedQuantity>10</AllocatedQuantity>
<SoldQuantity>10</SoldQuantity>
<RemainingQuantity>0</RemainingQuantity>
</RecordRow>
</ViolatedResources>
</ResultReport>
</Result>
</Response>