Getting Started with Financial Aggregation
This guide will get you all set up and ready to use the Kernel API for financial aggregation. We'll look at where to go next to find all the information you need to take full advantage of our powerful REST API.
Activate Institutions
Before you can start connecting customers, you need to activate the institutions you want to connect to. Currently, institutions need to be activated by Kernel. Please reach out to us to get started.
Create a Customer
The first step to using the Financial Aggregation APIs is to create a customer. A customer is the representation of a user in the Kernel system.
To create a customer, you need to make a POST request to the /v1/customers
endpoint. This will create a new customer in the Kernel system.
import KernelClient from "@kernelpay/sdk";
const client = KernelClient.create(apiKey);
await client.customers.create({
identity: {
first_name: "John",
last_name: "Doe",
},
});
For more information about the parameters available for this call, refer to the API Reference
Create a Connection
The creation of a connection in the Kernel System can be performed using two methods:
- Bank Selection Webview: We provide a easy-to-use webview that you can redirect your customers to. This is the easiest way to create a connection without having to worry about the details of the API.
- Using the API: If you want more control over the connection process, you can use the API directly. This allows you to customize the connection process to fit your needs.
Using the Bank Selection Webview
To create a connection using the webview, you need to make a POST request to the /v1/aggregation_connections/generic
endpoint with the customer_id
and optionally the region
of the customer. This will return a URL that you can redirect your customer to.
import KernelClient from "@kernelpay/sdk";
const client = KernelClient.create(apiKey);
await client.aggregation_connections.generic({
customer_id: "cus_...",
region: "ES",
});
Using the API
To create a connection using the API, you need to make a POST request to the /v1/aggregation_connections
endpoint with the customer_id
and aggregation_institution_id
parameters set. This will return a connection object that you can use to get the connection status and redirect the user to the UI to introduce the credentials.
import KernelClient from "@kernelpay/sdk";
const client = KernelClient.create(apiKey);
await client.aggregation_connections.create({
customer_id: "cus_...",
aggregation_institution_id: "ai_...",
});
Once the credentials are created, you can forward the user to the authentication_url
where they'll find the form below to provide their username/password to the bank to complete the connection process.
Connection Lifecycle
More information regarding the connection lifecycle can be found here.
Understanding the entities
More info here