Accounts API
object AccountsAPI
Provides coroutine and callback-based operations for managing accounts.
Functions
Link copied to clipboard
suspend fun confirmPhoneVerification(accountId: String, verificationId: String, request: AccountRequests.ConfirmPhoneVerificationRequest): Pair<AccountObjects.PhoneVerification?, NetworkingError?>
fun confirmPhoneVerification(accountId: String, verificationId: String, request: AccountRequests.ConfirmPhoneVerificationRequest, completionHandler: (AccountObjects.PhoneVerification?, NetworkingError?) -> Unit)
Confirms a phone verification using the code sent to the account holder.
Link copied to clipboard
suspend fun createAccount(request: AccountRequests.CreateAccountRequest): Pair<AccountObjects.Account?, NetworkingError?>
fun createAccount(request: AccountRequests.CreateAccountRequest, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Creates a new account and emits a Sift login event on success.
Link copied to clipboard
suspend fun createPhoneVerification(accountId: String): Pair<AccountObjects.PhoneVerification?, NetworkingError?>
fun createPhoneVerification(accountId: String, completionHandler: (AccountObjects.PhoneVerification?, NetworkingError?) -> Unit)
Initiates a phone verification for an account.
Link copied to clipboard
fun deleteAccountWith(accountId: String, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Deletes an account by ID.
Link copied to clipboard
suspend fun getAccounts(status: AccountObjects.AccountStatus? = null, type: AccountObjects.AccountType? = null, externalId: String? = null, includeDisabled: Boolean = false, page: Int? = null, perPage: Int? = null): Pair<AccountResponses.ListAccountsResponse?, NetworkingError?>
fun getAccounts(status: AccountObjects.AccountStatus? = null, type: AccountObjects.AccountType? = null, externalId: String? = null, includeDisabled: Boolean = false, page: Int? = null, perPage: Int? = null, completionHandler: (AccountResponses.ListAccountsResponse?, NetworkingError?) -> Unit)
Retrieves a paginated list of accounts, optionally filtered.
Link copied to clipboard
suspend fun getAccountWith(accountId: String, forTesting: Boolean = false): Pair<AccountObjects.Account?, NetworkingError?>
fun getAccountWith(accountId: String, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Retrieves a single account by ID and emits a Sift login event on success.
Link copied to clipboard
suspend fun getPlaidLinkToken(accountId: String): Pair<AccountResponses.PlaidLinkTokenResponse?, NetworkingError?>
fun getPlaidLinkToken(accountId: String, completionHandler: (AccountResponses.PlaidLinkTokenResponse?, NetworkingError?) -> Unit)
Retrieves a Plaid Link token for the given account to initiate a bank-account connection flow.
Link copied to clipboard
fun restrictAccount(accountId: String, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Restricts an account, preventing it from processing payments.
Link copied to clipboard
suspend fun searchAccounts(email: String? = null, externalId: String? = null, type: AccountObjects.AccountType? = null, status: AccountObjects.AccountStatus? = null, createdBefore: String? = null, createdAfter: String? = null): Pair<AccountResponses.SearchAccountsResponse?, NetworkingError?>
fun searchAccounts(email: String? = null, externalId: String? = null, type: AccountObjects.AccountType? = null, status: AccountObjects.AccountStatus? = null, createdBefore: String? = null, createdAfter: String? = null, completionHandler: (AccountResponses.SearchAccountsResponse?, NetworkingError?) -> Unit)
Searches for accounts matching the given criteria.
Link copied to clipboard
fun unrestrictAccount(accountId: String, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Removes a restriction from an account.
Link copied to clipboard
suspend fun updateAccount(accountId: String, request: AccountRequests.UpdateAccountRequest): Pair<AccountObjects.Account?, NetworkingError?>
fun updateAccount(accountId: String, request: AccountRequests.UpdateAccountRequest, completionHandler: (AccountObjects.Account?, NetworkingError?) -> Unit)
Updates an existing account.