Customer registration

Customers can create accounts that let them authorize and perform operations such as redeeming coupons, making purchases, managing their own data, and more. The data is available for you to see and modify in the customer’s profile; the primary unique identifier in Synerise is the email address (unless configured differently, see Setting non-unique emails).

A customer can also exist in the database if they don’t have a self-managed account.

For more details on profiles, see Customer profiles.

Registering a customer with RaaS

Registration as a Service (RaaS) creates an account in Synerise without any third-party integrations. It may be configured to require email confirmation. The basic request only requires an email, password, an UUID, but you can provide additional information. See method reference.

curl --location --request \
POST 'http://api.synerise.com/sauth/clients/registered' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Version: 4.4' \
--header 'Authorization: Bearer eyJhb...Ndo' \
--data-raw '{
    "email":"sampleclient@synerise.com",
    "password":"strongpassword",
    "uuid":"b3f56868-9667-4843-a8e5-0509456baa9b",
}'

Alternatively, you can use the authentication endpoint.

Account activation

Synerise RaaS may be configured for three types of account confirmation:

  • Automatic: the account is ready to use immediately. The snrs_email_confirmed attribute in the customer is FALSE.
  • Email confirmation required: the account is ready to use, but confirmation is required to set the snrs_email_confirmed attribute in the customer profile to TRUE.
  • Email activation required: the account cannot be accessed until it is confirmed. Activation sets the snrs_email_confirmed attribute in the customer profile to TRUE.
  • PIN activation: the customer receives a PIN code instead of a confirmation link. Activation sets the snrs_email_confirmed attribute in the customer profile to TRUE.

Setting the activation method

WARNING: When changing the settings, any values you do not send are changed to default!
  1. Get the current settings for your business profile.
    Method reference available here.
    curl --location --request GET 'https://api.synerise.com/sauth/settings/general' \
    --header 'Authorization: Bearer eyJh...qU'
  2. From the response, copy the current settings.
  3. Change the copied settings and send an update request.
    Method reference available here. The following is an example of enabling PIN activation.
    Important: Remember about additional settings for each confirmation type, such as PIN length or confirmation redirect link.
    curl --location --request POST 'https://api.jsons.snrstage.com/sauth/settings/general' \
    --header 'Authorization: Bearer eyJ...JwqU' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "registrationType": "REQUIRE_PIN_CONFIRMATION",
        "tokenLifetimeInSeconds": 3600,
        "confirmationRedirectLink": null,
        "voucherPoolUuid": null,
        "allowOverwriteCustomIdentify": false,
        "allowEmailChangeFromWebForm": false,
        "pinConfirmationType": "ON_CONFLICT_WITH_EXTERNAL_ACCOUNT",
        "pinConfirmationLength": 6,
        "pinConfirmationValidInSeconds": 300,
        "allowPinResendFromDifferentDeviceId": false
    }'

Confirming the account by PIN

Confirming the account by PIN has two modes, selected with the pinConfirmationType setting:

  • ON_CONFLICT_WITH_EXTERNAL_ACCOUNT (default setting) requires the PIN only if an account with the same unique identifier already exists and was registered with a third-party Identity Provider.
  • EVERYONE requires the PIN for all registrations.

Activating/confirming the account

Method reference available here.

The activation request must always be sent from last device that requested a PIN. If you re-send a PIN from a different device than the one that sent the registration request, the activation request must be made from the device that requested re-sending the PIN.

Prerequisites

The PIN is sent to the customer’s email automatically after registration.

curl --request POST 
  --url https://api.synerise.com/sauth/clients/activation/by-pin-code/confirmation 
  --header 'Authorization: Bearer eyJ...JwqU' 
  --header 'content-type: application/json' 
  --data '{
    "deviceId":"5966145e-412d-44db-b826-7d53e6cfd300",
    "email":"john.doe@synerise.com",
    "pinCode":"123456",
    "uuid":"07243772-008a-42e1-ba37-c3807cebde8f"
    }'

Result: The account is activated/confirmed and ready to use.

Re-sending an activation/confirmation PIN

Method reference available here.

If the PIN expired, re-send it.

By default, you can only request the re-sending from the last device that requested a PIN previously. If you want to allow requesting a PIN from other devices, set allowPinResendFromDifferentDeviceId to TRUE.
The activation request can only be sent from the last device that requested a PIN, regardless of the settings.

Prerequisites

curl --request POST 
  --url https://api.synerise.com/sauth/clients/activation/by-pin-code/request 
  --header 'Authorization: Bearer eyJ...JwqU' 
  --header 'content-type: application/json' 
  --data '{
    "deviceId":"5966145e-412d-44db-b826-7d53e6cfd300",
    "email":"john.doe@synerise.com",
    "uuid":"07243772-008a-42e1-ba37-c3807cebde8f"
    }'

Result: The activation PIN is re-sent.

Activating/confirming the account

Method reference available here.

Prerequisites:
Email sender integration must be enabled.

The token is sent to the customer’s email automatically after registration.

curl --request POST 
  --url https://api.synerise.com/sauth/clients/activation/confirmation 
  --header 'authorization: Bearer eyJh...JxkM5o' 
  --header 'content-type: application/json' 
  --data '{
      "token":"eyJh...JwcR4z"
    }'

Result: The account is activated/confirmed and ready to use.

Requesting a new activation/confirmation token

Method reference available here.

Prerequisites:
Email sender integration must be enabled.

If the activation token expires or the message was not delivered, you can request a new token.

curl --request POST 
  --url https://api.synerise.com/sauth/clients/activation/request 
  --header 'authorization: Bearer eyJh...JxkM5o' 
  --header 'content-type: application/json' 
  --data '{
      "email":"sampleclient@synerise.com"
    }'

Result: The email with the token is re-sent.

Registering customers with third-party mechanisms

You can register a customer by using Facebook, Google sign-in, OAuth, or Sign in with Apple.

  • Registering a customer with Facebook Login requires that your application is integrated with Facebook. For more details, see the Facebook Developer Documentation.
  • Registering a customer with Sign in with Apple requires that your application is integrated with Sign in with Apple. For more details, see the Apple Developer Documentation.
  • Registering a customer with Google requires that your application is integrated with Google. For more details, see the Google Identity documentation.
  • Registering with OAuth creates a customer account in Synerise, but a customer account must also exist in your own database to serve as a basis for OAuth authentication.
Important: This endpoint can be used for logging in - if an account already exists, the response is a Synerise JWT that can be used for authorizing further requests as the customer.

The following is a basic request for Facebook authentication, but you can provide more information or change the Identity Provider. See method reference.

accessToken is the token that is sent by Synerise backend to your OAuth implementation.

curl --location --request \
POST 'https://api.synerise.com/sauth/auth/v2/login/client' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "apiKey":"01234abc-1234-5678-9abc-def012345678",
    "identityProvider": "FACEBOOK",
    "identityProviderToken": "70fb8a02-0a6e-48ca-96d5-0212ee140eae"
}'

The response is an authentication token.

😕

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