Create Bank Connection

Sandbox Environment Access

Our Sandbox environment allows you to simulate users and financial institutions with the full Dapi API workflow.
For more details check Get Started with Sandbox.

Bank Connection

Dapi Bank Connection is a tokenized access to one bank account. The Bank Connection parameters have to be used during all API calls.

A Bank Connection represents a user's connection to one bank. If the same user connects 2 banks on your application, there will be also 2 separate Bank Connection objects.

Bank Connection Using Connect Layer

All Bank Connections need to be established through Dapi's Connect Layer. Connect Layer is already embedded in the SDK and allows the users to choose the desired bank and provide their credentials.

var ba = null;

var handler = Dapi.create({
  environment: Dapi.environments.sandbox, //or .production
  // removed for examples purposes.
  onReady: function() {; // opens the Connect widget

As mentioned in previous examples invokes the opening of the Connect Layer widget.

1639 1639

You should listen to the onSuccessfulLogin and onFailedLogin callbacks in order to know whether the login succeeds or fails.

After a successful login, you get a bankAccount object, which includes all the necessary information for any consequent API calls:

  • Accessing the Data API endpoints:
  • Accessing the Payment API endpoints: ba.payment
  • etc.

Example for calling the Data API getIdentity endpoint after a successful bank connection:

onSuccessfulLogin: function(bankAccount) {
    ba = bankAccount;
      if (identityResponse.status === "done") {
        } else {
          console.error("API Responded with an error")
onFailedLogin: function(err) {
    if (err != null) {
    } else {
      console.log("No error");

Bank Connection From Cache or Database

Since the Web SDK supports local caching, you can get access to all the connected accounts on a particular clientUserID.



The clientUserID needs to be unique per user on your app. Otherwise, you will get access to all the bank accounts connected in that browser.

const bankAccounts = Dapi.getCachedBankAccounts("CLIENT_USER_ID")
const bankAccountParams = => bankAccount.flush())
// You can save this bankAccountParams on your server side

After you got access to these bankAccounts, you can optionally save them on your server for later use. For future initialization, you can get these from your server and initialize them one by one again.

//get bankAccountParams from your server
//initialize DapiBankAccount based on a bankAccountParam
var dapiBA = new DapiBankAccount(bankAccountParams[0])

You can then call the data and payment endpoints on the dapiBA variable.


All set!

That's it. You can use Bank Connection to collect data or initiate payments!

Account Metadata

A method for obtaining information about the user's bank. Useful for knowing special capabilities or restrictions for the specific financial institution.


clientHeadersObjectMore details
clientBodyObjectMore details

Check the Meta Data Response


     .then(metadataAccountsResponse => {
          if(metadataAccountsResponse.status === "done") {
          } else {
            console.error("API Responded with an error")
        .catch(error => {

What’s Next