Skip to main content
Version: Next

iOS Business User APIs

Business user APIs for authentication and account management. Access these APIs through vipaso.user.business.

Authentication

Login

Authenticate a business user with email and password. Business accounts are created through Vipaso's registration process:

let request = LoginRequest(identifier: email, password: password)
vipaso.user.business.login(request: request) { result in
switch result {
case .success:
// Business user successfully logged in
// Authentication state change will be sent via delegate
case .failure(let error):
// Handle login error
print("Login failed: \(error.localizedDescription)")
}
}

Logout

Log out the current business user:

vipaso.user.business.logout()
// Authentication state change will be sent via delegate

Business User Data

Fetch Business Details

Get information about the business user associated with the current business user:

vipaso.user.business.fetchUser { result in
switch result {
case .success(let response):
let user = response.user
// Access user.id, user.name, user.currency, etc.
print("Business user: \(user.name ?? "Unknown")")
case .failure(let error):
print("Fetch business user failed: \(error.localizedDescription)")
}
}

Notes

  • Business accounts are created through Vipaso's registration process, not through the SDK