sdk / com.bittiq.sdk / BittiqSdk

BittiqSdk

class BittiqSdk

The entry point of the Bittiq SDK.

Obtain an instance of this class by calling #getInstance.

Functions

cancelPayment

fun cancelPayment(consentId: String): BittiqTask<Unit>

Cancel payment

cancelSubscriptions

fun cancelSubscriptions(subscriptionIds: Array<String>): BittiqTask<List<Subscription>>

Cancel one or more subscriptions. Subscriptions will not be canceled until the user confirms this from the email that will be send as a result of this call.

cancelVeriffSession

fun cancelVeriffSession(): BittiqTask<Unit>

Cancel Veriff session.

changePin

fun changePin(oldPin: String, newPin: String): BittiqTask<Profile>

Change the users PIN. For this to succeed, the user needs to be authenticated. If that's not the case you probably want to use the resetPin function which sends an email to the user to reset it's PIN.

checkSdkVersion

fun checkSdkVersion(): BittiqTask<Unit>

Can be called to make sure that the current version of the Bittiq SDK is still valid. When the version of this SDK is deprecated, the call will return an error.

clearTokens

fun clearTokens(): BittiqTask<Unit>

Clears the users tokens. It's recommended to execute this task when your user is logged out from your app so that the sdk can clean up the tokens. Any method that's called after this will use the TokenResolver, if provided during initialization of the sdk, to get new tokens.

confirm

fun confirm(type: ConfirmationType, result: Boolean): BittiqTask<Unit>

Track confirmations given by the user for various types. The provided data is only used for audit trail purposes.

createInvestmentAccount

fun createInvestmentAccount(number: String, bankAccountId: String, type: InvestmentAccountType): BittiqTask<InvestmentAccount>

Create investment account

createPayment

fun createPayment(bankAccountId: String, creditor: String?, debtor: String?, amount: BigDecimal, fund: String?, investmentAccount: String?, description: String?, currencyIsoCode: String = "EUR"): BittiqTask<String>

Create payment

createSubscription

fun createSubscription(transactionId: String, subscriptionName: String? = null, amount: Float? = null, frequency: SubscriptionFrequency = SubscriptionFrequency.OTHER): BittiqTask<Subscription>

Mark a transaction as a subscription.

deleteAllConsents

fun deleteAllConsents(): BittiqTask<Unit>

Deletes all consents.

deleteConsent

fun deleteConsent(consentId: String): BittiqTask<Unit>

Deletes a consent.

deleteInvestmentAccount

fun deleteInvestmentAccount(investmentAccountId: String): BittiqTask<Unit>

Remove investment account

deleteSubscription

fun deleteSubscription(subscriptionId: String): BittiqTask<Unit>

Delete a subscription.

findBankAccounts

fun findBankAccounts(startAt: Date? = null, endAt: Date? = null): BittiqTask<List<BankAccount>>

Get the list of the users active provider accounts.

findConsents

fun findConsents(): BittiqTask<List<Consent>>

Get a list of the users current consents.

findConsentsByStatus

fun findConsentsByStatus(statuses: List<ConsentStatus>): BittiqTask<List<Consent>>

Get a list of the users current consents with specific statuses.

findSubscriptions

fun findSubscriptions(accountIds: Array<String>? = null): BittiqTask<List<Subscription>>

Get the users subscriptions.

findTransactionsBySubcategory

fun findTransactionsBySubcategory(subcategoryId: String, accountIds: Array<String>? = null, limit: Int? = null, cursor: String? = null): BittiqTask<PagedData<List<Transaction>>>

Get the transactions in a specific subcategory.

finishConsent

fun finishConsent(data: Uri): BittiqTask<String>

Finalizes the consent flow. If successful returns the consent id which can be used to retrieve the consent status using getConsent.

getAllCategories

fun getAllCategories(): BittiqTask<List<TransactionCategory>>

Get an overview of all available categories and their subcategories.

getAllProviders

fun getAllProviders(): BittiqTask<List<Provider>>

Get the available providers to which the user can connect using initializeConsent

getAverageExpenses

fun getAverageExpenses(accountIds: Array<String>? = null): BittiqTask<AverageExpenses>

Get user's average expenses.

getBankAccount

fun getBankAccount(accountId: String): BittiqTask<BankAccount>

Get the details of a users provider account.

getConfirmations

fun getConfirmations(): BittiqTask<List<Confirmation>>

Get the list of the all user's confirmations of the consents

getConsent

fun getConsent(consentId: String): BittiqTask<Consent>

Get the details of a consent.

getDevice

fun getDevice(): BittiqDevice

Get BittiqDevice

getEventSettings

fun getEventSettings(): BittiqTask<EventSettings>

Get event settings.

getFinancialOverview

fun getFinancialOverview(accountIds: Array<String>? = null, type: FinancialType? = FinancialType.Expenditure, startAt: Date? = null, endAt: Date? = null): BittiqTask<FinancialOverview>

Get the users financial overview.

getFinancialOverviewByCategory

fun getFinancialOverviewByCategory(accountIds: Array<String>? = null, type: FinancialType? = FinancialType.Expenditure, startAt: Date? = null, endAt: Date? = null): BittiqTask<List<TransactionCategory>>

Get a categorized overview of the users finances.

getFinancialOverviewForCategory

fun getFinancialOverviewForCategory(categoryId: String? = null, accountIds: Array<String>? = null, type: FinancialType? = FinancialType.Expenditure, startAt: Date? = null, endAt: Date? = null): BittiqTask<TransactionCategory>

Get the users financial overview in the specified category.

getFinancialSummaryForPeriod

fun getFinancialSummaryForPeriod(accountIds: Array<String>? = null, startAt: Date? = null, endAt: Date? = null): BittiqTask<FinancialSummary>

Get financial statistics of the user.

getInvestmentAccounts

fun getInvestmentAccounts(): BittiqTask<List<InvestmentAccount>>

Get the list of the all user's investment accounts

getInvestmentFunds

fun getInvestmentFunds(): BittiqTask<List<InvestmentFund>>

Get the list of the all investment funds

getInvestmentGoal

fun getInvestmentGoal(): BittiqTask<InvestmentGoal>

Get user's investment goal.

getPayment

fun getPayment(consentId: String): BittiqTask<Payment>

Get payment

getProfile

fun getProfile(): BittiqTask<Profile>

Get profile.

getProvider

fun getProvider(providerId: String): BittiqTask<Provider>

Get the details of a provider.

getSubscription

fun getSubscription(subscriptionId: String): BittiqTask<Subscription>

Get the details of a subscription.

getTransaction

fun getTransaction(transactionId: String): BittiqTask<Transaction>

Get details of a specific transaction.

getTransactions

fun getTransactions(accountIds: Array<String>? = null, startAt: Date? = null, endAt: Date? = null, search: String? = null, limit: Int? = null, cursor: String? = null): BittiqTask<PagedData<List<Transaction>>>

Retrieve transactions.

getVeriffSessionUrl

fun getVeriffSessionUrl(): BittiqTask<String>

Initiate Veriff session.

initializeConsent

fun initializeConsent(providerCode: String, isPrivateAccount: Boolean): BittiqTask<Consent>

Instantiate a consent with a specified provider. A list of available providers can be retrieved through getAllProviders.

login

fun login(email: String, pin: String): BittiqTask<Profile>

Authenticate a user using email and PIN. This function may only be used when no TokenResolver was provided during the init of the BittiqSdk.

refreshAllPayments

fun refreshAllPayments(): BittiqTask<Unit>

Refresh all payments

refreshPayment

fun refreshPayment(consentId: String, code: String?): BittiqTask<Unit>

Refresh payment

register

fun register(verificationToken: String, email: String, firstName: String, lastName: String, pin: String, birthday: Birthday): BittiqTask<Profile>

Registers a new user. Before this method is called the users email address needs to be verified using verifyEmail. This function may only be used when no TokenResolver was provided during the init of the BittiqSdk. After this method is successfully executed the user is logged in.

registerForNotifications

fun registerForNotifications(deviceToken: String): BittiqTask<Unit>

Registers a device to start receiving remote push notifications.

resetPin

fun resetPin(email: String): BittiqTask<Unit>

Resets the users PIN. An email with a PIN reset link will be send to the users email address.

setPin

fun setPin(resetToken: String, pin: String): BittiqTask<Profile>

Set a user's new PIN after a reset of the PIN was requested. When this method is successfully executed the user is logged in.

unregisterFromNotifications

fun unregisterFromNotifications(deviceToken: String): BittiqTask<Unit>

Unregisters a device from receiving remote push notifications.

updateBankAccount

fun updateBankAccount(accountId: String, accountName: String): BittiqTask<BankAccount>

Update the name of a user's BankAccount.

updateEventSettings

fun updateEventSettings(negativeFreeSpace: Boolean?, freeSpaceGoalRatio: Boolean?, noInvestmentGoal: Boolean?, connectionExpiration: Boolean?): BittiqTask<EventSettings>

Update user's event settings.

updateInvestmentGoal

fun updateInvestmentGoal(amount: BigDecimal, isActive: Boolean, currencyIsoCode: String = "EUR"): BittiqTask<InvestmentGoal>

Update user's investment goal.

updateProfile

fun updateProfile(profile: UpdateProfile): BittiqTask<Profile>

Update the user's Bittiq profile. Important: Please make sure to always supply the correct value for each property and not only the ones that need to be changed, as this will result in the other properties being reset to null.

updateSubscription

fun updateSubscription(subscriptionId: String, name: String, frequency: SubscriptionFrequency, fee: BigDecimal, currencyIsoCode: String = "EUR"): BittiqTask<Subscription>

Updates a subscription.

updateTransactionSubcategory

fun updateTransactionSubcategory(transactionId: String, subcategoryId: String, comment: String? = null, updateSimilar: Boolean = false): BittiqTask<Transaction>

Update the subcategory of a Transaction.

verifyEmail

fun verifyEmail(email: String): BittiqTask<Unit>

Requests for a verification email to be sent to the given email address. The user will verify their email address directly to Bittiq, by clicking on the link in the email.

Companion Object Functions

getInstance

fun getInstance(): BittiqSdk

Returns an instance of the BittiqSdk.

init

fun init(context: Context, endpoint: String, apiKey: String, encryptionKey: String, salt: String, appVersion: String, debug: Boolean = false): BittiqSdkfun init(context: Context, endpoint: String, apiKey: String, encryptionKey: String, encryptionSalt: String, appVersion: String, tokenResolver: TokenResolver? = null, debug: Boolean = false, certificatePinningEnabled: Boolean = true): BittiqSdk

Initializes the BittiqSdk. This should only be done once in the app's lifetime.