|
Version: 7C
HC7 Build: 7.00.0012 and later
API Build: 1.00.0001 and later
Plan Manager - GetSoldPlans retrieves all sold plans sell by a specified user. This web service call can be made as http://your-domain.com/HC7API/PlanManager.asmx?op=GetSoldPlans.
Input Parameters
HostUserName
HostPassword
OwnerName - user name whose sold plans you want to retrieve
OptionalParam
CustomerName - search filter
SoldDuration - sold duration search filter in months
SoldDate - search filter (mm/dd/yyyy)
NextBillingDay - search filter (mm/dd/yyyy)
Language
Output Parameters
SoldPlanID - unique identification number assigned to each sold plan instance
CustomerName - to whom plan was sold
PlanName - name of the plan instance
DateCreated
DueSince - Invoice due date, in case plan is unpaid
NextBillingDay - next invoicing date
Sample Optional Parameters
<Parameters>
<Parameter Name = "CustomerName">john</Parameter>
<Parameter Name = "SoldDuration">3</Parameter>
<Parameter Name = "SoldDate">05/22/2007</Parameter>
<Parameter Name = "NextBillingDay">01/01/2008</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/GetSoldPlans"
<?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>
<GetSoldPlans xmlns="http://tempuri.org/">
<HostUserName>host</HostUserName>
<HostPassword>host123</HostPassword>
<OwnerName>david</OwnerName>
<OptionalParam>xml</OptionalParam>
</GetSoldPlans>
</soap:Body>
</soap:Envelope>
Sample HTTP Request
POST /HC7API/PlanManager.asmx/GetSoldPlans HTTP/1.1
Host: your-domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HostUserName=host&HostPassword=host123&OwnerName=david&OptionalParam=xml
Sample C# Code
public PlanManager.Response GetSoldPlans(string strHostUserName, string strHostPassword, string strOwnerName)
{
try
{
PlanManager.PlanManager oPlan = new PlanManager.PlanManager();
PlanManager.Response oResponse = new 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 = "CustomerName";
xParameter.Attributes.Append(xAttribute);
xParameter.InnerText = "john";
xOptionalParam.AppendChild(xParameter);
.......
.......
.......
oResponse = oPlan.GetSoldPlans(strHostUserName, strHostPassword, strOwnerName,
OptionalParam);
}
catch
{
}
return oResponse;
}
Sample Response
<Response>
<Method>GetSoldPlans</Method>
<Status>true</Status>
<ErrorCode>74900001</ErrorCode>
<ErrorDescription>Operation completed successfully</ErrorDescription>
<Result>
<SoldPlans xmlns="">
<RecordCount>3</RecordCount>
<RecordRow>
<SoldPlanID>12</SoldPlanID>
<CustomerName>john</CustomerName>
<PlanName>MyPlan</PlanName>
<DateCreated>Jun 14, 2007</DateCreated>
<DueSince>Jun 14, 2007</DueSince>
<NextBillingDay>Jul 14, 2007</NextBillingDay>
</RecordRow>
.......
.......
.......
</SoldPlans>
</Result>
</Response>