Package: enablebanking-api
Open Banking aggregation libraryThis Python library is designed for connecting to a number of Open Banking APIs
directly from your code without intermediate aggregation services. The library
provides unified interface for interacting with ASPSPs (banks), harmonize data
and implements cryptographic functionality needed for interaction with PSD2 APIs,
such as mTLS connection using eIDAS QWAC and request signing using eIDAS QSeal
certificate.The library offers 4 API classes:enablebanking.MetaApiprovides information about available connectors;enablebanking.AuthApiprovides PSU (bank user) authentication and token
creation functionality;enablebanking.AispApiprovides methods for accessing account information,
such as transactions and balances, on behalf of a PSU;enablebanking.PispApiprovides methods for initiating and conforming payment
requests.The same calls and data structures are used for interacting with different banks,
but for each bankenablebanking.ApiClientshall be initialised with own
settings and connectors' meta information shall be used to assure appropriate
use of the methods.Please note that the connector modules are not included into this package and
shall be downloaded separately.For more information refer to the Installation
section.This Python package is generated by the enable:Banking SDK generator usingSwagger Codegenproject.The interfaces are based onSTET PSD2 specification,
but have been modified and extended in order to support usage scenarious beyond
the original specification.RequirementsPython 3.4+certificryptographypython-dateutilInstallationIt's the easiest to install the package using the Python Package Installer:pipinstallenablebanking-apiIn order to download a connector module you have to submit the following request
to enablebanking.com website.curl-XPOST\-F'connector=Nordea'\-F'environment=sandbox'\-F'language=python'\-F'email=name@company.com'\https://enablebanking.com/connectors/List of connectors is availablehere.Do not useConnectorSettingpostfix in the connector field when submitting the
request, i.e. use justNordeainstead ofNordeaConnectorSettings.Download link will be sent to the email address you provide.UsageThe following code shows how to initialize API client for Nordea, authenticate
user and retrieve list of user's accounts.importenablebankingfromenablebanking.connectorsimportNordeaConnector# Creating API client for Nordeaclient=enablebanking.ApiClient(NordeaConnector,{'sandbox':True,'consentId':None,'accessToken':None,'refreshToken':None,'redirectUri':'https://your.domain/callback','country':'FI','clientId':'your-nordea-api-client-id','clientSecret':'your-nordea-api-client-secret','signKeyPath':'/path/to/eidas-key.pem',})# Creating authentication API accessorauth_api=enablebanking.AuthApi(client)# Getting authentication URL, which the user shall visitauth=auth_api.get_auth(state='test',# state to pass to redirect URL)print('User authentication URL:',auth.url)# Extracting authorization code from the redirect URLcode=auth_api.parse_redirect_url(# Using hardcoded value here. In reality redirect URL shall be read'https://your.domain/callback?query-params#hash-params')# Making user tokentoken=auth_api.make_token('authorization_code',code,auth.env)# Creating account information API accessor. Using same client instance already# holding user token. In stateless web app client likely needs to be re-created# with a token from the previous step.aisp_api=enablebanking.AispApi(client)# Retrieving list of user's accountsacc_data=aisp_api.get_accounts()foraccinacc_data.accounts:print('Account IBAN:',acc.account_id.iban)The complete code sample is available inthis Github
repository.Feel free to send us your technical questions atopenbanking@enablebanking.comor ask them
onStack Overflow.DocumentationThe latest reference documentation for the Python library is availablehere.ChangelogChangelog is availablehere.LicenseIf you have a license agreement with Enable Banking Oy covering this software, it
supercedes any other license bundled with this package.If you don't have such a license agreement, you may use this software only if the
following conditions are met:You do not modify or alter any of the files included into this software package;You do not distribute the software on its own, nor as part of other application;You do not sell or receive any consideration for this software, nor for other
software where this software package is used;You are solely responsible for determining the appropriateness of using the
software and assume any risks associated with your exercise of permissions to
use this software (i.e. the software is provided on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND).Enable Banking Oy provides commercial licenses for purchase for various usage
scenarios that are not covered by the above conditions. Please contact us athello@enablebanking.com, we'll be happy to help
you.AuthorEnable Banking OyFor more information, please visithttps://enablebanking.com