→ API Docs
The AHOI Open Banking API provides easy access to banks and payment service providers. The API can be used to retrieve account and deposit account information, execute transfers, determine forecasts, and more.
Get more information about the AHOI API and API docs here:
This Node.js module provides easy access to banks via the AHOI Open Banking API. The client module is designed to be used within an existing Node.js application. It extends it with the feature to get accesses to bank data such as account transactions or deposit data.
To simply try out the client or as a starting point for your own application, we recommend our demo application which uses this client:
npm install --save git+ssh://git@github.com:sparkassen-hub/ahoi-nodejs-client.git
Go to AHOI Demo-Account and register for a demo account.
To get account transactions for an user you have to manage five steps:
The following code snippets show how to technical implement the steps from creating a user in AHOI to retrieving account transactions.
A) Include the module in your code
// Typescript
import { AhoiApiFactory } from 'ahoi-nodejs-client';
// JavaScript
const { AhoiApiFactory } = require('ahoi-nodejs-client');
B) Add the configuration to access the AHOI API
// Configuration: see information below
const ahoiConfig = {
clientId: 'SBM_XXqaeX30T2D',
clientSecret: '2e066yXXXLxa3zn',
appSecretIv: 'mP3IdoOKxVzOQzX22IueXg',
appSecretKey: 'dGw6XXtcyryKqXeeHgqPTg',
cryptKey: 'ScL&aFPazDw6S#k3',
baseurl: 'https://banking-sandbox.starfinanz.de/ahoi/api/v2',
};
const ahoiApi = new AhoiApiFactory(ahoiConfig);
C) Create a new user in AHOI
// Get an installationid (and store it in your user management system)
const registrationApi: RegistrationApi = await ahoiApi.getRegistrationApi();
const installationId: RegistrationResponse = await registrationApi.register();
D) Let the use select a bank, get a list of banks before
// Get a list of(banking) providers
const providerApi: ProviderApi = await ahoiApi.getProviderApi(installationId);
const providers: Provider[] = await providerApi.getProviders();
E) Create bank access with PIN and username
The bank access is linked with the installationId
// Grant banking access by a user
const accessApi: AccessApi = await ahoiApi.getAccessApi(installationId);
// To grant banking access the user must provide the pin and username or customernumber. It differs
// from bank to to bank which data additionally to the pin are needed.
const access: Access = {
type: 'BankAccess',
providerId: provider[0].id,
accessFields: {
USERNAME: username,
CUSTOMERNUMBER: customernumber,
PIN: pin,
},
};
const allowedAccess: Access = await accessApi.postAccess(access);
E) Select accounts.
As AHOI initially fetches all accounts from a bank access, the accounts not selected by user must be deleted from AHOI.
// Delete banking accounts from AHOI or show as list
const accountApi: AccountApi = await ahoiApi.getAccountApi(installationId);
// accessid comes from banking access granted before: Access#id
const accounts: Account[] = await accountApi.getAccounts(allowedAccess.id);
await accountApi.deleteAccount(allowedAccess.id, accounts[0].id);
F) Show account transactions
// Show transactions for a bank account
const accessApi: AccessApi = await ahoiApi.getAccessApi(Server.INSTALLATION_ID);
const transactions: Asset[] = accessApi.listAssets(accessId, accountId, 30);
The AHOI access data (clientId, clientSecret, appSecretIv, appSecretKey) can be found in your AHOI (demo) account.
The cryptKey is used to encrypt the installationId internally before it is stored e.g. in a user mangement system. This way it is ensured, that the installationId for an user is always stored encrypted.
You can choose any password as cryptKey, but the recommended length is 32 chars.
To get transactions for a bank account, you have to grant access before. But for sure you don't want to use your real bank access data.
Exactly for this AHOI has (technically) created a demo bank called Sandbank. After registration at AHOI you have automatically two demo accounts at this bank. You'll find your access data (PIN and username) in your AHOI account.
When testing the client you should select as bank the 'Sandbank'. To grant access to the bank use the PIN and username from your AHOI account (see below).
An installationId is needed to fetch account data for an user. In AHOI it is not linked with a user but only with one or more accounts. Therefore the following procedure should be chosen:
# Build
npm run build
# Generate TS doc separate
npm run doc
Licensed under MIT.