Reseller Portal SOAP Web Service - Manage Customer Accounts functions
The following functions are provided to allow the reseller to create/edit/get postcode software customer account details
Customer Record Structure
The customer record represents the customer record we need to store, to allow us to make the appropriate returns to the royal mail.
Example code |
Public CO_TestAccount As Boolean = False Public CO_DataKey_For_Internal_use As String = ""'DataKey for employees to use Public CO_PostcodeAreas As String = "" ‘A90 Public CO_e_mail_address As String = "" ‘For future use: Public CO_Spare_String1 As String = "" Public CO_Spare_Num1 As Double
|
Important fields are shown in bold
Create Customer
Function CustomerCreate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
CustomerRecord | See Customer record |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
CustomerRecord. CO_ID | To identify customer record in our system This should be stored in your database for future updates |
CustomerRecord. CO_DataKey_For_Internal_use | To allow address queries to server for internal use The Internal or Web key should be stored in your database for address queries |
CustomerRecord. CO_DataKey_For_Web_use | To allow address queries to server for internal use The Internal or Web key should be stored in your database for address queries |
ErrorDescription | Any error that may have occurred |
Please Note:
- Any unused accounts are removed after 1 year
- PLEASE DO NOT create millions of accounts when testing
- Contact us on support@simplypostcode.com, to delete test accounts
- Please set customer field .CO_TestAccount=True for testing, thus we can ignore and delete transactions created under these accounts.
Example code |
Dim CustomerRecord As New CustomerPortal.CustRecord With CustomerRecord ‘You should populate all address fields, as we have to report them back to the Dim ErrorDescription$ = "" If Not CustomerPortal.CustomerCreate(Parameters, CustomerRecord, ‘Data returned which should be stored in your Database |
Update Customer
Function CustomerUpdate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
CustomerRecord | See Customer record |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
ErrorDescription | Any error that may have occurred |
Please Note:
- Update customer record relating to CO_ID in CustomerRecord
Example code |
Dim CustomerRecord As New CustomerPortal.CustRecord With CustomerRecord Dim ErrorDescription$ = "" If Not CustomerPortal.CustomerUpdate(Parameters, CustomerRecord, ‘Data returned which should be stored in your Database |
Get Customer Details
Function CustomerGet(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
CustomerRecord | See Customer record |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
ErrorDescription | Any error that may have occurred |
Example code |
Dim CustomerRecord As New CustomerPortal.CustRecord With CustomerRecord Dim ErrorDescription$ = "" If Not CustomerPortal.CustomerGet(Parameters, CustomerRecord, |
List of Areas
The full address internal use, user license can be restricted to certain postcode areas. CO_PostcodeAreas on the customer record should be populated with a list of the postcode areas before purchase of full address internal use, user licenses.
This list should be a comma delimited list. E.g. PE,SE,
A full address license can be restricted to certain postcode areas:
ASP List for Combo |
<asp:DropDownList ID="DropDownList1" runat="server" DataValueField="Select" Width="164px" style="position: relative"> |
Get Adjacent Postcode Areas
Function GetAdjacentPostcodeAreas(ByVal Parameters$, ByVal AreaList$, ByRef ListOfAdjacentAreas$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Parameters
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
ListOfAdjacentAreas | See example below |
ErrorDescription | Any error that may have occurred |
Example code |
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim ErrorDescription$ = "" Dim InpAreaList$ = Me.InpAreaList.Text If Not CustomerPortal. GetAdjacentPostcodeAreas (Parameters, _ |
Example 1:
For AreaList =”SE”, we get:
Returns:
E (East London), IG (Ilford), DA (Dartford), BR (Bromley), CR (Croydon), SW (London South West)
Example 2:
For AreaList =”SE,DA”, we get:
Returns:
BR (Bromley), TN (Tonbridge), ME (Rochester), E (East London), IG (Ilford), CR (Croydon), SW (London South West)
Get List of Customers
Function CustomerGetList(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
ErrorDescription | Any error that may have occurred |
Example code |
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim Parameters$ = "", AdminDisplay$ = "" Parameters = "<command>WITH</command><criteria>WITHLICENSE</criteria>" Dim ListOfCustomer$ = CustomerPortal.CustomerGetList(Parameters$, _ If ErrorDescription = "" Then |
Account License Information
Function CustomerGetLicenseSummary(ByVal Parameters$, ByRef CustomerDisplay$, ByRef AdminDisplay$, ByRef ExtraInfo$, ByVal CustomerAccountID&, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
CustomerAccountID | Customer Account ID |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns True if success, else error in ErrorDescription$
Name | Description |
---|---|
CustomerDisplay | HTML which lists the current licenses the customer uses |
AdminDisplay | HTML which lists the current licenses the customer uses + A link to a window which shows usage and payment status. This should only be viewed by the reseller |
ExtraInfo | Future use |
ErrorDescription | Any error that may have occurred |
Example code |
Dim SimplyPostCodeLookup As New SimplyPostCode Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim ErrorDescription$ = "" If Not CustomerPortal.CustomerGetLicenseSummary(Parameters, CustomerDisplay$, _ |
Example 1 Internal User Licenses:
If you place an order for internal users then the system immediately allows access to them, but this function will return different answers at various stages of the order process.
Returns:
Stage 1) Order received, waiting for us to process:
System fully functional. Order in progress<br>
Stage 2) Processed order, waiting to reconcile bank transfer:
<b>Internal Use- Medium Business Package</b><br>Full PAF <b>1</b> users<br>
Expires:31 Oct 2011<br>
System fully functional. Order in progress…<br>
Stage 3) Bank transfer reconciled:
<b>Internal Use- Medium Business Package</b><br>
Full PAF <b>1</b> users<br>
Expires:31 Oct 2011<br>
Example 2 Credit Packs:
If you place an order for internal/External Use credit packs then the system immediately allows access to them. When packs are used the system will show the current balance and average usage.
Returns:
Order received:
<b>External Use- Small/Medium Business Package</b><br>
Full PAF <b>800</b> credits<br>
Expires:31 Oct 2011<br>
When used, shows the average usage:
<b>External Use- Small/Medium Business Package</b><br>
Full PAF <b>798</b> credits average usage 2.00 per day 356 per six months<br>
Expires:31 Oct 2011<br>
All credit packs expire after 12 months, thus the expiry date is shown.
Do Command
This allows special commands to be issued to our server.
Function DoCommand(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Parameters
Parameter name | Description |
---|---|
Parameters | Not used. For future use |
ResellerAccountID | This is the account ID of your reseller account |
ResellerAccountPassword | Your reseller account password |
Returns
Returns XML description if sucess, else error in ErrorDescription$
Name | Description |
---|---|
ErrorDescription | Any error that may have occurred |
Command 1: Reset an account
To delete test purchases, during testing stage, use this command.
Parameters="<command>RESET</command><accountID>123</accountID>"
Will delete all license information for account 123.
Returns="<result>1</result><description>All licenses deleted for account 123</description>"
Please note: This will only delete license for accounts marked as test accounts. (CO_TestAccount=TRUE)
Example code |
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim ErrorDescription$ = "" MsgBox(CustomerPortal.DoCommand(Parameters, Settings.ResellerAccountID, |