Skip to main content

Batch processing

Batch processing simply means that once a day you send ePay a file containing all your transactions for the past day, instead of sending the transactions one at a time. When your system is not communicating with ePay all the time, you reduce the pressure on both your own and ePay's systems.

We recommend batch processing if your company completes more than 100 transactions a day.

Please note that batch files concern the processing of transactions. Use the payment window for authorising payments.

Get started

You transmit batch files to ePay through an SFTP connection (SSH File Transfer Protocol). ePay's batch server will process the files. When transmitting files to ePay, connect to the SFTP server using the login information ePay provides.

If you want to use batch processing, please contact ePay as we need to configure your connection manually.

Files and folders

When you connect to the SFTP server, you'll see four folders, which contain all files:

  • Files from the company to ePay are stored in the folder "IN"
  • Files from ePay to the company are stored in the folder "OUT"
  • Files containing syntax error are stored in the folder "ERROR"
  • Files from the "IN" folder that have been processed are stored in the folder "ARCHIVE"

File naming

We recommend that files for ePay are named in the following format: YYYYMMDDHH (year, month, date, hour)

Files from ePay to the company are stored in the OUT folder in the following format: YYYYMMDDHH

Pending files

Transactions that for some reason were not processed are stored in the following format when ePay generates the output file: YYYYMMDDHH_pending

Files are stored as pending if:

  • A transaction is set for capture in the future (the company governs this)
  • The authorisation of an instant capture is set in the future
  • ePay could not process the transaction

A row in this file contains the following information:

InputTypeValuesDescription
OperationIntegerThe operation to be performed on the transaction:
1. Capture (capture amount)
2. Credit (credit amount)
3. Delete (delete transaction)
4. Authorise subscription (authorise payment on a subscription)
5. Delete subscription
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.
TransactionidLongThe unique number to identify the payment. It is returned at authorisation. If operation = 4 or 5, this field is blank.
SubscriptionidLongThe number identifying the subscription. If operation = 1, 2, or 3, this field is blank.
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field.
DateDate20130115
YYYYMMDD
The date when the operation is to be performed. If, for instance, you want to capture the payment on June 21st, 2013, the date is defined 20130621.
info

Please note that you don’t need to take action on the pending file. This is simply information from ePay to the company about transactions to be processed in the future.

Failed transactions

Transactions that couldn’t be processed due to errors in ePay or the acquirer’s system are stored in the following format in the OUT folder: YYYYMMDDHH_error

Please note that an email is sent to the company and ePay's support team when such a file is generated.

A row in this file contains the following information:

InputTypeValuesDescription
OperationIntegerThe operation to be performed on the transaction:
1. Capture (capture amount)
2. Credit (credit amount)
3. Delete (delete transaction)
4. Authorise subscription (authorise payment on a subscription)
5. Delete subscription
MerchantnumberInteger7-10 cifreYour unique merchant number. Find the number on your agreement with the acquirer.
TransactionidLongThe unique number identifying the payment. It is returned at authorisation. If operation = 4 or 5, this field is blank.
SubscriptionidLongThe number identifying the subscription. If operation = 1, 2, or 3, this field is blank.
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field.
ActionCodeString0-9 a-ZThe error code explaining why the transaction was declined.
info

Please note that you have to take manual action on the transactions in this file. The transactions are not processed again. Normal procedure would be to resend the transactions in a new file for ePay.

File content

The files must be defined as CSV (comma separated values) in the format RFC 4180. Find a specification of the format here: http://tools.ietf.org/html/rfc4180

One operation is performed for each row.

Please notice:

  • A file can contain several different operations
  • The separator between each operation (row) is \r\n (0x0a 0x0d)
  • The separator between each field in the row is a semicolon (;)
  • Mandatory fields must be defined
  • Fields that are not mandatory must be left blank if they’re not defined
info

Also note that rows must be dynamic. Since ePay might need to add more fields to each row, you cannot expect a fixed number of columns for each row. This must be dynamic.

The processing of files

ePay processes transactions as they are received. You choose whether you want to receive one daily output file or an output file per input file.

If you receive one output file, you can schedule the generation with us. If you receive an output file per input file, we sent each output file when all rows in the input file are processed.

Files older than 30 days are deleted from the OUT folder

Files in the IN folder are deleted when they’re processed and moved to the ARCHIVE folder. Files in the ARCHIVE folder are deleted after 30 days.

Data types

The following section describes the data that are sent between your system and ePay. For each function/service/operation you can see the input fields, which are the fields you transmit to ePay, and the output fields, which are the fields ePay returns.

You can make five operations on a file:

  1. Capture (capture amount)
  2. Credit (credit amount)
  3. Delete (delete transaction and release amount)
  4. Authorise subscription (authorise a capture on a subscription)
  5. Delete subscription (delete subscription)

Capture

Input

InputTypeValuesDescriptionMandatory
OperationInteger1 (fixed)The operation to be performed on the transaction.Yes
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.Yes
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.Yes
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field. Please note that if this value is 0, the full amount is captured.Yes
GroupStringMax 100 charactersThe group to which the payment is associated.No
CaptureDateDate20130115
YYYYMMDD
If this field is not blank, the payment will be captured on the date specified. The date can be today's date + a maximum of 14 days.No

Output

OutputTypeValuesDescription
OperationInteger1 (fixed)The operation performed on the transaction.
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field. Please note that if the value was 0 in the input file, the full amount is displayed.
Epayresponse / action codeString0 = successIf this value is not 0, you have to find the reason for the rejection of the operation by looking up the error code in the list of error codes in your ePay administration.

Credit

Input

InputTypeValuesDescriptionMandatory
OperationInteger2 (fixed)The operation to be performed on the transaction.Yes
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer (for instance Nets).Yes
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.Yes
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field. Please note that if this value is 0, the full amount is credited.Yes
GroupStringMax 100 charactersThe group to which the payment is associated.No

Output

OutputTypeValuesDescription
OperationInteger2 (fixed)The operation performed on the transaction.
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer (for instance Nets).
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field. Please note that if the value in the input file was 0, the credited amount is displayed here (the full amount).
Epayresponse / action codeString0 = successIf this value is not 0, you have to find the reason for the rejection of the operation by looking up the error code in the list of error codes in your ePay administration.

Delete

Input

InputTypeValuesDescriptionMandatory
OperationInteger3 (fixed)The operation to be performed on the transaction.Yes
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.Yes
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.Yes
GroupStringMax 100 charactersThe group to which the payment is associated.No

Output

OutputTypeValuesDescription
OperationInteger3 (fixed)The operation performed on the transaction.
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.
TransactionidLongThe unique number to identify the payment. It is returned at authorisation.
Epayresponse / action codeString0 = successIf this value is not 0, you have to find the reason for the rejection of the operation by looking up the error code in the list of error codes in your ePay administration.

Authorise subscription

Input

InputTypeValuesDescriptionMandatory
OperationInteger4 (fixed)The operation to be performed on the subscription.Yes
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.Yes
SubscriptionidLongThe number identifying the subscription.Yes
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field. Please note that the amount cannot be 0.Yes
CurrencyString208 = DKK
978 = EUR
840 = USD
The currency of the amount.Yes
InstantcaptureInt0 = false
1 = true
If this = 1, the payment is captured immediately. The default setting is 0, meaning you have to manually capture the payment from your ePay administration, using API, or through batch files.Yes
CaptureDateDate20130115
YYYYMMDD
Unless this field is blank, the payment is captured on the date you define. If Instantcapture = 1, this field is ignored.

The date can be today's date + a maximum of 14 days.
No
GroupStringMax 100 charactersThe group to which the payment is associated.No
DescriptionStringMax 1024 charactersA description of the payment. You can see the description in your ePay administration.No
AddfeeInt0 = false
1 = true
If this field = 1, ePay will calculate the transaction fee and add it to the amount.Yes
OrderidStringA-z 0-9The order ID for the payment. If left blank, the transaction ID is used - otherwise date-time is used.No

Output

OutputTypeValuesDescription
OperationInteger4 (fixed)The operation performed on the subscription.
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.
SubscriptionidLongThe number identifying the subscription.
AmountLongMinor unitsThe amount in minor units. DKK 149.99 must be specified as 14999 in the amount field.
CurrencyString208 = DKK
978 = EUR
840 = USD
The currency of the amount.
TransactionidLongThe transaction ID created at authorisation. If authorisation is declined, the value will be 0.
FeeLongMinor unitsIf the input parameter addfee = 1, the amount will appear in this field. Please note that the output parameter amount does not include the fee.
Epayresponse / action codeString0 = successIf this value is not 0, you have to find the reason for the rejection of the operation by looking up the error code in the list of error codes in your ePay administration.

Delete subscription

Input

InputTypeValuesDescriptionMandatory
OperationInteger5 (fixed)The operation to be performed on the subscription.Yes
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.Yes
SubscriptionidLongThe unique number to identify the subscription.Yes
GroupStringMax 100 charactersThe group to which the payment is associated.No

Output

OutputTypeValuesDescription
OperationInteger5 (fixed)The operation performed on the subscription.
MerchantnumberInteger7-10 digitsYour unique merchant number. Find the number on your agreement with the acquirer.
SubscriptionidLongThe unique number to identify the subscription.
Epayresponse / action codeString0 = successIf this value is not 0, you have to find the reason for the rejection of the operation by looking up the error code in the list of error codes in your ePay administration.

Example

This is a data row for capturing a transaction with the following input fields:

ParameterValue
Operation1
Merchantnumber12345678
Transactionid987654321
Amount2000
Group(blank)

The CSV row will look like this:

1;12345678;987654321;2000;;

If the transaction is approved, the response data will be:

1;12345678;987654321;2000;0;

Testing

It’s easy to test batch processing. You can use your test merchant number to test the interface and access to ePay's SFTP server. The same SFTP account is used for testing and production.

Please notice that your test merchant number must be configured for the SFTP account. Contact ePay to set this up.