Outgoing Payment Field Mapping

ISO20022 pain.001.001.03 - Customer Credit Transfer Initiation

This document defines the mapping between ProBill database fields and ISO20022 XML structure for outgoing payments (utbetalningar).


1. GROUP HEADER (GrpHdr) - File Level


ProBill SourceISO20022 XML PathRequiredData TypeNotes
@FileID parameterGrpHdr/MsgId REQUIREDString(35)Unique message identifier for the file
SYSDATETIME()GrpHdr/CreDtTm REQUIREDDateTimeISO8601 format: YYYY-MM-DDTHH:MM:SS
COUNT all transactionsGrpHdr/NbOfTxs REQUIREDIntegerTotal number of payment transactions in file
SUM(Amount) all transactionsGrpHdr/CtrlSum REQUIREDDecimalTotal of all transaction amounts (control sum)
Swedbank: \
PaymentAccount.SwedbankAgreementID \
\
Nordea: \
PaymentAccount.NordeaSignerID
GrpHdr/InitgPty/Id/OrgId/Othr/Id REQUIREDString(35)Bank-specific initiating party identifier
Swedbank: 'BANK' \
Nordea: 'CUST'
GrpHdr/InitgPty/Id/OrgId/Othr/SchmeNm/Cd REQUIREDString(4)Identification scheme code

2. PAYMENT INFORMATION (PmtInf) - Batch Level


ProBill SourceISO20022 XML PathRequiredData TypeNotes
@FileID parameterPmtInf/PmtInfId REQUIREDString(35)Payment information identifier
Based on PayoutTypeID: \
• 'TRF' = Transfers (1,3,4) \
• 'CHK' = Money orders (2)
PmtInf/PmtMtd REQUIREDString(3)Payment method code
COUNT in batchPmtInf/NbOfTxs REQUIREDIntegerNumber of transactions in this payment batch
SUM(Amount) in batchPmtInf/CtrlSum REQUIREDDecimalControl sum for this payment batch
Literal: 'NORM'PmtInf/PmtTpInf/InstrPrty REQUIREDString(4)Instruction priority (Normal)
Literal: 'MPNS'PmtInf/PmtTpInf/SvcLvl/Prtry REQUIREDString(35)Proprietary service level (mandatory for BG/PG)
Literal: 'SUPP'PmtInf/PmtTpInf/CtgyPurp/Cd REQUIREDString(4)Category purpose code (Supplier payment)
CONVERT(VARCHAR(12), SYSDATETIME(), 23)PmtInf/ReqdExctnDt REQUIREDDateRequested execution date: YYYY-MM-DD
PaymentAccount.CustomerNumberPmtInf/Dbtr/Nm REQUIREDString(140)Debtor name (company/organization name)
Literal: 'SE'PmtInf/Dbtr/PstlAdr/Ctry REQUIREDString(2)Debtor country code (ISO 3166-1 alpha-2)
Nordea: \
PaymentAccount.NordeaOrgID \
Fallback: \
PaymentAccount.PayoutOrgID
PmtInf/Dbtr/Id/OrgId/Othr/Id REQUIREDString(35)Debtor organization number
Literal: 'BANK'PmtInf/Dbtr/Id/OrgId/Othr/SchmeNm/Cd REQUIREDString(4)Organization ID scheme code
REPLACE(PaymentAccount.IBAN, ' ', '')PmtInf/DbtrAcct/Id/IBAN CONDITIONALString(34)REQUIRED if using IBAN \
Mutually exclusive with Othr/Id
Swedbank: \
REPLACE(PaymentAccount.OutBankgiroNumber, '-', '') \
Nordea/Others: \
REPLACE(PaymentAccount.OutPlusgiroNumber, '-', '')
PmtInf/DbtrAcct/Id/Othr/Id CONDITIONALString(34)REQUIRED if not using IBAN \
Account number (cleaned)
'BBAN' (if not BG)PmtInf/DbtrAcct/Id/Othr/SchmeNm/Cd CONDITIONALString(4)When using Othr/Id with BBAN format
'BGNR' (if Bankgiro)PmtInf/DbtrAcct/Id/Othr/SchmeNm/Prtry CONDITIONALString(35)When using Bankgiro as debtor account
Currency.ExternalID \
Default: 'SEK'
PmtInf/DbtrAcct/Ccy REQUIREDString(3)Debtor account currency (ISO 4217)
PaymentAccount.BICPmtInf/DbtrAgt/FinInstnId/BIC REQUIREDString(11)Bank Identifier Code (SWIFT)
Literal: 'SE'PmtInf/DbtrAgt/FinInstnId/PstlAdr/Ctry REQUIREDString(2)Bank country code

3. CREDIT TRANSFER TRANSACTION (CdtTrfTxInf) - Per Payment

3.1 Payment Identification & Amount


ProBill SourceISO20022 XML PathRequiredData TypeNotes
LedgerPayout.IDCdtTrfTxInf/PmtId/EndToEndId REQUIREDString(35)Unique transaction identifier for tracking
Currency.ExternalIDCdtTrfTxInf/Amt/InstdAmt/@Ccy REQUIREDString(3)Currency attribute (e.g., "SEK", "EUR")
ISNULL(LedgerPayout.CurrencyAmount, LedgerPayout.Amount)CdtTrfTxInf/Amt/InstdAmt REQUIREDDecimal(18,2)Instructed amount (use CurrencyAmount if foreign currency)

3.2 Creditor Agent (Recipient Bank)


ProBill SourceISO20022 XML PathRequiredData TypeNotes
Based on PayoutTypeID: \
• 'SESBA' if PG/BG/Bank with clearing
CdtTrfTxInf/CdtrAgt/FinInstnId/ClrSysMmbId/ClrSysId/Cd CONDITIONALString(5)Swedish Banking Association clearing system
Based on PayoutTypeID: \
• '9900' = Bankgiro (4) \
• '9960' = Plusgiro (3) \
• 4-digit = Bank clearing (1) \
• NULL = Money order (2)
CdtTrfTxInf/CdtrAgt/FinInstnId/ClrSysMmbId/MmbId CONDITIONALString(35)Clearing member ID \
Extracted via FnPrGetClearingsNrFromAccountNr()

3.3 Creditor (Recipient)


ProBill SourceISO20022 XML PathRequiredData TypeNotes
{{COALESCE( \
CustomerContactInformation.Name, \
Customer.DispName1 \
)}}
CdtTrfTxInf/Cdtr/Nm REQUIREDString(140)Creditor/recipient name
{{ISNULL( \
CustomerContactInformation.Address, \
Customer.DispAddress \
)}}
CdtTrfTxInf/Cdtr/PstlAdr/StrtNm CONDITIONALString(70)REQUIRED for money orders (TypeID=2 only)
{{REPLACE( \
ISNULL( \
CustomerContactInformation.Zipcode, \
Customer.Zipcode \
), ' ', '' \
)}}
CdtTrfTxInf/Cdtr/PstlAdr/PstCd CONDITIONALString(16)REQUIRED for money orders (TypeID=2 only) \
Spaces removed
{{ISNULL( \
CustomerContactInformation.City, \
Customer.City \
)}}
CdtTrfTxInf/Cdtr/PstlAdr/TwnNm CONDITIONALString(35)REQUIRED for money orders (TypeID=2 only)
{{COALESCE( \
Country.IsoCode, \
'SE' \
)}}
CdtTrfTxInf/Cdtr/PstlAdr/Ctry REQUIREDString(2)Creditor country code

3.4 Creditor Account (Recipient Account)


ProBill SourceISO20022 XML PathRequiredData TypeNotes
Money order (TypeID=2): \
Literal: 'NOTPROVIDED' \
\
Others: \
{{FnPrCleanPayoutAccountNumber( \
COALESCE( \
BillLocation.PayoutAccount, \
Customer.PayoutAccount, \
LedgerPayout.AccountNumber \
) \
)}}
CdtTrfTxInf/CdtrAcct/Id/Othr/Id REQUIREDString(34)Recipient account number \
Cleaned of dashes, spaces, special chars \
Money orders use literal 'NOTPROVIDED'
'BBAN' if Bank (1) or PG (3)CdtTrfTxInf/CdtrAcct/Id/Othr/SchmeNm/Cd CONDITIONALString(4)Account scheme code for BBAN format
'BGNR' if Bankgiro (4)CdtTrfTxInf/CdtrAcct/Id/Othr/SchmeNm/Prtry CONDITIONALString(35)Proprietary scheme for Bankgiro

3.5 Remittance Information (Payment Reference)

Structured Remittance (for Plusgiro/Bankgiro)


ProBill SourceISO20022 XML PathRequiredData TypeNotes
Swedbank: \
'CINV' (if invoice exists) \
\
Nordea: \
'SCOR' (if invoice exists)
Swedbank: \
CdtTrfTxInf/RmtInf/Strd/RfrdDocInf/Tp/CdOrPrtry/Cd \
\
Nordea: \
CdtTrfTxInf/RmtInf/Strd/CdtrRefInf/Tp/CdOrPrtry/Cd
OPTIONALString(4)Document type code (if invoice reference provided)
{{COALESCE( \
CAST(Invoice.InvoiceNumber AS VARCHAR(100)), \
CAST(Invoice2.InvoiceNumber AS VARCHAR(100)), \
CAST(Payment.ReferenceID AS VARCHAR(100)) \
)}}
Swedbank: \
CdtTrfTxInf/RmtInf/Strd/RfrdDocInf/Nb \
\
Nordea: \
CdtTrfTxInf/RmtInf/Strd/CdtrRefInf/Ref
OPTIONALString(25/35)Invoice/reference number \
Swedbank: max 25 chars \
Nordea: max 35 chars
Currency.ExternalIDCdtTrfTxInf/RmtInf/Strd/RfrdDocAmt/RmtdAmt/@Ccy OPTIONALString(3)Currency attribute for remitted amount
{{ISNULL( \
LedgerPayout.CurrencyAmount, \
LedgerPayout.Amount \
)}}
CdtTrfTxInf/RmtInf/Strd/RfrdDocAmt/RmtdAmt OPTIONALDecimal(18,2)Remitted document amount

Unstructured Remittance (for Bank accounts)


ProBill SourceISO20022 XML PathRequiredData TypeNotes
{{COALESCE( \
CAST(Invoice.InvoiceNumber AS VARCHAR(100)), \
CAST(Invoice2.InvoiceNumber AS VARCHAR(100)), \
CAST(Payment.ReferenceID AS VARCHAR(100)) \
)}}
CdtTrfTxInf/RmtInf/Ustrd OPTIONALString(140)Unstructured remittance information \
Shown only for bank account transfers

4. PayoutTypeID Logic & Account Format Rules

Payment Type Mapping


TypeIDSwedish NameDescriptionAccount FormatSpecial Rules
1KontoinsättningBank Account TransferClearing (4 digits) + Account number• Requires valid clearing number \
• CdtrAgt/ClrSysMmbId required \
• SchmeNm: 'BBAN'
2KontantutbetalningMoney Order / CheckLiteral: 'NOTPROVIDED'REQUIRES full postal address \
• PmtMtd: 'CHK' \
• No account number needed \
Swedbank: Separate PmtInf segment
3PlusgiroinsättningPlusgiro TransferPlusgiro number (no dashes)• ClrSysMmbId: '9960' \
• SchmeNm: 'BBAN' \
• Structured remittance supported
4BankgiroinsättningBankgiro TransferBankgiro number (no dashes)• ClrSysMmbId: '9900' \
• SchmeNm/Prtry: 'BGNR' \
• Structured remittance supported
5AutogiroDirect Debit (AG)N/AHandled separately \
• Uses spPrExpDirectDebitPayout \
• Not included in pain.001 file

Account Number Cleaning Function

-- FnPrCleanPayoutAccountNumber removes:
• Dashes (-)
• Spaces ( )
• Slashes (/, \)
• Dots (.)
• Special characters

Result: Pure numeric string for Swedish accounts

Clearing Number Extraction

-- FnPrGetClearingsNrFromAccountNr extracts:
For Bank Accounts (TypeID=1):
  • First 4 digits of account number
  • Used in CdtrAgt/FinInstnId/ClrSysMmbId/MmbId

For Plusgiro (TypeID=3):
  • Returns fixed value: '9960'

For Bankgiro (TypeID=4):
  • Returns fixed value: '9900'

For Money Orders (TypeID=2):
  • Returns NULL (not applicable)

5. Bank-Specific Variations

Swedbank Implementation

Key Differences:

Required Configuration:

PaymentAccount.SwedbankAgreementID  -- NOT NULL
PaymentAccount.OutBankgiroNumber    -- NOT NULL
PaymentAccount.BIC                  -- NOT NULL
PaymentAccount.PayoutOrgID          -- NOT NULL

Nordea Implementation

Key Differences:

Required Configuration:

PaymentAccount.NordeaSignerID       -- NOT NULL
PaymentAccount.NordeaSenderID       -- NOT NULL (if using secure envelope)
PaymentAccount.BIC                  -- NOT NULL
PaymentAccount.IBAN                 -- Preferred, or fallback to PG/BG
PaymentAccount.NordeaOrgID          -- Preferred, or fallback to PayoutOrgID

6. Validation Rules & Business Logic

Amount Validation

✓ Amount must be > 0
✓ Use CurrencyAmount if LedgerPayout.CurrencyID is set
✓ CtrlSum must match SUM of all transaction amounts
✓ NbOfTxs must match COUNT of all transactions

Date Handling

• ReqdExctnDt calculated with weekend adjustment:
  - Friday → Monday (+3 days)
  - Saturday → Monday (+2 days)
  - Sunday → Monday (+1 day)
  - Weekday → Next day (+N days based on AppSetting 'PayoutPlacementDateDays')

Account Number Rules

Swedish Format Requirements:
• Bank: 4-digit clearing + 7-12 digit account
• Plusgiro: 1-8 digits (may include control digit)
• Bankgiro: 7-8 digits (format: XXXX-XXXX)
• All cleaned before export (no formatting chars)

Currency Handling

Domestic (SEK):
  • CurrencyID = 4 (or NULL defaults to SEK)
  • Amount field used directly
  • Currency/@Ccy = 'SEK'

Foreign Currency:
  • CurrencyID set to non-SEK currency
  • CurrencyAmount must be populated
  • Use CurrencyAmount for Amt/InstdAmt
  • Currency/@Ccy = Currency.ExternalID (e.g., 'EUR', 'USD')

Address Requirements for Money Orders

All three fields REQUIRED when PayoutTypeID = 2:
  ✓ Cdtr/PstlAdr/StrtNm   (Street address)
  ✓ Cdtr/PstlAdr/PstCd    (Postal code, no spaces)
  ✓ Cdtr/PstlAdr/TwnNm    (Town/city name)

Missing any field → Payment rejected/error logged

Reference Number Rules

Structured Remittance (PG/BG):
  • Swedbank: Max 25 characters in RfrdDocInf/Nb
  • Nordea: Max 35 characters in CdtrRefInf/Ref
  • Used for invoice numbers or payment references

Unstructured Remittance (Bank accounts):
  • Max 140 characters in Ustrd
  • Typically shows first 12 chars in practice
  • Used when PayoutTypeID NOT IN (3, 4)

7. Error Handling & Status Tracking

LedgerPayout Status Flow

StatusID = 0  →  Ej behandlad (Not processed)
           ↓
StatusID = 1  →  Utbetalning skickad (Payment sent to bank)
           ↓
StatusID = 2  →  Utbetalning utförd (Payment completed)
OR
StatusID = 3  →  Utbetalning nekad (Payment rejected)

Validation Failures

When validation fails, payment is removed from batch and logged:

• ErrorData field populated with error description
• StatusID remains 0 (not processed)
• PrSys.ExtUpdate notified for client refresh
• Examples:
  - "Utbetalningstyp och Konto, utbetalning ej komplett uppsatt"
  - "Ingen BIC i PaymentAccount"
  - "Inget PlusGiro, BankGiro eller IBAN i PaymentAccount"

File Generation Tracking

LedgerPayout.FileID = @FileID  →  Links payment to export file
LedgerPayout.Handled = GETDATE()  →  Timestamp of export
LedgerEvent.StatusID updated based on PayoutAwaitResponse setting

8. Database Tables & Relationships

Primary Tables

LedgerPayout (Main payout record)

ID              INT             -- Used as EndToEndId in XML
LedgerEventID   INT             -- Link to accounting event
BillLocationID  INT             -- Link to billing location
CustomerID      INT             -- Link to customer
Amount          NUMERIC(18,2)   -- Base amount (SEK)
CurrencyAmount  NUMERIC(18,2)   -- Foreign currency amount
CurrencyID      SMALLINT        -- Foreign currency ID
TypeID          INT             -- PayoutTypeID (1-5)
StatusID        INT             -- Processing status
AccountNumber   NVARCHAR(40)    -- Recipient account
Name/CareOf/Address/Zipcode/City  -- Recipient address info
FileID          INT             -- Export file reference
TransactionDate DATE            -- Transaction/placement date

PaymentAccount (Sender configuration)

ID                      INT
CustomerNumber          NVARCHAR(80)    -- Company name (Dbtr/Nm)
BIC                     VARCHAR(11)     -- Bank BIC
IBAN                    VARCHAR(34)     -- Debtor IBAN
OutPlusgiroNumber       VARCHAR(20)     -- Outgoing Plusgiro
OutBankgiroNumber       VARCHAR(50)     -- Outgoing Bankgiro (NEW)
PayoutOrgID             VARCHAR(20)     -- Organization number
NordeaOrgID             VARCHAR(36)     -- Nordea org ID
NordeaSignerID          VARCHAR(50)     -- Nordea signer
NordeaSenderID          VARCHAR(50)     -- Nordea sender
SwedbankAgreementID     VARCHAR(35)     -- Swedbank agreement
CompanyGroupID          INT             -- Links to Company.GroupID

Customer / BillLocation (Recipient info)

-- Recipient details hierarchy:
1. CustomerContactInformation (ContactInformationTypeID=3)
   - Name, Address, Zipcode, City
2. Customer (fallback)
   - DispName1, DispAddress, Zipcode, City
3. BillLocation (account override)
   - PayoutAccount, PayoutTypeID

Key Relationships

LedgerPayout
  ├─> LedgerEvent (accounting)
  ├─> BillLocation (PayoutAccount override, PayoutTypeID)
  ├─> Customer (recipient info, PayoutAccount, PayoutTypeID)
  ├─> Currency (foreign currency)
  └─> Invoice (via LedgerEvent, for remittance info)

PaymentAccount
  └─> Company.GroupID (multi-company support)

9. Sample SQL Query for Data Extraction

-- Example: Extract data for payment batch export
SELECT
    -- Transaction ID
    lp.ID AS EndToEndId,

    -- Amount
    ISNULL(lp.CurrencyAmount, lp.Amount) AS Amount,
    ISNULL(cu.ExternalID, 'SEK') AS Currency,

    -- Recipient Info
    COALESCE(cci.Name, c.DispName1) AS CreditorName,
    COALESCE(bl.PayoutAccount, c.PayoutAccount, lp.AccountNumber) AS CreditorAccount,
    ISNULL(bl.PayoutTypeID, c.PayoutTypeID) AS PayoutTypeID,

    -- Recipient Address (for money orders)
    ISNULL(cci.Address, c.DispAddress) AS StreetName,
    REPLACE(ISNULL(cci.Zipcode, c.Zipcode), ' ', '') AS PostalCode,
    ISNULL(cci.City, c.City) AS TownName,
    COALESCE(co.IsoCode, 'SE') AS Country,

    -- Remittance Info
    COALESCE(i.InvoiceNumber, i2.InvoiceNumber, p.ReferenceID) AS Reference,

    -- Payment Account Info
    pa.CustomerNumber AS DebtorName,
    pa.BIC,
    pa.IBAN,
    pa.OutBankgiroNumber,
    pa.OutPlusgiroNumber,
    pa.PayoutOrgID

FROM
    dbo.LedgerPayout lp
    INNER JOIN dbo.LedgerEvent le ON le.ID = lp.LedgerEventID
    INNER JOIN dbo.BillLocation bl ON bl.ID = lp.BillLocationID
    INNER JOIN dbo.V_RepCustomer c ON c.ID = lp.CustomerID
    INNER JOIN dbo.PaymentAccount pa ON pa.ID = @PaymentAccountID
    LEFT JOIN dbo.Currency cu ON cu.ID = lp.CurrencyID
    LEFT JOIN dbo.CustomerContactInformation cci ON cci.CustomerID = c.ID
        AND cci.ContactInformationTypeID = 3 AND cci.IsDeleted = 0
    LEFT JOIN dbo.Country co ON co.ID = ISNULL(cci.CountryID, c.CountryID)
    LEFT JOIN dbo.Payment p ON p.ID = le.PaymentID
    LEFT JOIN dbo.Invoice i ON i.ID = le.ReferencedInvoiceID
    LEFT JOIN dbo.Invoice i2 ON i2.ID = p.InvoiceID

WHERE
    lp.StatusID = 0  -- Not processed
    AND le.StatusID = 4  -- Approved for payout
    AND lp.TypeID != 5  -- Exclude Autogiro
    AND ISNULL(lp.CurrencyID, 4) = @CurrencyID

ORDER BY lp.ID

10. Configuration Checklist

Before First Export

PaymentAccount Setup (per company/bank)

System Settings (PrSys.AppSetting)

Customer/BillLocation Data Quality

Currency Configuration


11. Reference Information

ISO20022 Message Standards

Swedish Payment System Codes

Contact & Support

For questions about implementation or field mapping, reference:


Document Version: 1.0
Last Updated: 2026-01-30
Based on: ProBillDB version 2.0.4751.0+


------------------------------------------------------------------------------------------------------------------------

Incoming Payments Mapping

ProBill handles AutoGiro, TotalIN, BgMax, and Camt.054 files for incoming payments.

Autogiro (if BIS will have an AG flow):

Flow description: Flöde autogiro i ProBill.xlsx
Old file layout according to: https://www.bankgirot.se/globalassets/dokument/tekniska-manualer/autogiro_tekniskmanual_sv.pdf

Requirements Specification – CAMT.054 Payments in ProBill


Date: 2026-03-04  |  Scope: Incoming payments and CAMT.054 outgoing payments. Pain.002 handling is covered by this specification above in this page.

1. Purpose and Scope

This requirements specification describes how ProBill interprets and stores payments from CAMT.054 files (ISO 20022 standard, message type BkToCstmrDbtCdtNtfctn, version camt.054.001.02).

Included:

2. Identification of File Type

A file is identified as CAMT.054 if the XML content contains the element name BkToCstmrDbtCdtNtfctn.

XML namespace: urn:iso:std:iso:20022:tech:xsd:camt.054.001.02

The file type is then determined by GrpHdr/AddtlInf:

ConditionFile typeTarget table
GrpHdr/AddtlInf does not contain DEBTIncoming paymentdbo.Payment
GrpHdr/AddtlInf contains DEBTOutgoing paymentdbo.LedgerPayoutResult

3. XML Structure and Tags Read

The CAMT.054 file has a hierarchical structure with three levels that are read:

Document/BkToCstmrDbtCdtNtfctn
├── GrpHdr                          ← Message header (one per file)
└── Ntfctn                          ← Notification / account (one or more per file)
    ├── Id
    ├── CreDtTm
    ├── Acct                        ← Receiver account
    └── Ntry                        ← Transaction / entry (one or more per Ntfctn)
        ├── BookgDt/Dt
        ├── ValDt/Dt
        └── NtryDtls/TxDtls         ← Transaction details
            ├── Refs
            ├── AmtDtls
            ├── RltdPties           ← Involved parties
            ├── Purp
            ├── RltdDts
            └── RmtInf              ← Remittance information
                ├── Ustrd
                └── Strd            ← Structured remittance (one or more)

3.1 Message Header – GrpHdr

Read once per file from /Document/BkToCstmrDbtCdtNtfctn.

XML tagDescription
GrpHdr/MsgIdUnique message ID
GrpHdr/CreDtTmMessage creation date and time
GrpHdr/AddtlInfAdditional information. Used to distinguish incoming payments (no DEBT) from outgoing payments (DEBT present).

3.2 Account Information – Ntfctn

Read per Ntfctn node. Represents the receiving account (seller's account).

XML tagDescription
Ntfctn/IdUnique notification ID. Mandatory per standard.
Ntfctn/CreDtTmNotification creation date and time
Ntfctn/Acct/Id/IBANReceiver account IBAN number
Ntfctn/Acct/Id/Othr/IdReceiver account BBAN (e.g. bankgiro number)
Ntfctn/Acct/Id/Othr/SchmeNm/CdAccount scheme code (e.g. BBAN)
Ntfctn/Acct/Ownr/Id/OrgId/Othr/IdAccount owner organisation ID


Note: A CAMT.054 file may contain multiple Ntfctn nodes. Each Ntfctn has a unique Id used to ensure each transaction is linked to the correct account.

3.3 Transaction Details – Ntry / TxDtls / Strd

Read per transaction. An Ntfctn can have multiple Ntry nodes, and each Ntry can have multiple TxDtls and/or Strd nodes. Transactions without a Strd element are still included (e.g. Swish payments).

XML tagDescription
Ntfctn/Ntry/BookgDt/DtBooking date
Ntfctn/Ntry/ValDt/DtValue date
TxDtls/Refs/AcctSvcrRefBank's internal transaction ID
TxDtls/Refs/EndToEndIdEnd-to-end reference. Used for Swish to identify the mobile number.
TxDtls/AmtDtls/TxAmt/AmtTransaction amount
TxDtls/AmtDtls/TxAmt/Amt/@CcyCurrency code for the transaction amount (XML attribute)
TxDtls/RltdPties/Dbtr/NmPayer name
TxDtls/RltdPties/Dbtr/PstlAdr/StrtNmPayer street address
TxDtls/RltdPties/Dbtr/PstlAdr/PstCdPayer postal code
TxDtls/RltdPties/Dbtr/PstlAdr/TwnNmPayer city
TxDtls/RltdPties/Dbtr/Id/OrgId/Othr/IdPayer organisation number
TxDtls/RltdPties/DbtrAcct/Id/IBANPayer account number (IBAN)
TxDtls/RltdPties/DbtrAcct/Id/Othr/IdPayer account number (BBAN or other). Also used as Swish mobile number.
TxDtls/RltdPties/DbtrAcct/Id/Othr/SchmeNm/PrtryAccount scheme name for payer's account
TxDtls/RltdPties/UltmtDbtr/NmUltimate debtor name (if different from Dbtr)
TxDtls/RltdPties/UltmtDbtr/PstlAdr/StrtNmUltimate debtor street address
TxDtls/RltdPties/UltmtDbtr/PstlAdr/PstCdUltimate debtor postal code
TxDtls/RltdPties/UltmtDbtr/PstlAdr/TwnNmUltimate debtor city
TxDtls/RltdPties/UltmtDbtr/Id/OrgId/Othr/IdUltimate debtor organisation number
TxDtls/RltdPties/Cdtr/NmPayee (creditor) name
TxDtls/RltdPties/CdtrAcct/Id/IBANPayee IBAN
TxDtls/RltdPties/CdtrAcct/Id/Othr/IdPayee BBAN (bankgiro)
TxDtls/Purp/CdPayment purpose code. Swish: WEBI, SUPP or REFU.
TxDtls/RltdDts/AccptncDtTmAcceptance date/time
TxDtls/RmtInf/UstrdUnstructured remittance message (free text)
RmtInf/Strd/RfrdDocInf/NbInvoice number
RmtInf/Strd/RfrdDocAmt/CdtNoteAmtCredit note amount
RmtInf/Strd/RfrdDocAmt/CdtNoteAmt/@CcyCurrency for credit note amount (XML attribute)
RmtInf/Strd/RfrdDocAmt/RmtdAmtRemitted amount (actual amount paid)
RmtInf/Strd/RfrdDocAmt/RmtdAmt/@CcyCurrency for remitted amount (XML attribute)
RmtInf/Strd/CdtrRefInf/RefOCR reference
RmtInf/Strd/AddtlRmtInfAdditional remittance information. May appear multiple times – all repetitions are concatenated. Used for Swish payments (contains OrderID:).

4. Logic for Key Variables

4.1 Swish Identification (IsSwish)

A payment is classified as Swish (IsSwish = 1) if both of the following conditions are met:

Condition 1 – Prerequisite: TxDtls/Refs/EndToEndId is NOT NULL

Condition 2 – At least one of:

CheckXML sourceCondition
Free text contains order IDRmtInf/Strd/AddtlRmtInfContains the string 'OrderID:'
Purpose code is a Swish codeTxDtls/Purp/CdIs one of: WEBI, SUPP, REFU

If EndToEndId is NULL, IsSwish = 0 is always returned.

4.2 ReferenceID

PrioritySourceComment
1RmtInf/Strd/CdtrRefInf/RefOCR reference
2RmtInf/Strd/RfrdDocInf/NbInvoice number
3Extracted from RmtInf/Strd/AddtlRmtInfOnly if IsSwish = 1: text between 'OrderID: ' and '-'
4RmtInf/Strd/AddtlRmtInf (if not Swish)Used as reference if none of the above are present
5RmtInf/UstrdUnstructured message as last resort

4.3 Amount

PrioritySourceComment
1RmtInf/Strd/RfrdDocAmt/RmtdAmtRemitted amount – actual payment
2- + RmtInf/Strd/RfrdDocAmt/CdtNoteAmtCredit note stored with negative sign
3TxDtls/AmtDtls/TxAmt/AmtTransaction amount
40Fallback

4.4 EntryDate

EntryDate = Ntfctn/Ntry/BookgDt/Dt (NULL if empty)

4.5 PaymentDate

PrioritySource
1TxDtls/RltdDts/AccptncDtTm
2Ntfctn/Ntry/ValDt/Dt
3Ntfctn/Ntry/BookgDt/Dt

5. Incoming Payments – Mapping to dbo.Payment

ColumnXML source / Logic
FileIDFile ID (link to source file)
CreatedNtfctn/CreDtTm – converted to DATETIME2. Fallback: 1900-01-01.
SellerReferenceNtfctn/Acct/Ownr/Id/OrgId/Othr/Id
SellerAccountIBAN prefixed with [IBAN], otherwise BBAN prefixed with scheme code
EntryDateSee §4.4. Fallback: 1900-01-01.
PaymentDateSee §4.5. Fallback: 1900-01-01.
ArchiveIDTxDtls/Refs/AcctSvcrRef
ReferenceIDSee §4.2. Only if numeric – otherwise NULL.
Comment(1) Non-numeric reference value, (2) Swish: 'Swish från mobilnummer 0' + mobile number, (3) otherwise NULL
OCRMessageRmtInf/Strd/AddtlRmtInf – raw additional info. NULL if empty.
PayeeNameUltmtDbtr/Nm if present, otherwise Dbtr/Nm
PayeeAddressUltmtDbtr/PstlAdr/StrtNm if present, otherwise Dbtr/PstlAdr/StrtNm
PayeeZipCodeUltmtDbtr/PstlAdr/PstCd if present, otherwise Dbtr/PstlAdr/PstCd. Spaces removed.
PayeeCityUltmtDbtr/PstlAdr/TwnNm if present, otherwise Dbtr/PstlAdr/TwnNm
PayeeOrgNumberUltmtDbtr/Id/OrgId/Othr/Id if present, otherwise Dbtr/Id/OrgId/Othr/Id
PaymentAccount(1) CdtrAcct/Id/IBAN, (2) CdtrAcct/Id/Othr/Id, (3) fallback to SellerAccount
PayeeAccount(1) [IBAN] + DbtrAcct/Id/IBAN, (2) scheme + DbtrAcct/Id/Othr/Id, (3) DbtrAcct/Id/Othr/Id
AmountSee §4.3. NOT NULL.
CurrencyRmtdAmt/@Ccy  CdtNoteAmt/@Ccy  TxAmt/@Ccy
CurrencyIDLookup on currency code
ReturnMaterialCodeNULL
RecordCode6 if IsSwish = 1, otherwise 3
CorrectionCode0 (fixed)
SourceID1 if debt collection/post-watch account, otherwise 0
ErrorIDSee §6.1
StatusIDSee §6.2
HandledSee §6.3

6. Incoming Payments – Error Handling and Status Assignment

6.1 ErrorID – Error Code

PriorityConditionErrorIDDescription
1ReferenceID missing/non-numeric and Amount = 01Invoice not found
2ReferenceID missing or non-numeric6Incorrect reference number
3Amount = 038Unreasonable amount
4SellerAccount is a post-watch account8Post-watch
5EntryDate missing43Booking date missing
6PaymentDate missing44Payment date missing
7No errorsNULL

6.2 StatusID – Status

ConditionStatusIDStatus
ReferenceID missing/non-numeric, or Amount = 0, or EntryDate missing, or PaymentDate missing2Error
None of the above0New

6.3 Handled – Direct Flagging

Records with an identified error are marked as handled immediately upon import (Handled = current timestamp). Records are flagged immediately if: ReferenceID is missing/non-numeric, Amount = 0, EntryDate is missing, or PaymentDate is missing. All other records are left unflagged (Handled = NULL).

7. Outgoing Payments – Mapping to dbo.LedgerPayoutResult

7.1 Identification

A record is treated as an outgoing payment if GrpHdr/AddtlInf contains the string DEBT.

7.2 Link to LedgerPayout

The outgoing payment is linked via TxDtls/Refs/EndToEndId cast as integer → matched against LedgerPayout.ID. CustomerID is retrieved from the matching record.

7.3 Mapping

ColumnXML source / Logic
FileIDFile ID (link to source file)
InsertedCurrent timestamp at import
HandledNULL on INSERT
StatusID2 (= Payout executed)
FileDateNtfctn/CreDtTm – converted to DATETIME
PayerAccountNtfctn/Acct/Id/IBAN if present, otherwise Ntfctn/Acct/Id/Othr/Id
ReasonNULL
Amount(1) RmtdAmt, (2) -CdtNoteAmt, (3) TxAmt/Amt
PayoutDateValDt/Dt if present, otherwise BookgDt/Dt
NameTxDtls/RltdPties/Cdtr/Nm
PayeeAccountCdtrAcct/Id/IBAN if present, otherwise CdtrAcct/Id/Othr/Id
PayoutIDTxDtls/Refs/EndToEndId cast as integer
CustomerIDRetrieved from matching LedgerPayout record via PayoutID

7.4 Post-processing

After INSERT, each outgoing payment record is marked as handled (Handled = current timestamp). If outgoing payment records were inserted, a subsequent process for result handling is triggered.



Based on existing implementation in ProBill version: 2.0.4833.0. XML standard: ISO 20022 camt.054.001.02.