GroupHeader interface represents the internal structure of the group header element in SEPA XML files. This interface is typically not used directly by users of the library, as it’s constructed automatically by the createSepaXML() function.
Interface definition
Properties
Message identification. Maximum length is 35 characters. This is automatically set from
SepaData.id.Creation date and time in ISO 8601 format (
YYYY-MM-DDThh:mm:ss). This is automatically generated from SepaData.creationDate.Number of transactions. This is automatically calculated as the total count of all payments across all positions.
Control sum (total amount of all transactions). This is automatically calculated as the sum of all payment amounts, formatted as a decimal string with 2 decimal places.
Batch booking indicator. Only included in PAIN version 2 formats (pain.001.001.02, pain.001.003.02, etc.). Set from
SepaData.batchBooking, defaulting to "true".Initiating party information.
Grouping indicator. Only included in PAIN version 2 formats. Always set to
"MIXD" when present.Usage note
TheGroupHeader interface is exported for TypeScript type checking purposes, but you typically don’t need to construct or manipulate GroupHeader objects directly. The createSepaXML() function automatically builds the group header from your SepaData input.
The group header is constructed internally according to the SEPA XML schema requirements and varies slightly between PAIN format versions:
- Version 2 formats (e.g., pain.001.001.02): Include
BtchBookgandGrpgfields - Version 3 formats (e.g., pain.001.001.03): Omit
BtchBookgandGrpgfields
Example
While you don’t create GroupHeader objects directly, here’s how the data flows:Related
SepaData
Main data structure that provides values for GroupHeader
createSepaXML
Function that constructs the GroupHeader automatically