mt940.tags module¶
The MT940 format is a standard for bank account statements. It is used by many banks in Europe and is based on the SWIFT MT940 format.
The MT940 tags are:
Tag | Description |
---|---|
:13: | Date/Time indication at which the report was created |
:20: | Transaction Reference Number |
:21: | Related Reference Number |
:25: | Account Identification |
:28: | Statement Number |
:34: | The floor limit for debit and credit |
:60F: | Opening Balance |
:60M: | Intermediate Balance |
:60E: | Closing Balance |
:61: | Statement Line |
:62: | Closing Balance |
:62M: | Intermediate Closing Balance |
:62F: | Final Closing Balance |
:64: | Available Balance |
:65: | Forward Available Balance |
:86: | Transaction Information |
:90: | Total number and amount of debit entries |
:NS: | Bank specific Non-swift extensions containing extra information |
Format¶
Sources:
The pattern for the tags use the following syntax:
[] = optional
! = fixed length
a = Text
x = Alphanumeric, seems more like text actually. Can include special
characters (slashes) and whitespace as well as letters and numbers
d = Numeric separated by decimal (usually comma)
c = Code list value
n = Numeric
Bases:
mt940.tags.Tag
Account identification
Pattern: 35x
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.Tag
Balance base
Pattern: 1!a6!n3!a15d
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.Tag
Date/Time indication at which the report was created
Pattern: 6!n4!n1! x4!n
Bases:
mt940.tags.ClosingBalance
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.Tag
Floor limit indicator indicates the minimum value reported for debit and credit amounts
Pattern: :34F:GHSC0,00
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.ClosingBalance
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.Tag
Non-swift extension for MT940 containing extra information. The actual definition is not consistent between banks so the current implementation is a tad limited. Feel free to extend the implementation and create a pull request with a better version :)
It seems this could be anything so we’ll have to be flexible about it.
Pattern: 2!n35x | *x
Bases:
mt940.tags.BalanceBase
Bases:
mt940.tags.Tag
Related reference
Pattern: 16x
Bases:
mt940.tags.Tag
The MT940 Tag 61 provides information about a single transaction that has taken place on the account. Each transaction is identified by a unique transaction reference number (Tag 20) and is described in the Statement Line (Tag 61).
Pattern: 6!n[4!n]2a[1!a]15d1!a3!c23x[//16x]
The fields are:
- value_date: transaction date (YYMMDD)
- entry_date: Optional 4-digit month value and 2-digit day value of the entry date (MMDD)
- funds_code: Optional 1-character code indicating the funds type ( the third character of the currency code if needed)
- amount: 15-digit value of the transaction amount, including commas for decimal separation
- transaction_type: Optional 4-character transaction type identification code starting with a letter followed by alphanumeric characters and spaces
- customer_reference: Optional 16-character customer reference, excluding any bank reference
- bank_reference: Optional 23-character bank reference starting with “//”
- supplementary_details: Optional 34-character supplementary details about the transaction.
The Tag 61 can occur multiple times within an MT940 file, with each occurrence representing a different transaction.
alias of
mt940.models.Transaction
Bases:
mt940.tags.Statement
From: https://www.sepaforcorporates.com/swift-for-corporates
Pattern: 6!n[4!n]2a[1!a]15d1!a3!c16x[//16x] [34x]
But ASN bank puts the IBAN in the customer reference, which is acording to Wikipedia at most 34 characters.
So this is the new pattern:
Pattern: 6!n[4!n]2a[1!a]15d1!a3!c34x[//16x] [34x]
Bases:
mt940.tags.Tag
Statement number / sequence number
Pattern: 5n[/5n]
Bases:
mt940.tags.SumEntries
Bases:
mt940.tags.SumEntries
Bases:
mt940.tags.Tag
Number and Sum of debit Entries
Bases:
object
alias of
mt940.models.Transactions
Bases:
enum.Enum
An enumeration.
Bases:
mt940.tags.Tag
Transaction details
Pattern: 6x65x
alias of
mt940.models.Transaction
Bases:
mt940.tags.Tag
Transaction reference number
Pattern: 16x