Get customer account information
This method gets a customer’s account information.
This method requires customer authentication.
The API key must have the 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<void> getAccount({required void Function(ClientAccountInformation) onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| onSuccess | Function(ClientAccountInformation clientAccountInformation) | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.getAccount(onSuccess: (ClientAccountInformation result) {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Declaration:
Future<ClientAccountInformation> getAccount() async
Return Value:
ClientAccountInformation
Example:
final ClientAccountInformation clientAccountInformation = await Synerise.client.getAccount().catchError((error)
Update customer account basic information
This method updates a customer’s account’s basic information (without identification data: uuid, customId, email).
This method requires the context object with the customer’s account information. Omitted fields are not modified.
This method does not require customer authentication and can be used by anonymous profiles.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.22.0 | 5.21.0 | 0.24.0 | 1.4.0 |
The API key must have the API_BASIC_INFORMATION_CLIENT_UPDATE permission from the Client group.
Declared In:
lib/modules/client/client_impl.dart
Related To:
ClientAccountUpdateBasicInformationContext
Class:
ClientImpl
Declaration:
Future<void> updateAccountBasicInformation(ClientAccountUpdateBasicInformationContext context,
{required void Function() onSuccess,
required void Function(SyneriseError error) onError}) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| context | ClientAccountUpdateBasicInformationContext | yes | - | Object with customer’s first name, phone, and other optional data |
| onSuccess | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
ClientAccountUpdateBasicInformationContext context = ClientAccountUpdateBasicInformationContext(
email: email,
password: password,
firstName: firstName,
lastName: lastName,
sex: ClientSex.getClientSexFromString(sex));
await Synerise.client.updateAccountBasicInformation(clientAccountUpdateContext, onSuccess: () {
//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.
The API key must have the 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 | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> updateAccount(ClientAccountUpdateContext context) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| context | ClientAccountUpdateContext | yes | - | Object with customer's email, password, and other optional data |
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).catchError((error) {
//onError handling
});
Change customer's account password
This method changes a customer’s password.
This method requires customer authentication.
Returns the HTTP 403 status code if the provided old password is invalid.
The API key must have the 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 | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> changePassword(String oldPassword, String password) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| newPassword | String | yes | - | Customer’s new password |
| oldPassword | String | yes | - | Customer’s old password |
Return Value:
No value is returned.
Example:
await Synerise.client.changePassword(oldPassword, password).catchError((error)
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.
The API key must have the 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 | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> requestPasswordReset(String email) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Customer’s email |
Return Value:
No value is returned.
Example:
await Synerise.client.requestPasswordReset(email).catchError((error)
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.
The API key must have the 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 | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> confirmPasswordReset(String password, String token) async
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Customer’s email | |
| token | String | yes | - | Customer's token provided in an email |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmPasswordReset(email, token).catchError((error)
Delete customer account
This method deletes a customer's account.
This method requires customer authentication.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| Deprecated in: | 3.6.19 | 3.6.19 | 0.14.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | n/a | n/a |
Returns the HTTP 403 status code is returned if the provided password is invalid.
The API key must have the 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 | Function() | yes | - | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> deleteAccount(String clientAuthFactor, IdentityProvider identityProvider, String? authId) 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 | yes | null | Optional identifier of authorization |
Return Value:
No value is returned.
Example:
await Synerise.client.deleteAccount(clientAuthFactor, identityProvider, authId).catchError((error)
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.
Returns the HTTP 403 status code if the provided token or the password is invalid.
The API key must have the 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 | Function() | yes | - |
| onError | Function(SyneriseError error) | 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
});
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> requestEmailChange(String email, String password, [String? externalToken, String? authID]) 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 |
Return Value:
No value is returned.
Example:
await Synerise.client.requestEmailChange(email, password).catchError((error) {
Confirm email change for customer account
This method confirms an email change.
This method is a global operation and doesn't require customer authentication.
Returns the HTTP 403 status code if the provided token is invalid.
The API key must have the 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 | Function() | yes | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> confirmEmailChange(String token, bool newsletterAgreement) 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 |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmEmailChange(token, true).catchError((error) {
Request phone update on customer account
This method 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.
The API key must have the 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 | Function() | yes | - |
| onError | Function(SyneriseError error) | yes | - |
Return Value:
No value is returned.
Example:
await Synerise.client.requestPhoneUpdate(phone, onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Declaration:
Future<void> requestPhoneUpdate(String phone) async
Parameters:
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| phone | String | yes | Customer's new phone number |
Return Value:
No value is returned.
Example:
await Synerise.client.requestPhoneUpdate(phone).catchError((error) {
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.
Returns the HTTP 403 status code if the provided UUID does not exist or the password is invalid.
The API key must have the 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 | Function() | yes | Function to be executed when the operation is completed successfully |
| onError | Function(SyneriseError error) | 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
});
Declaration:
Future<void> confirmPhoneUpdate(String phone, String confirmationCode, bool smsAgreement) 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 |
Return Value:
No value is returned.
Example:
await Synerise.client.confirmPhoneUpdate(phone, confirmationCode, true).catchError((error) {