getAccounts

Provides information about all the sub-accounts that the user has in their bank account.

Parameters

Method does not receive any parameter.

Example

connection.getAccounts(
	onSuccess = { accounts ->  
                      
	}, 
	onFailure = { error -> 
                            
})
connection.getAccounts((accounts) -> {
    return null;
}, (error) -> {
    return null;
});

Response

Response Example


Present Account Selection

Open Dapi's Accounts Screen to allow your user to select an account and get the result via DapiAccountSelectionCallback

connection.presentAccountSelection(object : DapiAccountSelectionCallback {

      override fun onSelected(result: DapiAccountSelectionResult.Success) {
          val account = result.account
      }
  
      override fun onFailure(result: DapiAccountSelectionResult.Error) {
          val error = result.error
      }
  
      override fun onDismissed() {
          //The user manually dismissed the Accounts Screen (Selection not confirmed)      
      }

})


getIdentity

Get the identity information that has been confirmed by the bank.

These are the identity details that you will get. Not all banks provide all this data. So we will provide as much of it as possible.

Parameters
Method does not receive any parameter.

Example

connection.getIdentity(
	onSuccess = { identity ->  
                        
	}, onFailure = { error ->
                        
})
connection.getIdentity((identity) -> {
    return null;
}, (error) -> {
    return null;
});

Response

Response Example


getCards

A method for obtaining and displaying credit cards of the user

Parameters
Method does not receive any parameter.

Example

connection.getCards(
        onSuccess = {

        }, onFailure = {

})
connection.getCards((cards) -> {
    return null;
}, (error) -> {
    return null;
});

Response

Response Example


Account - getTransactions

A method for obtaining and displaying transactions created from users bank accounts. The list will not be filtered. In other words, this will display all the transactions performed by the user from the specified account (not filtered by app).

Parameters

ParameterDescription
accountAccount from where the transaction was performed
fromDateStart date of transactions history range
toDateEnd date of transactions history range
typeEnum to specify transactions type.

DapiTransactionsType.ENRICHED -> Each transaction object will have category and brandDetails properties.

DapiTransactionsType.CATEGORIZED -> Each transaction object will have category property.

DapiTransactionsType.DEFAULT -> category and brandDetails won't be included in the response.

Example

connection.getTransactions(
	account = connection.accounts!!.first(),
	fromDate = Date(),
	toDate = Date(),
  type = DapiTransactionsType.DEFAULT,
	onSuccess = { transactions -> 

	},
	onFailure = { error -> 

	})
connection.getTransactions(connection.getAccounts().get(0), new Date(), new Date(), (transactions) -> {
    return null;
}, (error) -> {
    return null;
});

Response

Response Example


Card - getTransactions

A method for obtaining and displaying transactions created from a card. The list will not be filtered. In other words, this will display all the transactions performed by the user from the specified account (not filtered by app).

Parameters

ParameterDescription
cardCredit card from where the transaction was performed
fromDateStart date of transactions history range
toDateEnd date of transactions history range
typeEnum to specify transactions type.

DapiTransactionsType.ENRICHED -> Each transaction object will have category and brandDetails properties.

DapiTransactionsType.CATEGORIZED -> Each transaction object will have category property.

DapiTransactionsType.DEFAULT -> category and brandDetails won't be included in the response.

Example

connection.getTransactions(
	card = connection.cards!!.first(),
	fromDate = Date(),
	toDate = Date(),
  type = DapiTransactionsType.DEFAULT,
	onSuccess = { transactions -> 

	},
	onFailure = { error -> 

	})
connection.getTransactions(connection.getCards().get(0), new Date(), new Date(), (transactions) -> {
    return null;
}, (error) -> {
    return null;
});

Response

Response Example

πŸ“˜

Note

Date range of the transactions that can be retrieved varies for each bank. The range supported by the users bank is shown in the response parameter transactionRange of Get Accounts Metadata endpoint. If the date range you provide is bigger than the transactionRange you'll get INVALID_DATE_RANGE error.

To make sure you always send a valid date range you should check the transactionsRange.
Example:

private fun getTransactionsForNumberOfMonths(numberOfMonths: Int) {
    val days = numberOfMonths * 30
    val calendar = Calendar.getInstance()
    connection.getAccountsMetaData(onSuccess = { response ->
        val transactionRange = response.accountsMetadata.transactionRange
        val unit = transactionRange?.unit
        val value = transactionRange?.value
        if (unit == null || value == null) {
            //Can't check transactions range..
        } else {
            val multiplier = if (unit == "years") 365 else if (unit == "months") 30 else 1
            val transactionRangeValueInDays = value * multiplier
            val fromDate = if (transactionRangeValueInDays > days) {
                //numberOfMonths is within the transaction range
                calendar.add(Calendar.DAY_OF_YEAR, -days)
                calendar.time
            } else {
                //numberOfMonths is NOT within the transaction range, so we query only for the allowed range
                calendar.add(Calendar.DAY_OF_YEAR, -transactionRangeValueInDays.toInt())
                calendar.time
            }
            connection.getTransactions(
                account = connection.accounts.first(),
                fromDate = fromDate,
                toDate = Date(),
                type = DapiTransactionsType.DEFAULT,
                onSuccess = { response ->
                    val transactions = response.transactions
                },
                onFailure = { error ->
                    //handle error
                }
            )
        }
    }, onFailure = { error ->
        //handle error
    })
}