Technical Information

NIWS_PARTNER is an asynchronous web service which exposes multiple methods. The method BatchFileUpload allows an external system to submit a batch file of leads to the Netcash system

Once you have built the file, call:

NOTE: A unique Lead Generator Service Key is required to use this service.

niws_partner service uses SOAP 1.2. with WS-* addressing. See example

Input

Requests to the web service are sent as strings

Example

public string BatchFileUpload(string ServiceKey, string File) {
  // initialise client
  NIWS_Partner.NIWS_PartnerClient client =
      new NIWS_Partner.NIWS_PartnerClient();

  // call the BatchFileUpload method equal to a string variable
  // lead generator service key requested by channel manager
  string Request = client.BatchFileUpload(ServiceKey, File);

  // close client after response is received
  client.Close();

  // check response
  switch (Request) {
    case "100":  // Authentication failure
      break;
    case "200":  // General code exception.
      break;
    default:  // successfull
      return Request;
  }

  // use response to call RequestFileUploadReport method
  return Request;
}

 

Output

Successful request

If the method call was successful and the file is being processed, the web service will return a file token which is used to retrieve the load report

Example:  1507296452.20131202

 

Unsuccessful request

If the method call fails, the web service will return an error code:

CodeDescription
100Authentication failure. Ensure that the Lead generator key in the method call is correct
200General code exception. Please contact Netcash Technical Support.

Input File Structure

The file is a tab delimited text file and has the following mandatory records:

H – Header record identifies the upload and passes instructions to the Netcash server to determine the purpose of the file.
K – Key record must follow the header record. The key record describes the transaction records which follow. The format defined in the key record is used to validate the record structure and content.
T – Transaction records follow the key record. The fields in the transaction records must conform to the layout defined in the key.
F – Footer record must be the last record in the file and confirms that the file is complete.

Header record (H)

Every file must contain a header record as the first record in the file.

FieldNameTypeValue
1Record IdentifierANH
2Service KeyANLead Generator Service Key
3VersionAN1
4InstructionANPurpose of the file
5Batch nameANYour identifier
6Action dateNCCYYMMDD
7FillerAN0

Field explanations

FieldExplanation
Record Id“H” – Identifies the record as a header
Service keyLead Generator Service Key
Version“1” – This is the Netcash version of the file specification
InstructionThis is the instruction to the Netcash system. It is used in conjunction with the service key in the previous field to determine what action is taken on receipt of the file.
Registration– Data submitted is for a new Netcash client account
Batch nameUse this field as an identifier of your batch.
Action dateThe date on which the payments are to be made to the beneficiary.
Filler0

Example

H C74EF975-5429-4663-85FB-2A64CA0FB9EF 1 Registration My Test Batch 20100331 0

 

Key Record (K)

  • The key record is mandatory and must appear in the file between the header record and the transaction records.
  • The key defines the content, order and length of the transactions records in the file. It can be likened to the column headings in a spreadsheet.
  • The key lists all the possible fields contained in the subsequent transaction records, even if not every transaction record contains data in all the fields.
  • While the file is customizable, it is recommended that keys are listed in ascending numerical order for ease of debugging and support.

Example

K 101 113 114 121 201 441 524 525 528

 

Transaction Record (T)

  • There must be at least one transaction record in the file.
  • The transaction records must conform to the order of the fields as described in the key record. (In the example above, the account reference (field id 101) is defined as the first field in the record therefore every transaction record MUST have the account reference as the first field or it will fail validation)
  • Every transaction record must have the same number of fields as defined in the key record (K).
  • Empty fields should be replaced by a blank tab or a default value, where one has been defined.
  • Where no default is defined, empty fields are indicated by two consecutive tabs
    (IE: the field delimiters preceding and following the empty field)
  • Where fields are left empty, the Netcash system will assume spaces or zeroes for fields defined in the key record.

Mandatory fields

The more information correctly supplied in the request, the less the client will have to capture on the Netcash account activation web site. This will expedite the process from request to opening the account.

The following fields are mandatory. If these fields are not present and valid, the file will be rejected.

KeyField nameValid criteria
101Account referencemin2, max 22 Alpha-Numeric
113Surnamemin2, max 15 Alpha
114First namemin1, max 10 Alpha
121Trading namemin2, max 25 Alpha-Numeric
201Email addressmin 5 max 50 Alpha-Numeric
Format: {text}@{text}.{text}
Full-stop allowed in text fields.
301Extra fieldmin 5 max 999 Alpha-Numeric
302Extra fieldmin 5 max 50 Alpha-Numeric
303Extra fieldmin 5 max 50 Alpha-Numeric
441Telephone numbermin 10; max12 Numeric
524Notes

ISV name

or

ACC NR: Internal Acc # (ISV Name) eg.ABC123(SOFTWARE-NAME) EMPL BR: (Employee Bracket)eg.350 DEAL: (Promo Name)eg.VIP Premier OTHER:(optional) eg. pep name, cost center, etc.

Triple space-separated.

525Activate nowNumeric
1 = Log active opportunity

Validation of optional fields

  • Any additional data supplied will be validated according to the table in Appendix 1.
  • Only valid data will be inserted into the database.
  • Any fields which fail content validation will not be inserted.
  • Any fields which do not meet the specified minimum length will fail validation.
  • Any fields which exceed the specified maximum length will be truncated.
  • Non-mandatory fields which fail validation will not cause the file to be rejected.

Footer record (F)

The footer record indicates that the complete file has been received. It must be the last record in the file. If the record is not present, the system will fail the file without processing any transaction records.

Structure

FieldNameAlpha/NumericValue
1Record IdentifierANF
2No of transactionsNA count of the transaction records
3Sum of amountsNThe sum of the monetary fields (in cents)
4End-of-file indicatorN9999

Field explanations

FieldExplanation
Record Identifier“F” – Identifies the record as a footer
No of transactionsThis is the count of all the ‘T’ records in the file.
Sum of amountsThis field must contain zero.
End-of-file indicator‘9999’ – Indicates there are no more records.

Example

F 2 0 9999

 

Example of input file

 

H 5881ed99-XXX1-XXXX-XXXX-a103255d145a 1 Registration TestFile 20131202 0
K 101 113 114 121 201 441 301 302 303 524 525
T Test100 Soap Joe Test Co test@test.net 27821234567 Sage OpCo Name 123456789 0000001 1
T Test101 Bloggs Jane Janes Hardware jane@jane.com 27113044000 Extra1 Extra2 Extra3 1
F 2 0 9999

 

Retrieving the Load Report

Postback option

If you have activated the postback option in your Sage partner profile, the load report is automatically posted back to the URL you supplied.

Polling option

If you have not activated the postback option, you will need to request the load report using the file token received from the BatchFileUpload method call.

Using the file token, call:

Requests to the web service are sent as strings.

Example

public string RequestFileUploadReport(string ServiceKey, string FileToken) {
  // initialise client
  NIWS_Partner.NIWS_PartnerClient client =
      new NIWS_Partner.NIWS_PartnerClient();

  // call the RequestFileUploadReport method equal to a string variable
  // the same service key used in the batch upload
  string Request = client.RequestFileUploadReport(ServiceKey, FileToken);

  // close client after response is received
  client.Close();

  // check request
  switch (Request) {
    case "100":  // Authentication failure
      break;
    case "200":  // General code exception
      break;
    case "FILE NOT READY":  // The requested statement has not yet been created.
                            // Retry later
      break;
    case "NO CHANGE":  // No new transactions are available for download
      break;
    default:  // Successful, will contain the Netcash account number registered
              // with us
      break;
  }

  // use response to output to UI
  // service will respond with the result of the file upload
  return Request;
}

 

Output file

File content

For each successful lead in the file, the load report will contain the Netcash account number for the lead. Where errors were detected, the load report will stipulate the line number and the error message

Load report structure:

Load report header (occurs once at the start of each load report)

FieldTypeValue
Record identifierAN8###BEGIN
Batch nameAN{your batch name}
Result of uploadA13SUCCESSFUL / UNSUCCESSFUL / SUCCESSFUL WITH ERRORS
Start time of reportAN8HH:MM

Load report message (occurs multiple times – once per T record in the input file)

FieldTypeValue
Account referenceAN58Acc Ref :{your account reference}
Batch nameANLine :{line in your file where error was found}
Line numberANThe Netcash account number or error message

Load report trailer (occurs once – the last line in the report)

FieldTypeValue
Record identifierAN6###END
End time of reportAN8HH:MM

Errors

The following is a list of the errors which could be returned:

Error messageMeaning
A system error occurred. Please contact Netcash.A fatal error occurred and the file could not be processed
Invalid service key.Lead Generator Service Key could not be authenticated
Service key inactive.Lead Generator Service Key not activated on the Netcash system
Invalid instruction.Instruction should be “Registration”
File structure invalid. Transaction record fields do not match key record fields.Columns supplied in the transaction record(s) do not match the columns specified in the key record
Required key XXX was not provided.A mandatory key was omitted
File structure invalid. Please check header, key or footer records.One or more of the record types H,K or F is not present in the file.
File structure invalid. Please check transaction records.Record type T not found
Transaction field XXX has invalid characters.
Transaction field XXX has an invalid length. Minimum X characters.
Transaction field XXX has an invalid range. Only from {1} to {2} allowed.

Examples:

###BEGIN key record UNSUCCESSFUL 16:03
###ERROR A system error occurred. Please contact Netcash.
###END 16:03

 

 

###BEGIN UNSUCCESSFUL 16:02
Acc Ref :NA Line :2 Required key 101 was not provided
###END 16:02

 

 

###BEGIN My test batch SUCCESSFUL 15:45
Acc Ref : 001 Line :3 51002977916
###END 15:45

 

 

###BEGIN My test batch SUCCESSFUL WITH ERRORS 11:45
Acc Ref : 001 Line :3 51002977916
Acc Ref : 002 Line :4 INVALID EMAIL ADDRESS
###END 11:45

 

 

Appendix 1 Transaction fields

Refer to mandatory fields.

Account reference

KeyNameTypeValue
101Account referenceAN22001 for the first account in the file.
002 for the second account
Etc.

Company contact details

KeyNameTypeValue
203Company web addressAN50The “//:” and “.” symbols are allowed in this field
341Company phone numberN11Include dialing codes EG: 27117822349
min:10, max:12
342Company fax numberN11Include dialing codes EG: 27117822349
min:10, max:12

Company details

KeyNameTypeValue
121Trading nameAN25The name of the business to be checked.
122Registration numberN20The number of a registered business
123Registered nameAN25The name of a registered business
124VAT numberN10The VAT number of a registered business
125Legal entityN11 = Registered company (Pty Ltd)
2 = Close corporation
3 = Section 21 company
4 = Non-profit organisation
5 = Trust
6 = Co-operative
7 = Sole proprietor
8 = Partnership
9 = Educational institution
10 = Unknown
11 = Association
12 = Incorporation

Company physical address

KeyNameTypeValue
321Physical address line 1AN50min:2, max:50
322Physical address line 2AN50min:2, max:50
323Physical address line 3AN50min:2, max:50
324Physical suburbAN50min:2, max:50
325Physical cityAN50min:2, max:50
326Physical postal codeN4Must be 4 digits
327Physical provinceN11 = Western Cape
2 = Gauteng
3 = Eastern Cape
4 = Free State
5 = Kwazulu Natal
6 = Limpopo
7 = Mpumalanga
8 = Northern Cape
9 = North West

Company postal address

KeyNameTypeValue
331Postal address line 1AN50min:2, max:50
332Postal address line 2AN50min:2, max:50
333Postal address line 3AN50min:2, max:50
334Postal suburbAN50min:2, max:50
335Postal cityAN50min:2, max:50
336Postal codeN4Must be 4 digits
337Postal provinceN11 = Western Cape
2 = Gauteng
3 = Eastern Cape
4 = Free State
5 = Kwazulu Natal
6 = Limpopo
7 = Mpumalanga
8 = Northern Cape
9 = North West

Account user details

KeyNameTypeValue
111Id numberN13South African identity number. Must be 13 digits.
113SurnameA15Details to be used for Consumer enquiry
114First nameA10Details to be used for Consumer enquiry
119TitleN11 = Mr
2 = Mrs
3 = Ms
4 = Miss
5 = Dr
6 = Prof
128DesignationA25Director, Member, Trustee, Sole proprietor, etc
129Job descriptionA25Manager, Owner, Bookkeeper, etc.
201Email addressAN50The “@” and “.” symbols are allowed in this field
441Telephone numberN11Include dialing codes EG: 27117822349
min:10, max:12
442Mobile numberN11Include dialing codes EG: 27827822123
min:10, max:12

Bank account details

KeyNameTypeValue
132Bank account holderAN50The name linked to the bank account
133Bank account typeN11 = Current / Checking
2 = Savings
3 = Transmission
134Bank account branchN6The branch code of the homing account. This field MUST be 6 digits. Pre-fill with zeroes if less than 6.
136Bank account numberN11The homing bank account number.

Software vendor information

KeyNameTypeValue
524NotesAN399ISV name, Software serial number, Software account number
Triple space separated.
525Activate nowN1 = Log active opportunity

Read the Lead Status Update File Specification here.

Netcash brand guidelines

Please refer to the Netcash brand guidelines here when using any logos, images, icons, labels, descriptions, and references to Netcash in your software.

Testing

See the Testing section for more details. If you require any integration assistance contact our technical support team

Netcash may provide example/sample/demo ‘code snippets’ and/or external links in this Technical Document. Such are for guidance purposes only and may not function on every developer’s system/s. Netcash disclaims any and all liability for the usage of guidance resources provided -and you as the Developer; must accept full responsibility for the usage of such. While every possible effort has been taken to ensure compatibility across multiple system configurations, the contents of this document cannot be guaranteed to work on all systems, with all operating systems -and/or with all system configuration/s.