Skip to content

Credit transfers (pain.001)

A credit transfer is a push payment: a debtor (payer) instructs their bank to send money to one or more creditors. The pain.001.001.09 message type is the modern ISO 20022 Credit Transfer Initiation message used across the SEPA zone.

import { euros, type CreditTransferDocument, type PaymentBatch, type Transfer } from 'sepa-xml-ts'
const doc: CreditTransferDocument = {
messageId: 'MSG-2026-0001', // GrpHdr/MsgId: unique message identifier
createdAt: '2026-06-01T10:30:00Z', // GrpHdr/CreDtTm: ISO 8601 datetime
initiatingParty: 'ACME GmbH', // GrpHdr/InitgPty/Nm
batches: [
{
id: 'BATCH-001', // PmtInfId: unique within the message
executionDate: '2026-06-03', // ReqdExctnDt/Dt: YYYY-MM-DD, never a datetime
debtor: {
name: 'ACME GmbH', // Dbtr/Nm
iban: 'DE89370400440532013000', // DbtrAcct/Id/IBAN
bic: 'COBADEFFXXX', // DbtrAgt/FinInstnId/BICFI (optional since 2016 rulebook)
},
transfers: [
{
endToEndId: 'INV-1001', // PmtId/EndToEndId
amount: euros('123.45'), // Amt/InstdAmt Ccy="EUR"
creditor: {
name: 'Beispiel AG', // Cdtr/Nm
iban: 'NL91ABNA0417164300', // CdtrAcct/Id/IBAN
// bic is optional for pan-European SEPA transfers
},
remittanceInfo: 'Invoice 1001', // RmtInf/Ustrd (optional)
},
],
},
],
}
TypeXSD element
CreditTransferDocumentDocument/CstmrCdtTrfInitn
PaymentBatchPmtInf
TransferCdtTrfTxInf
AccountPartyDbtr or Cdtr with account and agent
MoneyAmt/InstdAmt
import { writeCreditTransfer, validate } from 'sepa-xml-ts'
const result = validate(doc)
if (!result.ok) {
console.error(result.errors)
} else {
const xml = writeCreditTransfer(result.data)
}

writeCreditTransfer validates the model internally before writing. It throws a ValidationError if the model fails validation, so it cannot emit a structurally invalid file.

The writer derives the following fields from the model. You do not supply them:

FieldHow it is derived
GrpHdr/NbOfTxsTotal count of all transfers across all batches
GrpHdr/CtrlSumSum of all transfer amounts (exact bigint addition)
PmtInf/NbOfTxsCount of transfers in this batch
PmtInf/CtrlSumSum of transfer amounts in this batch
PmtInf/PmtMtdAlways TRF
PmtInf/PmtTpInf/SvcLvl/CdAlways SEPA
PmtInf/ChrgBrAlways SLEV

To write a German DK pain.001.003.03 file, pass { variant: 'pain.001.003.03' }:

const xml = writeCreditTransfer(doc, { variant: 'pain.001.003.03' })

See National variants for the structural differences and XSD details.

To add bank-specific validation or output tweaks:

import { requireBic } from 'sepa-xml-ts'
const xml = writeCreditTransfer(doc, { profile: requireBic })

See Bank profiles for the full profile API.