English Deutsch

Create a SEPA Direct Debit

Simple SEPA Direct Debit (pain.008)
from fintech.sepa import Account, SEPADirectDebit

# Create the creditor account from a tuple (ACCOUNT, BANKCODE)
creditor = Account(('532013000', '37040044'), 'Max Mustermann')
# Assign the creditor id
creditor.set_originator_id('DE98ZZZ09999999999')
# Create the debtor account from a tuple (IBAN, BIC)
debtor = Account(('AT611904300234573201', 'BKAUATWW'), 'Maria Musterfrau')
# For a SEPA direct debit a valid mandate is required
debtor.set_mandate(mref='M00123456', signed='2014-02-01', recurrent=True)
# Create a SEPADirectDebit instance of type CORE
sdd = SEPADirectDebit(creditor, 'CORE')
# Add the transaction
trans = sdd.add_transaction(debtor, 10.00, 'Purpose')
# Render the SEPA document
print(sdd.render())