Customer account management


Get customer account information


This method gets a customer’s account information.

This method requires customer authentication.

Note: 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
});

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.

Note: 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.

Note: 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
    });

Change customer’s account password


This method changes a customer’s password.

This method requires customer authentication.

Note: Returns the HTTP 403 status code if the provided old password is invalid.
Note: 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
    });

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.

Note: 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
email 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
});

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.

Note: 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
});

Delete customer account


This method deletes a customer’s account.

This method requires customer authentication.

Note: Returns the HTTP 403 status code is returned if the provided password is invalid.
Note: 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
});

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.

Note: Returns the HTTP 403 status code if the provided token or the password is invalid.
Note: 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
email 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
});

Confirm email change for customer account


This method confirms an email change.

This method is a global operation and doesn’t require customer authentication.

Note: Returns the HTTP 403 status code if the provided token is invalid.
Note: 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
  });

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.

Note: 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
});

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.

Note: Returns the HTTP 403 status code if the provided UUID does not exist or the password is invalid.
Note: 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
});
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker