Welcome to Dapi

Here you will find comprehensive documentation to help you integrate with Dapi's API as quickly as possible, as well as support if you get stuck. Get started below!

Get Started    

SDK Client (Android)

This guide will show you how to integrate DapiConnect SDK for Android and use its components to interact with the API.

Overview

Introduction

Dapi for Android is a prebuilt SDK that reduces the time it takes to integrate with Dapi's API and gain access to your users financial data.

The SDK provides direct access to Dapi endpoints and offers optional UI to manage users' accounts, subaccounts, balance and money transfer.

Requirements

Integration

dependencies {
    implementation 'com.dapi.connect:dapi:0.1.1'
}

How it works

DapiConnect SDK communicates with API endpoints to make network requests. Requests do NOT go to Dapi servers directly. Instead, requests first go to your server and then to Dapi servers. See the example gif below:

Sample Request Flow

This is a security feature that keeps control in your hands. Your server is responsible for maintaining access tokens by creating, storing, and refreshing them.

📘

Note

Dapi also provides an SDK for your server

Integration

DapiConnect SDK can be integrated with the following steps:

  1. Initialize the SDK in your Application class.
override fun onCreate() {
        super.onCreate()
        val appKey = YOUR_APP_KEY
        val dapiConfig = DapiConfig(
            BASE_URL,
            DapiEndpoints(
                endpoint1 = "",
                endpoint2 = "",
                ....
            )
        )
        Dapi.initialize(this, appKey, dapiConfig)
        Dapi.setUserID(USER_ID)

    }

📘

Note

For more information, see Authentication

  1. If you're NOT using the SDK-Server:

Dapi provides an SDK for your server to talk to Dapi-Android.
By default, Dapi-Android talks to endpoints specified in the Requests and Responses section of this documentation.

If your custom server uses different endpoint naming than those in Dapi docs: pass your endpoints to DapiConfig's dapiEndpoints property.

If your server's custom implementation uses different endpoint naming than those in Dapi docs, you'll need to pass the endpoints and optional extra headers, params and body to DapiConfig's dapiEndpoints property.

Components

1. DapiConnect

Responsible for showing credential input, authorization, authentication and a list of banks. You can receive callbacks by implementing OnDapiConnectListener interface.

val dapiConnect = DapiConnect()
     dapiConnect.present()
  1. Set up the interface with the following functions:
dapiConnect.setOnConnectListener(object  : OnDapiConnectListener{
        override fun onSuccess(accessID: String, bankID: String) {

        }

        override fun onFailure(error: DapiError, bankID: String) {

        }

        override fun createBeneficiaryOnConnect(bankID: String): DapiBeneficiaryInfo? {
            return DapiBeneficiaryInfo(//beneficiary info)
        }
    })

2. DapiAutoFlow

You can use autoflow to display the connected accounts, balance for each subaccount and a numpad to make a transaction.

val dapiAutoFlow = DapiAutoFlow()
     dapiAutoFlow.present()
dapiAutoFlow.setOnTransferListener(object : OnDapiTransferListener{
        override fun onTransferFailed(
            error: DapiError,
            senderAccountID: String?,
            recipientAccountID: String?
        ) {

        }

        override fun onTransferSucceeded(
            amount: Double,
            senderAccountID: String?,
            recipientAccountID: String?
        ) {

        }

        override fun onTransferCreated(
            bankID: String,
            isCreateBeneficiaryRequired: Boolean
        ): DapiBeneficiaryInfo {
            return DapiBeneficiaryInfo(//beneficiary info)
        }
    })
  1. DapiPayment

You can use DapiPayment to use our functions separately and build your own flow and UI.

For example:

val dapiPayment = DapiPayment(accessID) //You can find accessID for any connected account using `getConnections()` in `DapiConnect`
    dapiPayment.getAccounts(onSuccess = {
        
    }, onFailure = {
        
    })
  • Get Identity information:
dapiPayment.getIdentity(onSuccess = {
        
    }, onFailure = {
        
    })

Updated about a month ago

SDK Client (Android)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.