Features:
Competitive pricing
No set-up Charges
Over 99.99% Availability
Free Trial Software
Free Technical Support
Try before you buy
Local or Internet Data
Reseller Opportunities
    Postcode finder using data supplied by royal mail
Updated Daily

Postcode reseller  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
   'Set to true for Test account. We will ignore any orders
   'Posted to this account, and clear them after a few days
Public CO_ID as long = 0 'This is used to uniquely identify Company record
Public CO_COMPANY As String = "" 'A70 Company Name
Public CO_Contact_Name As String = "" ‘50
Public CO_LINE1 As String = "" ‘A50 We require a Company name and address
Public CO_LINE2 As String = "" ‘A50 As it is required by the Royal Mail
Public CO_LINE3 As String = "" ‘A50
Public CO_TOWN As String = "" ‘50
Public CO_COUNTY As String = "" ‘50
Public CO_POSTCODE As String = "" ‘A12

Public CO_DataKey_For_Internal_use As String = ""'DataKey for employees to use
Public CO_DataKey_For_Web_use As String = "" 'DataKey for Public facing web site
Public CO_COUNTRY As String = "UK"
Public CO_VATNO As String = "" ‘9
Public CO_Phone As String = "" ‘A30
Public CO_Fax As String = "" ‘A30

Public CO_PostcodeAreas As String = "" ‘A90
   'Use comma to seperate each entry (30 max)
   ,be careful else will not work e.g. PE,NE,N

Public CO_e_mail_address As String = ""
   'We need this to allow login, but will not send any e-mails
   'Leave balnk, and system will assign own unique address
Public CO_Password As String = ""'For the account on our online system. Leave blank

‘For future use:
Public CO_Spare_Flag1 As Boolean = False
Public CO_Spare_Flag2 As Boolean = False
Public CO_Spare_Flag3 As Boolean = False

Public CO_Spare_String1 As String = ""
Public CO_Spare_String2 As String = ""
Public CO_Spare_String3 As String = ""
Public CO_Spare_String4 As String = ""
Public CO_Spare_String5 As String = ""

Public CO_Spare_Num1 As Double
Public CO_Spare_Num2 As Double
Public CO_Spare_Num3 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

Warning  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
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal

With CustomerRecord
   .CO_COMPANY = Me.InpCustomerCompany.Text
   .CO_Contact_Name = Me.InpCompanyContact.Text
   .CO_LINE1 = Me.InpCustomerLines1.Text
   .CO_PostcodeAreas = Me.InpCustomerArea.Text
   .CO_TestAccount = True 'Set to true for Test account.
   ‘We will ignore any orders posted to this account, and clear them after a
        few days

   ‘You should populate all address fields, as we have to report them back to the
   ‘Royal Mail
End With

Dim ErrorDescription$ = ""
Dim Parameters$ = "" 'For future use

If Not CustomerPortal.CustomerCreate(Parameters, CustomerRecord,
      Settings.ResellerAccountID, Settings.ResellerAccountPassword,
      ErrorDescription)
Then
   MsgBox("Error returned:" & ErrorDescription)
Else
   MsgBox("Account created")

   ‘Data returned which should be stored in your Database
   Me.InpCustomerID.Text = CustomerRecord.CO_ID
   Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use
   ‘or
   Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use
End If


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

Warning  Please Note:

  • Update customer record relating to CO_ID in CustomerRecord
  Example code

Dim CustomerRecord As New CustomerPortal.CustRecord
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal

With CustomerRecord
  .CO_ID = Me.InpCustomerID.Text 'Account ID to update
  .CO_COMPANY = Me.InpCustomerCompany.Text
  .CO_Contact_Name = Me.InpCompanyContact.Text
  .CO_LINE1 = Me.InpCustomerLines1.Text
  .CO_PostcodeAreas = Me.InpCustomerArea.Text
  ‘You should populate Company name and all address fields, as we have to
  ‘report them back to the Royal Mail
End With

Dim ErrorDescription$ = ""
Dim Parameters$ = ""   'For future use

If Not CustomerPortal.CustomerUpdate(Parameters, CustomerRecord,  
                      Settings.ResellerAccountID,
                      Settings.ResellerAccountPassword,

                      ErrorDescription) Then
  MsgBox("Error returned:" & ErrorDescription)
Else
  MsgBox("Account updated")

  ‘Data returned which should be stored in your Database
  Me.InpCustomerID.Text = CustomerRecord.CO_ID
  Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use
  ‘or
  Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use

  End If

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
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal

With CustomerRecord
   'Get account by ID
   .CO_ID = Me.InpCustomerID.Text
End With

Dim ErrorDescription$ = ""
Dim Parameters$ = ""   'For future use

If Not CustomerPortal.CustomerGet(Parameters, CustomerRecord,
                   Settings.ResellerAccountID, Settings.ResellerAccountPassword,
                   ErrorDescription) Then
   MsgBox("Error returned:" & ErrorDescription)
Else
   With CustomerRecord
      Me.InpInternalDataKey.Text = .CO_DataKey_For_Internal_use
      Me.InpWebDataKey.Text = .CO_DataKey_For_Web_use
      Me.InpCustomerID.Text = .CO_ID
      Me.InpCustomerCompany.Text = .CO_COMPANY
      Me.InpCompanyContact.Text = .CO_Contact_Name
      Me.InpCustomerLines1.Text = .CO_LINE1
      Me.InpCustomerArea.Text = .CO_PostcodeAreas
   End With
End If

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:

Postcode areas

 

  ASP List for Combo

<asp:DropDownList ID="DropDownList1" runat="server" DataValueField="Select" Width="164px" style="position: relative">
<asp:ListItem></asp:ListItem>
<asp:ListItem>AB</asp:ListItem>
<asp:ListItem>AL</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>BA</asp:ListItem>
<asp:ListItem>BB</asp:ListItem>
<asp:ListItem>BD</asp:ListItem>
<asp:ListItem>BH</asp:ListItem>
<asp:ListItem>BL</asp:ListItem>
<asp:ListItem>BN</asp:ListItem>
<asp:ListItem>BR</asp:ListItem>
<asp:ListItem>BS</asp:ListItem>
<asp:ListItem>BT</asp:ListItem>
<asp:ListItem>CA</asp:ListItem>
<asp:ListItem>CB</asp:ListItem>
<asp:ListItem>CF</asp:ListItem>
<asp:ListItem>CH</asp:ListItem>
<asp:ListItem>CM</asp:ListItem>
<asp:ListItem>CO</asp:ListItem>
<asp:ListItem>CR</asp:ListItem>
<asp:ListItem>CT</asp:ListItem>
<asp:ListItem>CV</asp:ListItem>
<asp:ListItem>CW</asp:ListItem>
<asp:ListItem>DA</asp:ListItem>
<asp:ListItem>DD</asp:ListItem>
<asp:ListItem>DE</asp:ListItem>
<asp:ListItem>DG</asp:ListItem>
<asp:ListItem>DH</asp:ListItem>
<asp:ListItem>DL</asp:ListItem>
<asp:ListItem>DN</asp:ListItem>
<asp:ListItem>DT</asp:ListItem>
<asp:ListItem>DY</asp:ListItem>
<asp:ListItem>E</asp:ListItem>
<asp:ListItem>EC</asp:ListItem>
<asp:ListItem>EH</asp:ListItem>
<asp:ListItem>EN</asp:ListItem>
<asp:ListItem>EX</asp:ListItem>
<asp:ListItem>FK</asp:ListItem>
<asp:ListItem>FY</asp:ListItem>
<asp:ListItem>G</asp:ListItem>
<asp:ListItem>GL</asp:ListItem>
<asp:ListItem>GU</asp:ListItem>
<asp:ListItem>GY</asp:ListItem>
<asp:ListItem>HA</asp:ListItem>
<asp:ListItem>HD</asp:ListItem>
<asp:ListItem>HG</asp:ListItem>
<asp:ListItem>HP</asp:ListItem>
<asp:ListItem>HR</asp:ListItem>
<asp:ListItem>HS</asp:ListItem>
<asp:ListItem>HU</asp:ListItem>
<asp:ListItem>HX</asp:ListItem>
<asp:ListItem>IG</asp:ListItem>
<asp:ListItem>IM</asp:ListItem>
<asp:ListItem>IP</asp:ListItem>
<asp:ListItem>IV</asp:ListItem>
<asp:ListItem>JE</asp:ListItem>
<asp:ListItem>KA</asp:ListItem>
<asp:ListItem>KT</asp:ListItem>
<asp:ListItem>KW</asp:ListItem>
<asp:ListItem>KY</asp:ListItem>
<asp:ListItem>L</asp:ListItem>
<asp:ListItem>LA</asp:ListItem>
<asp:ListItem>LD</asp:ListItem>
<asp:ListItem>LE</asp:ListItem>
<asp:ListItem>LL</asp:ListItem>
<asp:ListItem>LN</asp:ListItem>
<asp:ListItem>LS</asp:ListItem>
<asp:ListItem>LU</asp:ListItem>
<asp:ListItem>M</asp:ListItem>
<asp:ListItem>ME</asp:ListItem>
<asp:ListItem>MK</asp:ListItem>
<asp:ListItem>ML</asp:ListItem>
<asp:ListItem>N</asp:ListItem>
<asp:ListItem>NE</asp:ListItem>
<asp:ListItem>NG</asp:ListItem>
<asp:ListItem>NN</asp:ListItem>
<asp:ListItem>NP</asp:ListItem>
<asp:ListItem>NR</asp:ListItem>
<asp:ListItem>NW</asp:ListItem>
<asp:ListItem>OL</asp:ListItem>
<asp:ListItem>OX</asp:ListItem>
<asp:ListItem>PA</asp:ListItem>
<asp:ListItem>PE</asp:ListItem>
<asp:ListItem>PH</asp:ListItem>
<asp:ListItem>PL</asp:ListItem>
<asp:ListItem>PO</asp:ListItem>
<asp:ListItem>PR</asp:ListItem>
<asp:ListItem>RG</asp:ListItem>
<asp:ListItem>RH</asp:ListItem>
<asp:ListItem>RM</asp:ListItem>
<asp:ListItem>S</asp:ListItem>
<asp:ListItem>SA</asp:ListItem>
<asp:ListItem>SE</asp:ListItem>
<asp:ListItem>SG</asp:ListItem>
<asp:ListItem>SK</asp:ListItem>
<asp:ListItem>SL</asp:ListItem>
<asp:ListItem>SM</asp:ListItem>
<asp:ListItem>SN</asp:ListItem>
<asp:ListItem>SO</asp:ListItem>
<asp:ListItem>SP</asp:ListItem>
<asp:ListItem>SR</asp:ListItem>
<asp:ListItem>SS</asp:ListItem>
<asp:ListItem>ST</asp:ListItem>
<asp:ListItem>SW</asp:ListItem>
<asp:ListItem>SY</asp:ListItem>
<asp:ListItem>TA</asp:ListItem>
<asp:ListItem>TD</asp:ListItem>
<asp:ListItem>TF</asp:ListItem>
<asp:ListItem>TN</asp:ListItem>
<asp:ListItem>TQ</asp:ListItem>
<asp:ListItem>TR</asp:ListItem>
<asp:ListItem>TS</asp:ListItem>
<asp:ListItem>TW</asp:ListItem>
<asp:ListItem>UB</asp:ListItem>
<asp:ListItem>WA</asp:ListItem>
<asp:ListItem>WC</asp:ListItem>
<asp:ListItem>WD</asp:ListItem>
<asp:ListItem>WF</asp:ListItem>
<asp:ListItem>WN</asp:ListItem>
<asp:ListItem>WR</asp:ListItem>
<asp:ListItem>WS</asp:ListItem>
<asp:ListItem>WV</asp:ListItem>
<asp:ListItem>YO</asp:ListItem>
<asp:ListItem>ZE</asp:ListItem>
</asp:DropDownList>


Get Adjacent Postcode Areas


Function GetAdjacentPostcodeAreas(ByVal Parameters$, ByVal AreaList$, ByRef ListOfAdjacentAreas$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean

Parameters

Parameter name Description
Parameters Not used. For future use
AreaList A single Postcode Area. Or a comma separated list of Postcode areas. See List of Areas
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
ListOfAdjacentAreas See example below
ErrorDescription Any error that may have occurred
  Example code

Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal

Dim ErrorDescription$ = ""
Dim Parameters$ = ""   'For future use

Dim InpAreaList$ = Me.InpAreaList.Text
Dim ListOfAdjacentAreas$ = ""

If Not CustomerPortal. GetAdjacentPostcodeAreas (Parameters, _
                        InpAreaList, ListOfAdjacentAreas, _
                        ResellerAccountID, _
                        ResellerAccountPassword, ErrorDescription) Then
   MsgBox("Error returned:" & ErrorDescription)
Else
   Me.InpResult.Text = "Other adjacent postcode areas are: " & vbCrLf &
          ListOfAdjacentAreas

  End If

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$ = ""
Dim ErrorDescription$ = ""

Parameters = "<command>WITH</command><criteria>WITHLICENSE</criteria>"

Dim ListOfCustomer$ = CustomerPortal.CustomerGetList(Parameters$, _
            Settings.ResellerAccountID, Settings.ResellerAccountPassword, _
            ErrorDescription)

If ErrorDescription = "" Then
   MsgBox("Customers:" & ListOfCustomer$)
Else
   MsgBox("Error returned:" & ErrorDescription)
End If


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 CustomerDisplay$ = "", AdminDisplay$ = ""

Dim ErrorDescription$ = ""
Dim Parameters$ = ""   'For future use
Dim CustomerAccountID& = Me.InpCustomerID.Text
Dim ExtraInfo$ = ""  ''This may be used in future to return extra data, and can be ignored

If Not CustomerPortal.CustomerGetLicenseSummary(Parameters, CustomerDisplay$, _
                     AdminDisplay$, ExtraInfo$, CustomerAccountID, _
                     Settings.ResellerAccountID, _
                     Settings.ResellerAccountPassword, _

                     ErrorDescription) Then
   MsgBox("Error returned:" & ErrorDescription)
Else
   MsgBox("Customer Licenses which can be displayed to customer:" & vbCrLf &
                     CustomerDisplay)

  End If

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>"

Warning  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$ = ""
Dim Parameters$ = "<command>RESET</command><accountID>" & Me.InpCustomerID.Text & "</accountID>"

MsgBox(CustomerPortal.DoCommand(Parameters, Settings.ResellerAccountID,
Settings.ResellerAccountPassword, ErrorDescription
))