Input
Requests to the web service are sent as a string.
Example:
public string BatchFileUpload(string ServiceKey, string File)
Format
A tab-delimited file. Empty fields should be replaced by a blank tab or a default value, where one has been defined.
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:
20000000.2550236530.0483.2.2
Unsuccessful request
If the method call fails, the web service will return an error code:
| Code | Description |
|---|---|
| 100 | Authentication failure. Ensure that the service key in the method call is correct. |
| 102 | Parameter error. One or more of the parameters in the string is incorrect. |
| 200 | General code exception. Please contact Netcash Technical Support. |
Input File Structure
Each file has the following mandatory records:
- H – Header record identifies the upload and passes instructions to the Netcash server.
- K – Key record must follow the header record. It defines the structure of transaction records.
- T – Transaction records follow the key record and must conform to the key structure.
- F – Footer record must be the last record and confirms file completion.
Header record (H)
Every file must contain a header record as the first record in the file.
Record Structure
| Field | Name | Type | Value |
|---|---|---|---|
| 1 | Record Identifier | AN | H |
| 2 | Service Key | AN | Service Key (GUID) |
| 3 | Version | AN | 1 |
| 4 | Instruction | AN | Purpose of the file |
| 5 | Batch name | AN | Your batch identifier |
| 6 | Action date | N | CCYYMMDD |
| 7 | Software vendor key | AN | The Software Vendor Key is issued by Netcash to identify the software origin of transactions. (Only used by Netcash ISVs; otherwise use the default value: 24ade73c-98cf-47b3-99be-cc7b867b3080) |
Example
H C74EXXX5-5499-4663-85FB-2A6XXXXFB9EF 1 Service Batch Name 20100331 24ade73c-98cf-47b3-99be-cc7b867b3080
Key record (K)
- The key record is mandatory and must appear between the header and transaction records.
- It defines the content, order and length of transaction records.
- Lists all possible fields, even if not every record uses them.
- Recommended to list keys in ascending order for easier debugging.
Example
K 101 102 131 132 133 134 135 136 162
Transaction record (T)
- There must be at least one transaction record.
- Transaction records must match the order of fields in the Key record (K).
- Empty fields should be replaced by a blank tab or a default value.
Example
T Acc001 AccName001 1 BankAccountName001 1 470010 0 25000000000 100
Footer record (F)
The footer record indicates that the complete file has been received. It must be the last record in the file.
Structure
| Field | Name | Type | Value |
|---|---|---|---|
| 1 | Record Identifier | AN | F |
| 2 | No of transactions | N | Count of all ‘T’ records |
| 3 | Sum of amounts | N | Sum of amount fields (in cents) |
| 4 | End-of-file indicator | N | 9999 |
Example
F 2 0 9999
Example of Input File
H C74EXXX5-5499-4663-85FB-2A6XXXXFB9EF 1 Service Batch Name 20100331 24ade73c-98cf-47b3-99be-cc7b867b3080 K 101 102 131 132 133 134 135 136 162 T CUS001 A Customer 1 AB Customer 1 632005 0 40600000004 110200 T CUS002 X Customer 1 X Customer 2 198765 0 2060000001 200000 F 2 310200 9999
Example of String File (C#)
StringBuilder file = new StringBuilder();
file.AppendLine("H\tC74EXXX5-5499-4663-85FB-2A6XXXXFB9EF\t1\tService\tBatch Name\t20220805\t24ade73c-98cf-XXXX-XXXX-cc7b867b3080");
file.AppendLine("K\t101\t102\t103\t104\t131\t132\t133\t134\t135\t136\t161\t162\t302");
file.AppendLine("T\tUniqueRef1\tAccountName\t1\t0\t1\tJoe Bloggs\t2\t632005\t0\t9091111334\t10000\t10000\tExtra2");
file.AppendLine("T\tUniqueRef2\tAccountName2\t1\t0\t1\tSam Smith\t1\t250655\t0\t4011111193\t10000\t10000\tExtra2");
file.AppendLine("F\t3\t30000\t9999");
string FileToken = BatchFileUpload("C74EXXX5-5499-4663-85FB-2A6XXXXFB9EF", file.ToString());
Testing
See Testing section for more details. If you require any integration assistance contact our technical support team

