Batch

Index

System Purpose

The system enables fully automated billing without the need for user intervention.
It supports the submission of files containing a large number of charge records in batch mode, in order to reduce processing time and minimize the load on the client workstation.

System Description

The system allows users to submit charge record files in the Shva IntIn format.
It supports the use of pre-generated tokens by including the token identifier in Field B of each record.
File uploads and downloads are performed via API. Each submitted file is assigned a unique key (reference ID), which must be used for identifying and tracking the billing process.

The billing is performed asynchronously in the background. Users can monitor the status of the billing process in several ways:

  • By calling a method that returns the billing status based on the reference ID (see details below).
  • By checking the “File Management” page in the Reports System.
  • By receiving a summary email once the file has been fully processed.

Once the billing is complete, the results file can be downloaded in the Shva IntOt format, either via the API or through the “File Management” page in the Reports System. In the Reports System, the results can also be downloaded in CSV format (see field definitions at the end of this document).

Important Notes:

  • The order of records in the output file matches the order in the input file.
  • The Voucher Number field in the output file is not unique and does not indicate the transaction’s position in the Shva transmission file, due to the high volume of transactions that prevents regular sequential numbering. It is recommended to use the X field for transaction identification.

Integration Methods

  • batch_proxy.exe – A command-line wrapper around the client module (DLL). Enables uploading input files, checking processing status, and downloading output files via command-line parameters (parameters are detailed later in the document).
    This option is compatible with most billing systems used by Pelecard customers.
  • batch_client.dll – A Windows integration interface that communicates with Pelecard’s WCF Web Service. Suitable for .NET developers.
  • WCF Web Service (WS) – A secured interface for developers, operating over SSL protocol.
  • BatchClient Service – A service installed on the client’s server or local workstation. It operates by monitoring file folders and routing them according to predefined rules on the server or workstation.
    This is an alternative to using batch_proxy.exe or the WCF Web Service.

batch_proxy.exe

batch_proxy.exe – Usage Details

The batch_proxy.exe module allows integration with the BATCH interface via command line.

Usage Syntax:

batch_proxy.exe action (put/check/get) -parameter (-u, -p…) value …

Uploading a File for Billing

Command Line Parameters:

Parameter Description
put Action type – for uploading a billing file
-u user Username
-p password Password
-t terminal Terminal number
-f path Path to the input file to be uploaded
-s sign Token identifier
[-a path] Service address (optional)
[-m mail] Email address to receive billing summary notification (optional)
[-e] Indicates the file is encoded in UTF-8; no value needed (optional)

Example:

batch_proxy.exe put -t 0962210 -u uuuu -p pppp -m email@server.com -s tk578 -f C:\input.txt

Output:

A string with two comma-separated values:

result_code,request_id

request_id:

  • A 15-character reference number used for tracking the process

result_code Values:

Code Meaning
000 No error
501 User authentication failed
514 Invalid token identifier
507 Terminal not authorized for batch operations

597 – General error, please contact support.

Important Note:

If the file upload fails (i.e., the result code is not 000), the error description will be returned instead of the request id.

Example – Error Response:

597,Error Message

Example – Successful Response:

000,CYWQ66RAT7TMCZ5

  • 000 – Success
  • CYWQ66RAT7TMCZ5 – The unique 15-character request ID used to track the billing process

 

 

Checking Billing Status with batch_proxy.exe

Command Line Parameters:

Parameter Description
check Action type – for checking billing status
-b batchid The request ID (15-character reference)
[-a path] Service address (optional)

Example:

batch_proxy.exe check -b 30XLOFA9LIGTGS5

Output – Billing Status Codes:

Code Meaning
1 Successfully received (file was accepted)
2 Billing is in progress
3 Process completed
6 Aborted due to an error – please contact support
510 Operation does not exist
597,<error description> General error – operation failed with message

Downloading the Output File with batch_proxy.exe

Command Line Parameters:

Parameter Description
get Action type – download output file
-u user Username
-p password Password
-t terminal Terminal number
-b batchid Request ID (from file upload)
-f path Path to save the output file
[-a path] Service address (optional)

Example:

batch_proxy.exe get -t 0962210 -u pppp -p uuuu -b ADIBAFVALGC2YYR -f C:\result.txt

Output Format:

result_code,status

Result Codes:

Code Description
000 No error – file downloaded successfully. Status should be 3.
501 User authentication failed
510 Request ID not found
515 Billing status does not allow file download (status shown in second field)
597,<error message> General error – error string replaces the status field

Status Codes (Second Field):

Status Meaning
1 Successfully received
2 Billing in progress
3 Process completed (file is ready)
6 Aborted due to error – contact support

batch_client.dll

batch_client.dll – .NET Component for Batch API Integration

The batch_client.dll interface exposes three core methods:

  1. UploadFile – Upload a billing input file
  2. GetStatus – Check the status of a billing operation
  3. DownloadFile – Download the result file

UploadFile

				
					string UploadFile(
string terminal,
string user,
string password,
string tsign,
string fileFullPath,
string servicePath,
string mail = "",
bool utf8 = false
)
				
			

Parameters:

Name Type Description
terminal string Terminal number
user string Username
password string Password
tsign string Token identifier (used in Field B of the INTIN format)
fileFullPath string Full path to the file being uploaded
servicePath string Service endpoint URL (optional)
mail string Email address for receiving billing completion notice (optional)
utf8 bool Set to true if the input file uses UTF-8 encoding (optional)

Return Value:

String in format:

result_code,request_id

Result Codes:

Code Meaning
000 Success
501 User authentication failed
514 Invalid token identifier
507 Terminal not authorized for batch operations
597 General error – please contact support

GetStatus

				
					string GetStatus(string requestId, string servicePath)
				
			

Parameters:

Name Type Description
requestId string 15-character request ID from UploadFile
servicePath string Service endpoint URL (optional)

Return Value:

Billing status code:

Code Meaning
1 Successfully received
2 Billing in progress
3 Operation completed
6 Aborted due to error – contact support
510 Operation not found
597,<error> General error with error message

DownloadFile

				
					string DownloadFile(
    string terminal,
    string user,
    string password,
    string requestId,
    string saveAsFullName,
    string servicePath
)
				
			

Parameters:

Name Type Description
terminal string Terminal number
user string Username
password string Password
requestId string Request ID (from UploadFile)
saveAsFullName string Full path for saving the result file
servicePath string Service endpoint URL (optional)

Return Value:

String in format:

result_code,status

Result Codes:

Code Meaning
000 Success – file downloaded. status should be 3
501 User authentication failed
510 Operation ID not found
515 Billing is not yet complete – file cannot be downloaded
597,<error> General error – message replaces the status field

Status Codes:

Status Meaning
1 Successfully received
2 Billing in progress
3 Operation completed
6 Aborted due to error – contact support

WCF Web Service for BATCH API

This section demonstrates how to use Pelecard’s BATCH API via WCF — without a local client DLL.

WSDL Endpoint for Service Reference:

Add a service reference in Visual Studio using the following WSDL:

https://batch.pelecard.biz:334/?singleWsdl

Secure SSL Communication Configuration

<system.serviceModel>

<bindings>

<basicHttpBinding>

<binding name=”netTcpEP”>

<security mode=”Transport”>

<transport clientCredentialType=”None” proxyCredentialType=”None” realm=”” />

</security>

</binding>

</basicHttpBinding>

</bindings>

<client>

<endpoint address=”https://batch.pelecard.biz:334/”

binding=”basicHttpBinding”

bindingConfiguration=”netTcpEP”

contract=”ServiceReference1.IGateWay”

name=”netTcpEP” />

</client>

</system.serviceModel>

⚠ The actual names and parameter classes may vary slightly depending on Visual Studio version and namespace.

Uploading a File

				
					static void UploadFile() {
  GateWayClient GW = new GateWayClient();
  string requestId = "";

  UploadFileParameters parameters = new UploadFileParameters {
    Terminal = "XXXXXXX",   // Terminal number
    UserName = "XXXXXX",    // Username
    Password = "XXXXXX",    // Password
    TokenPrefix = "tk578",  // Token ID used in INTIN, field B
    Utf8 = true             // Optional: true if the file uses UTF-8 encoding
  };

  // Ensure TLS 1.2 is used for secure communication
  System.Net.ServicePointManager.SecurityProtocol =
      System.Net.SecurityProtocolType.Tls12;
  using (FileStream stream = new FileStream(@"C:\pelecard\batch\input1.txt",
                                            FileMode.Open, FileAccess.Read))

  {
    string result = GW.UploadFile(parameters, stream, out requestId);

    Console.WriteLine($"Result: {result}, Request ID: {requestId}");
  }
}
				
			

Checking Billing Status

				
					static void CheckStatus()

{

GateWayClient GW = new GateWayClient();

int status = GW.GetStatus("DJB53XNA2XA6P1K");  // Request ID returned from UploadFile

Console.WriteLine($"Status Code: {status}");

}
				
			

Status Codes:

Code Meaning
1 File received successfully
2 Billing in progress
3 Billing completed
6 Failed due to an error – contact support
510 Request does not exist
597,<message> General error with details

Downloading the Result File

				
					static void DownloadFile()
{
    GateWayClient GW = new GateWayClient();
    string saveAsFullName = @"C:\pelecard\batch\result_examp.txt";

    Stream receiverStream;
    ResultDetails res = GW.DownloadFile(
        "XXXXXX",                   // Terminal
        "ADIBAFVALGC2YYR",          // Request ID
        "XXXXXX",                   // Username
        "XXXXXX",                   // Password
        out receiverStream
    );

    if (res.RequestStatus == 3 &amp;&amp; receiverStream != null) // Billing is complete
    {
        const int bufferLen = 65000;
        byte[] buffer = new byte[bufferLen];
        int count;

        using (MemoryStream memoryStream = new MemoryStream())
        {
            while ((count = receiverStream.Read(buffer, 0, bufferLen)) &gt; 0)
            {
                memoryStream.Write(buffer, 0, count);
            }

            receiverStream.Close();
            receiverStream.Dispose();

            using (FileStream file = new FileStream(saveAsFullName, FileMode.Create, FileAccess.Write))
            {
                memoryStream.WriteTo(file);
            }
        }

        Console.WriteLine("Download completed.");
    }
    else
    {
        Console.WriteLine("File not ready or download failed.");
    }
}
				
			

✅ Summary

Task Method Output
Upload file UploadFile() resultCode, requestId
Check status GetStatus() Status code (1–6, 510, 597)
Download result DownloadFile() Result file written to disk

BatchClient

Automated Batch Billing – Client-Side File Agent

The solution provides automation for sending batch (batch) billing files from the client side.
Input/output file management is similar to the Belclient interface.

Installation

The client must configure two shared folders for file exchange between the billing system and the automation service (called Agent File).
Service parameters and configurations can be managed via the configuration interface:
exe.config_autograbber.

Full Transaction File Workflow:

  1. File Monitoring & Upload
    The service monitors the input folder for new files and automatically sends them to Pelecard for processing.
  2. Status Polling
    The service checks the processing status of the file on Pelecard at a defined interval.
    This interval is configurable in the “General” tab of the settings interface.
    The minimum allowed interval is 60 seconds.
  3. Download & Save Results
    Once processing is complete, the service downloads the result file (Shva IntOt format) and saves it to the output folder.

Additional Notes:

  • Input/output files must be in Shva’s INTIN/INTOT format (Version 96).
  • If a file returns with status 6 (error), the service will stop polling its status and create an empty file in the output folder.
  • The terminal number should appear in field S of the first record in the input file.
    If not present, the system will use the default terminal number defined in the “Station” tab of the settings.
  • The original input file is deleted after it is uploaded to the batch server.
  • If a result file (output) with the same name already exists, it will be overwritten.
  • !!!Each file must contain transactions for only one terminal.
    Do not mix terminals in the same file.
    If multiple terminals are sent, the 1st terminal located in file will process all transactions, even if it was a different S field in the record!!!

CSV

CSV Billing Results – Structure

The billing results can be downloaded in CSV format through Pelecard’s Reports System.

CSV File Fields (in order):

  1. Shva Status,
  2. Voucher Number,
  3. Card Number,
  4. Card Expiry,
  5. Token (submitted),
  6. Clearing Company,
  7. Transaction Type,
  8. Transaction Code,
  9. Authorization Number,
  10. Credit Type,
  11. Currency,
  12. Amount,
  13. Installments,
  14. First Payment Amount,
  15. Recurring Payment Amount,
  16. Stars Discount Amount,
  17. Authorization Source,
  18. Reason for Call,
  19. Card Brand,
  20. Foreign Card Flag,
  21. Issuing Company,
  22. Additional Details (Field X)

Added Link to IntIn-IntOt Guide Below:
IntIn-IntOt