English Deutsch

Documentation fintech.ebics

EBICS client module of the Python FinTech package.

This module defines functions and classes to work with EBICS.

Index
class fintech.ebics.EbicsKeyRing(keys, passphrase=None, sig_passphrase=None)

EBICS key ring representation

An EbicsKeyRing instance can hold sets of private user keys and/or public bank keys. Private user keys are always stored AES encrypted by the specified passphrase (derivated by PBKDF2). For each key file on disk or same key dictionary a singleton instance is created.

Initializes the EBICS key ring instance.

Parameters
  • keys – The path to a key file or a dictionary of keys. If keys is a path and the key file does not exist, it will be created as soon as keys are added. If keys is a dictionary, all changes are applied to this dictionary and the caller is responsible to store the modifications. Key files from previous PyEBICS versions are automatically converted to a new format.
  • passphrase – The passphrase by which all private keys are encrypted/decrypted.
  • sig_passphrase – A different passphrase for the signature key (optional). Useful if you want to store the passphrase to automate downloads while preventing uploads without user interaction. (New since v7.3)
change_passphrase(passphrase=None, sig_passphrase=None)

Changes the passphrase by which all private keys are encrypted. If a passphrase is omitted, it is left unchanged. The key ring is automatically updated and saved.

Parameters
  • passphrase – The new passphrase.
  • sig_passphrase – The new signature passphrase. (New since v7.3)
property keyfile

The path to the key file (read-only).

property pbkdf_iterations

The number of iterations to derivate the passphrase by the PBKDF2 algorithm. Initially it is set to a number that requires an approximate run time of 50 ms to perform the derivation function.

save(path=None)

Saves all keys to the file specified by path. Usually it is not necessary to call this method, since most modifications are stored automatically.

Parameters
path – The path of the key file. If path is not specified, the path of the current key file is used.
set_pbkdf_iterations(iterations=10000, duration=None)

Sets the number of iterations which is used to derivate the passphrase by the PBKDF2 algorithm. The optimal number depends on the performance of the underlying system and the use case.

Parameters
  • iterations – The minimum number of iterations to set.
  • duration – The target run time in seconds to perform the derivation function. A higher value results in a higher number of iterations.
Returns
The specified or calculated number of iterations, whatever is higher.
class fintech.ebics.EbicsBank(keyring, hostid, url)

EBICS bank representation

Initializes the EBICS bank instance.

Parameters
  • keyring – An EbicsKeyRing instance.
  • hostid – The HostID of the bank.
  • url – The URL of the EBICS server.
activate_keys(fail_silently=False)

Activates the bank keys downloaded via EbicsClient.HPB().

Parameters
fail_silently – Flag whether to throw a RuntimeError if there exists no key to activate.
export_keys()

Exports the bank keys in PEM format.

Returns
A dictionary with pairs of key version and PEM encoded public key.
get_protocol_versions()

Returns a dictionary of supported EBICS protocol versions. Same as calling EbicsClient.HEV().

property hostid

The HostID of the bank (read-only).

property keyring

The EbicsKeyRing instance (read-only).

property url

The URL of the EBICS server (read-only).

class fintech.ebics.EbicsUser(keyring, partnerid, userid, systemid=None, transport_only=False)

EBICS user representation

Initializes the EBICS user instance.

Parameters
  • keyring – An EbicsKeyRing instance.
  • partnerid – The assigned PartnerID (Kunden-ID).
  • userid – The assigned UserID (Teilnehmer-ID).
  • systemid – The assigned SystemID (usually unused).
  • transport_only – Flag if the user has permission T (EBICS T). New since v7.4
create_certificates(validity_period=5, **x509_dn)

Generates self-signed certificates for all keys that still lacks a certificate and adds them to the key ring. May only be used for EBICS accounts whose key management is based on certificates (eg. French banks).

Parameters
  • validity_period – The validity period in years.
  • **x509_dn

    Keyword arguments, collected in x509_dn, are used as Distinguished Names to create the self-signed certificates. Possible keyword arguments are:

    • commonName [CN]
    • organizationName [O]
    • organizationalUnitName [OU]
    • countryName [C]
    • stateOrProvinceName [ST]
    • localityName [L]
    • emailAddress
Returns
A list of key versions for which a new certificate was created (new since v6.4).
create_ini_letter(bankname, path=None, lang=None)

Creates the INI-letter as PDF document.

Parameters
  • bankname – The name of the bank which is printed on the INI-letter as the recipient.
  • path – The destination path of the created PDF file. If path is not specified, the PDF will not be saved.
  • lang – ISO 639-1 language code of the INI-letter to create. Defaults to the system locale language.
Returns
The PDF data as byte string if path is None.
create_keys(keyversion='A006', bitlength=2048)

Generates all missing keys that are required for a new EBICS user. The key ring will be automatically updated and saved.

Parameters
  • keyversion – The key version of the electronic signature. Supported versions are A005 (based on RSASSA-PKCS1-v1_5) and A006 (based on RSASSA-PSS).
  • bitlength – The bit length of the generated keys. The value must be between 2048 and 4096 (default is 2048).
Returns
A list of created key versions (new since v6.4).
export_certificates()

Exports the user certificates in PEM format.

Returns
A dictionary with pairs of key version and a list of PEM encoded certificates (the certificate chain).
export_keys(passphrase, pkcs=8)

Exports the user keys in encrypted PEM format.

Parameters
  • passphrase – The passphrase by which all keys are encrypted. The encryption algorithm depends on the used cryptography library.
  • pkcs – The PKCS version. An integer of either 1 or 8.
Returns
A dictionary with pairs of key version and PEM encoded private key.
import_certificates(**certs)

Imports certificates from a set of keyword arguments. It is verified that the certificates match the existing keys. If a signature key is missing, the public key is added from the certificate (used for external signature processes). The key ring is automatically updated and saved. May only be used for EBICS accounts whose key management is based on certificates (eg. French banks).

Parameters
**certs

Keyword arguments, collected in certs, represent the different certificates to import. The keyword name stands for the key version the certificate is assigned to. The corresponding keyword value can be a byte string of the certificate or a list of byte strings (the certificate chain). Each certificate can be either in format DER or PEM. At time the following keywords are supported: A006, A005, X002, E002.

import_keys(passphrase=None, **keys)

Imports private user keys from a set of keyword arguments. The key ring is automatically updated and saved.

Parameters
  • passphrase – The passphrase if the keys are encrypted. At time only DES or 3TDES encrypted keys are supported.
  • **keys

    Additional keyword arguments, collected in keys, represent the different private keys to import. The keyword name stands for the key version and its value for the byte string of the corresponding key. The keys can be either in format DER or PEM (PKCS#1 or PKCS#8). At time the following keywords are supported:

    • A006: The signature key, based on RSASSA-PSS
    • A005: The signature key, based on RSASSA-PKCS1-v1_5
    • X002: The authentication key
    • E002: The encryption key
property keyring

The EbicsKeyRing instance (read-only).

property manual_approval

If uploaded orders are approved manually via accompanying document, this property must be set to True. Deprecated, use class parameter transport_only instead.

property partnerid

The PartnerID of the EBICS account (read-only).

property systemid

The SystemID of the EBICS account (read-only).

property transport_only

Flag if the user has permission T (read-only). New since v7.4

property userid

The UserID of the EBICS account (read-only).

class fintech.ebics.BusinessTransactionFormat(service, msg_name, scope=None, option=None, container=None, version=None, variant=None, format=None)

Business Transaction Format class

Required for EBICS protocol version 3.0 (H005).

With EBICS v3.0 you have to declare the file types you want to transfer. Please ask your bank what formats they provide. Instances of this class are used with EbicsClient.BTU(), EbicsClient.BTD() and all methods regarding the distributed signature.

Examples:

# SEPA Credit Transfer
CCT = BusinessTransactionFormat(
    service='SCT',
    msg_name='pain.001',
)

# SEPA Direct Debit (Core)
CDD = BusinessTransactionFormat(
    service='SDD',
    msg_name='pain.008',
    option='COR',
)

# SEPA Direct Debit (B2B)
CDB = BusinessTransactionFormat(
    service='SDD',
    msg_name='pain.008',
    option='B2B',
)

# End of Period Statement (camt.053)
C53 = BusinessTransactionFormat(
    service='EOP',
    msg_name='camt.053',
    scope='DE',
    container='ZIP',
)

Initializes the BTF instance.

Parameters
  • service – The service code name consisting of 3 alphanumeric characters [A-Z0-9] (eg. SCT, SDD, STM, EOP)
  • msg_name – The message name consisting of up to 10 alphanumeric characters [a-z0-9.] (eg. pain.001, pain.008, camt.053, mt940)
  • scope – Scope of service. Either an ISO-3166 ALPHA 2 country code or an issuer code of 3 alphanumeric characters [A-Z0-9].
  • option – The service option code consisting of 3-10 alphanumeric characters [A-Z0-9] (eg. COR, B2B)
  • container – Type of container consisting of 3 characters [A-Z] (eg. XML, ZIP)
  • version – Message version consisting of 2 numeric characters [0-9] (eg. 03)
  • variant – Message variant consisting of 3 numeric characters [0-9] (eg. 001)
  • format – Message format consisting of 1-4 alphanumeric characters [A-Z0-9] (eg. XML, JSON, PDF)
class fintech.ebics.EbicsClient(bank, user, version='H004')

Main EBICS client class.

Initializes the EBICS client instance.

Parameters
  • bank – An instance of EbicsBank.
  • user – An instance of EbicsUser. If you pass a list of users, a signature for each user is added to an upload request (new since v7.2). In this case the first user is the initiating one.
  • version – The EBICS protocol version (H003, H004 or H005). It is strongly recommended to use at least version H004 (2.5). When using version H003 (2.4) the client is responsible to generate the required order ids, which must be implemented by your application.
BTD(btf, start=None, end=None, **params)

Downloads data with EBICS protocol version 3.0 (H005).

Parameters
  • btf – Instance of BusinessTransactionFormat.
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • **params

    Additional keyword arguments, collected in params, are added as custom order parameters to the request.

Returns
The requested file data.
BTU(btf, data, **params)

Uploads data with EBICS protocol version 3.0 (H005).

Parameters
  • btf – Instance of BusinessTransactionFormat.
  • data – The data to upload.
  • **params

    Additional keyword arguments, collected in params, are added as custom order parameters to the request. Some banks in France require to upload a file in test mode the first time: TEST=’TRUE’

Returns
The order id (OrderID).
C52(start=None, end=None, parsed=False)

Downloads Bank to Customer Account Reports (camt.52)

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
C53(start=None, end=None, parsed=False)

Downloads Bank to Customer Statements (camt.53)

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
C54(start=None, end=None, parsed=False)

Downloads Bank to Customer Debit Credit Notifications (camt.54)

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
CCT(document)

Uploads a SEPA Credit Transfer document.

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPACreditTransfer object.
Returns
The id of the uploaded order (OrderID).
CCU(document)

Uploads a SEPA Credit Transfer document (Urgent Payments). New in v7.0.0

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPACreditTransfer object.
Returns
The id of the uploaded order (OrderID).
CDB(document)

Uploads a SEPA Direct Debit document of type B2B.

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPADirectDebit object.
Returns
The id of the uploaded order (OrderID).
CDD(document)

Uploads a SEPA Direct Debit document of type CORE.

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPADirectDebit object.
Returns
The id of the uploaded order (OrderID).
CDZ(start=None, end=None, parsed=False)

Downloads Payment Status Report for Direct Debits.

New in v6.5: Added parameters start and end.

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
CIP(document)

Uploads a SEPA Credit Transfer document (Instant Payments). New in v6.2.0

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPACreditTransfer object.
Returns
The id of the uploaded order (OrderID).
CIZ(start=None, end=None, parsed=False)

Downloads Payment Status Report for Credit Transfers (Instant Payments). New in v6.2.0

New in v6.5: Added parameters start and end.

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
CRZ(start=None, end=None, parsed=False)

Downloads Payment Status Report for Credit Transfers.

New in v6.5: Added parameters start and end.

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
FDL(filetype, start=None, end=None, country=None, **params)

Downloads a file in arbitrary format.

Not usable with EBICS 3.0 (H005)

Parameters
  • filetype – The requested file type.
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • country – The country code (ISO-3166 ALPHA 2) if the specified file type is country-specific.
  • **params

    Additional keyword arguments, collected in params, are added as custom order parameters to the request.

Returns
The requested file data.
FUL(filetype, data, country=None, **params)

Uploads a file in arbitrary format.

Not usable with EBICS 3.0 (H005)

Parameters
  • filetype – The file type to upload.
  • data – The file data to upload.
  • country – The country code (ISO-3166 ALPHA 2) if the specified file type is country-specific.
  • **params

    Additional keyword arguments, collected in params, are added as custom order parameters to the request. Some banks in France require to upload a file in test mode the first time: TEST=’TRUE’

Returns
The order id (OrderID).
H3K()

Sends the public key of the electronic signature, the public authentication key and the encryption key based on certificates. At least the certificate for the signature key must be signed by a certification authority (CA) or the bank itself. Returns the assigned order id.

HAA(parsed=False)

Downloads the available order types.

Parameters
parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HAC(start=None, end=None, parsed=False)

Downloads the customer usage report in XML format.

Parameters
  • start – The start date of requested processes. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested processes. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HCA(bitlength=2048)

Creates a new authentication and encryption key, transfers them to the bank and updates the user key ring.

Parameters
bitlength – The bit length of the generated keys. The value must be between 1536 and 4096 (default is 2048).
Returns
The assigned order id.
HCS(bitlength=2048, keyversion=None)

Creates a new signature, authentication and encryption key, transfers them to the bank and updates the user key ring. It acts like a combination of EbicsClient.PUB() and EbicsClient.HCA().

Parameters
  • bitlength – The bit length of the generated keys. The value must be between 1536 and 4096 (default is 2048).
  • keyversion – The key version of the electronic signature. Supported versions are A005 (based on RSASSA-PKCS1-v1_5) and A006 (based on RSASSA-PSS). If not specified, the version of the current signature key is used.
Returns
The assigned order id.
HEV()

Returns a dictionary of supported protocol versions.

HIA()

Sends the public authentication (X002) and encryption (E002) keys. Returns the assigned order id.

HKD(parsed=False)

Downloads the customer properties and settings.

Parameters
parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HPB()

Receives the public authentication (X002) and encryption (E002) keys from the bank.

The keys are added to the key file and must be activated by calling the method EbicsBank.activate_keys().

Returns
The string representation of the keys.
HPD(parsed=False)

Downloads the available bank parameters.

Parameters
parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HTD(parsed=False)

Downloads the user properties and settings.

Parameters
parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HVD(orderid, ordertype=None, partnerid=None, parsed=False)

This method is part of the distributed signature and downloads the signature status of a pending order.

Parameters
  • orderid – The id of the order in question.
  • ordertype – With EBICS protocol version H005 an BusinessTransactionFormat instance of the order. Otherwise the type of the order in question. If not specified, the related BTF / order type is detected by calling the method EbicsClient.HVU().
  • partnerid – The partner id of the corresponding order. Defaults to the partner id of the current user.
  • parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HVE(orderid, ordertype=None, hash=None, partnerid=None)

This method is part of the distributed signature and signs a pending order.

Parameters
  • orderid – The id of the order in question.
  • ordertype – With EBICS protocol version H005 an BusinessTransactionFormat instance of the order. Otherwise the type of the order in question. If not specified, the related BTF / order type is detected by calling the method EbicsClient.HVZ().
  • hash – The base64 encoded hash of the order to be signed. If not specified, the corresponding hash is detected by calling the method EbicsClient.HVZ().
  • partnerid – The partner id of the corresponding order. Defaults to the partner id of the current user.
HVS(orderid, ordertype=None, hash=None, partnerid=None)

This method is part of the distributed signature and cancels a pending order.

Parameters
  • orderid – The id of the order in question.
  • ordertype – With EBICS protocol version H005 an BusinessTransactionFormat instance of the order. Otherwise the type of the order in question. If not specified, the related BTF / order type is detected by calling the method EbicsClient.HVZ().
  • hash – The base64 encoded hash of the order to be canceled. If not specified, the corresponding hash is detected by calling the method EbicsClient.HVZ().
  • partnerid – The partner id of the corresponding order. Defaults to the partner id of the current user.
HVT(orderid, ordertype=None, source=False, limit=100, offset=0, partnerid=None, parsed=False)

This method is part of the distributed signature and downloads the transaction details of a pending order.

Parameters
  • orderid – The id of the order in question.
  • ordertype – With EBICS protocol version H005 an BusinessTransactionFormat instance of the order. Otherwise the type of the order in question. If not specified, the related BTF / order type is detected by calling the method EbicsClient.HVU().
  • source – Boolean flag whether the original document of the order should be returned or just a summary of the corresponding transactions.
  • limit – Constrains the number of transactions returned. Only applicable if source evaluates to False.
  • offset – Specifies the offset of the first transaction to return. Only applicable if source evaluates to False.
  • partnerid – The partner id of the corresponding order. Defaults to the partner id of the current user.
  • parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HVU(filter=None, parsed=False)

This method is part of the distributed signature and downloads pending orders waiting to be signed.

Parameters
  • filter – With EBICS protocol version H005 an optional list of BusinessTransactionFormat instances which are used to filter the result. Otherwise an optional list of order types which are used to filter the result.
  • parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
HVZ(filter=None, parsed=False)

This method is part of the distributed signature and downloads pending orders waiting to be signed. It acts like a combination of EbicsClient.HVU() and EbicsClient.HVD().

Parameters
  • filter – With EBICS protocol version H005 an optional list of BusinessTransactionFormat instances which are used to filter the result. Otherwise an optional list of order types which are used to filter the result.
  • parsed – Flag whether the received XML document should be parsed and returned as a structure of dictionaries or not.
Returns
Either the raw XML document or a structure of dictionaries.
INI()

Sends the public key of the electronic signature. Returns the assigned order id.

PTK(start=None, end=None)

Downloads the customer usage report in text format.

Parameters
  • start – The start date of requested processes. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested processes. Can be a date object or an ISO8601 formatted string.
Returns
The customer usage report.
PUB(bitlength=2048, keyversion=None)

Creates a new electronic signature key, transfers it to the bank and updates the user key ring.

Parameters
  • bitlength – The bit length of the generated key. The value must be between 1536 and 4096 (default is 2048).
  • keyversion – The key version of the electronic signature. Supported versions are A005 (based on RSASSA-PKCS1-v1_5) and A006 (based on RSASSA-PSS). If not specified, the version of the current signature key is used.
Returns
The assigned order id.
SPR()

Locks the EBICS access of the current user.

STA(start=None, end=None, parsed=False)

Downloads the bank account statement in SWIFT format (MT940).

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received MT940 message should be parsed and returned as a dictionary or not. See function fintech.swift.parse_mt940().
Returns
Either the raw data of the MT940 SWIFT message or the parsed message as dictionary.
VMK(start=None, end=None, parsed=False)

Downloads the interim transaction report in SWIFT format (MT942).

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received MT942 message should be parsed and returned as a dictionary or not. See function fintech.swift.parse_mt940().
Returns
Either the raw data of the MT942 SWIFT message or the parsed message as dictionary.
XE2(document)

Uploads a SEPA Credit Transfer document (Switzerland). New in v7.0.0

Parameters
document – The SEPA document to be uploaded either as a raw XML string or a fintech.sepa.SEPACreditTransfer object.
Returns
The id of the uploaded order (OrderID).
Z01(start=None, end=None, parsed=False)

Downloads Payment Status Report (Switzerland, mixed). New in v7.0.0

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
Z53(start=None, end=None, parsed=False)

Downloads Bank to Customer Statements (Switzerland, camt.53) New in v7.0.0

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
Z54(start=None, end=None, parsed=False)

Downloads Bank Batch Statements ESR (Switzerland, C53F) New in v7.0.0

Parameters
  • start – The start date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • end – The end date of requested transactions. Can be a date object or an ISO8601 formatted string.
  • parsed – Flag whether the received XML documents should be parsed and returned as structures of dictionaries or not.
Returns
A dictionary of either raw XML documents or structures of dictionaries.
property bank

The EBICS bank (read-only).

property check_ssl_certificates

Flag whether remote SSL certificates should be checked for validity or not. The default value is set to True.

confirm_download(trans_id=None, success=True)

Confirms the receipt of previously executed downloads.

It is usually used to mark received data, so that it is not included in further downloads. Some banks require to confirm a download before new downloads can be performed.

Parameters
  • trans_id – The transaction id of the download (see last_trans_id). If not specified, all previously unconfirmed downloads are confirmed.
  • success – Informs the EBICS server whether the downloaded data was successfully processed or not.
download(order_type, start=None, end=None, params=None)

Performs an arbitrary EBICS download request.

New in v6.5: Added parameters start and end.

Parameters
  • order_type – The id of the intended order type.
  • start – The start date of requested documents. Can be a date object or an ISO8601 formatted string. Not allowed with all order types.
  • end – The end date of requested documents. Can be a date object or an ISO8601 formatted string. Not allowed with all order types.
  • params – A list or dictionary of parameters which are added to the EBICS request. Cannot be combined with a date range specified by start and end.
Returns
The downloaded data. The returned transaction id is stored in the attribute last_trans_id.
property last_trans_id

This attribute stores the transaction id of the last download process (read-only).

listen(filter=None)

Connects to the EBICS websocket server and listens for new incoming messages. This is a blocking service. Please refer to the separate websocket documentation. New in v7.0

Parameters
filter – An optional list of order types or BTF message names (BusinessTransactionFormat.msg_name) that will be processed. Other data types are skipped.
property suppress_no_data_error

Flag whether to suppress exceptions if no download data is available or not. The default value is False. If set to True, download methods return None in the case that no download data is available.

property timeout

The timeout in seconds for EBICS connections (default: 30).

upload(order_type, data, params=None, prehashed=False)

Performs an arbitrary EBICS upload request.

Parameters
  • order_type – The id of the intended order type.
  • data – The data to be uploaded.
  • params – A list or dictionary of parameters which are added to the EBICS request.
  • prehashed – Flag, whether data contains a prehashed value or not.
Returns
The id of the uploaded order if applicable.
property user

The EBICS user (read-only).

property version

The EBICS protocol version (read-only).

property websocket

The websocket instance if running (read-only).

exception fintech.ebics.EbicsVerificationError

The EBICS response could not be verified.

exception fintech.ebics.EbicsTechnicalError(code, message=None)

The EBICS server returned a technical error. The corresponding EBICS error code can be accessed via the attribute code.

exception fintech.ebics.EbicsFunctionalError(code, message=None)

The EBICS server returned a functional error. The corresponding EBICS error code can be accessed via the attribute code.