Header and trailer

Header and trailer fields:

File

A batch file should be enclosed by a File Header and a File Trailer lines.

Header

Field Number Format Required Description

1

Fixed "FH"

(tick)

Record type identifier

2

Variable [A-z0-9]

(tick)

Merchant account name

3

Numeric

(tick)

File submission number

4

Fixed "FH"

(tick)

End-of-record type identifier

Trailer

Field Number Format Required Description

1

Fixed "FT"

(tick)

Record type identifier

2

Variable [A-z0-9]

(tick)

Merchant account name

3

Numeric

(tick)

File submission number

4

Numeric

(tick)

Number of blocks in file

5

Fixed "FT"

(tick)

End-of-record type identifier

Example

FH,TestMerchant,201,FH
...
...
FT,TestMerchant,201,1,FT 

Block

A batch file can contain one or more blocks that are defined by a block header and a block trailer. A block groups a number of line items per currency.

Header

Field Number Format Required Description

1

Fixed "BH"

(tick)

Record type identifier

2

Variable [A-z0-9]+

(tick)

Merchant account name

3

Numeric

(tick)

File submission number

4

Numeric

(tick)

Block number started at 1 and incremented by 1

5

Fixed "BH"

(tick)

End-of-record type identifier

Trailer

Field Number Format Required Description

1

Fixed "BT"

(tick)

Record type identifier

2

Variable [A-z0-9]+

(tick)

Merchant account name

3

Numeric

(tick)

File submission number

4

Numeric

(tick)

Block number same as the one defined in Block Header

5

Numeric

(tick)

Number of lines records in block

6

Numeric

(tick)

Sum of the line item amounts in block

7

[A-Z]{3}

(tick)

The three-character ISO currency code.

8

Fixed "BT"

(tick)

End-of-record type identifier

Example

FH,TestMerchant,201,FH
BH,TestMerchant,201,1,BH
...
BT,TestMerchant,201,1,3,4398,EUR,BT
BH,TestMerchant,201,2,BH
...
BT,TestMerchant,201,2,8,2560,USD,BT
FT,TestMerchant,201,2,FT