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   
        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 successful, 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 the 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   
        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 successful, 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   
        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 successful, 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       
    
    

Get List of Customers

        Function   
        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 = "WITHWITHLICENSE" 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   
        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 successful, 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

Stage 2) Processed order, waiting to reconcile bank transfer:

Internal Use- Medium Business Package
Full PAF 1 users

Expires:31 Oct 2011

System fully functional. Order in progress…

Stage 3) Bank transfer reconciled:

Internal Use- Medium Business Package

Full PAF 1 users

Expires:31 Oct 2011

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:

External Use- Small/Medium Business Package

Full PAF 800 credits

Expires:31 Oct 2011

When used, shows the average usage:

External Use- Small/Medium Business Package

Full PAF 798 credits average usage 2.00 per day 356 per six months

Expires:31 Oct 2011

All credit packs expire after 12 months, thus the expiry date is shown.

Do Command

 
        Function   
        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 the testing stage, use this command.

Parameters="RESET123"

Will delete all license information for account 123.

Returns="1All licenses deleted for account 123"

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$ = "RESET" & Me.InpCustomerID.Text & "" MsgBox(CustomerPortal.DoCommand(Parameters, Settings.ResellerAccountID,
Settings.ResellerAccountPassword, ErrorDescription
))