Customer account management
Get customer account information
This method gets a customer’s account information.
This method requires customer authentication.
API_PERSONAL_INFORMATION_CLIENT_READ
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Related To:
ClientAccountInformation
Class:
ClientImpl
Declaration:
Future<ClientAccountInformation> getAccount({required void Function(ClientAccountInformation) onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
ClientAccountInformation
Example:
await Synerise.client.getAccount(onSuccess: (ClientAccountInformation result) {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Update customer account information
This method updates a customer’s account information.
This method requires the context object with the customer’s account information. Omitted fields are not modified.
This method requires customer authentication.
API_PERSONAL_INFORMATION_CLIENT_UPDATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Related To:
ClientAccountUpdateContext
Class:
ClientImpl
Declaration:
Future<void> updateAccount(ClientAccountUpdateContext context,
{required void Function() onSuccess,
required void Function(SyneriseError error) onError}) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
context | ClientAccountUpdateContext | yes | - | Object with customer’s email, password, and other optional data |
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
ClientAccountUpdateContext clientAccountUpdateContext = ClientAccountUpdateContext(
email: email,
password: password,
firstName: firstName,
lastName: lastName,
sex: ClientSex.getClientSexFromString(sex));
await Synerise.client.updateAccount(clientAccountUpdateContext, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Change customer’s account password
This method changes a customer’s password.
This method requires customer authentication.
SAUTH_CHANGE_PASSWORD_CLIENT_UPDATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> changePassword(String oldPassword, String newPassword,
{required void Function() onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
oldPassword | String | yes | - | Customer’s old password |
newPassword | String | yes | - | Customer’s new password |
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.changePassword(oldPassword, newPassword, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Request password reset for customer account
This method requests a customer’s password reset with email. The customer will receive a token to the provided email address. That token is then used for the confirmation of password reset.
This method requires the customer’s email.
This method is a global operation and doesn’t require customer authentication.
SAUTH_PASSWORD_RESET_CLIENT_CREATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> requestPasswordReset(String email, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
String | yes | - | Customer’s email | |
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.requestPasswordReset(email, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Confirm password reset for customer account
This method confirm a customer’s password reset with the new password and token provided by password reset request.
This method requires the customer’s new password and the confirmation token received by e-mail.
This method is a global operation and doesn’t require customer authentication.
SAUTH_PASSWORD_RESET_CLIENT_CREATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> confirmPasswordReset(String password, String token, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
password | String | yes | - | New password for the customer |
token | String | yes | - | Customer’s token provided in an email |
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmPasswordReset(password, token, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Delete customer account
This method deletes a customer’s account.
This method requires customer authentication.
SAUTH_CLIENT_DELETE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Related To:
ClientIdentityProvider
Class:
ClientImpl
Declaration:
Future<void> deleteAccount(String clientAuthFactor, IdentityProvider identityProvider, {String? authId, required void Function() onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
clientAuthFactor | String | yes | - | Customer’s password or token from the identity provider |
identityProvider | ClientIdentityProvider | yes | - | Customer’s identity provider |
authID | String | no | null | Optional identifier of authorization |
onSuccess | void | yes | - | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.deleteAccount(clientAuthFactor, identityProvider, authId, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Request email change for customer account
This method requests a customer’s email change.
This method is a global operation and doesn’t require customer authentication.
SAUTH_CHANGE_EMAIL_CLIENT_UPDATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> requestEmailChange(String email, String password, {String? externalToken, String? authID, required void Function() onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
String | yes | Customer’s new email | |
password | String | yes | Customer’s password |
externalToken | String | no | Customer’s token (if OAuth, Facebook, and so on) |
authID | String | no | Optional identifier of authorization |
onSuccess | void | yes | - |
onError | SyneriseError | yes | - |
Return Value:
No value is returned.
Example:
await Synerise.client.requestEmailChange(email, password, externalToken: externalToken, authID: authID, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Confirm email change for customer account
This method confirms an email change.
This method is a global operation and doesn’t require customer authentication.
SAUTH_CHANGE_EMAIL_CLIENT_UPDATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> confirmEmailChange(String token, bool newsletterAgreement,
{required void Function() onSuccess,
required void Function(SyneriseError error) onError}) async
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
token | String | yes | Customer’s token provided in an email |
newsletterAgreement | bool | yes | Agreement for sending newsletters to the provided email |
onSuccess | void | yes | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmAccountActivationByPin(email, pinCode, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Request phone update on customer account
Requests a customer’s phone update. A confirmation code is sent to the phone number.
This method is a global operation and doesn’t require customer authentication.
API_PERSONAL_PHONE_CLIENT_CREATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> requestPhoneUpdate(String phone, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
phone | String | yes | Customer’s new phone number |
onSuccess | void | yes | - |
onError | SyneriseError | yes | - |
Return Value:
No value is returned.
Example:
await Synerise.client.requestPhoneUpdate(phone, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Confirm phone update on customer account
This method confirms a phone number update. This action requires the new phone number and confirmation code as parameters.
This method is a global operation and doesn’t require customer authentication.
API_PERSONAL_PHONE_CLIENT_CREATE
permission from the Client group.Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> confirmPhoneUpdate(String phone, String confirmationCode, bool smsAgreement, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async {
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
phone | String | yes | New phone number |
confirmationCode | String | yes | A confirmation code received by a text message |
smsAgreement | bool | yes | Agreement for sending SMS to the provided number |
onSuccess | void | yes | Function to be executed when the operation is completed successfully |
onError | SyneriseError | yes | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmPhoneUpdate(phone, confirmationCode, smsAgreement, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});