Registration

To allow a user to sign up to the B2Core UI, you need to select which fields are displayed to the user on the registration form. To do this, initialize the Sign Up Wizard and configure the custom form validation rules.

POST[host]/api/v2/my/signup/wizard

Initialize the Sign Up Wizard

POST[host]/api/v2/my/signup

Sign up to the B2Core UI

Initialize the Sign Up Wizard

Use this method to initialize the Sign Up Wizard for a user and specify the fields displayed on the user registration form.

Request

Body:

wizard string

The universally unique identifier (UUID) assigned to the registration wizard.

utm object

The details about the UTM parameters included in the client registration link.

Show object fields
utm_source string

The website which the client came from.

utm_medium string

The marketing channel that brought the client.

utm_campaign string

The promotion or strategic campaign.

utm_content string

The element that was clicked by the client.

utm_term string

The keyword associated with the campaign.

utm_uri string

The URI of the website which the client came from.

utm_referral string

The referral code that determines the client registration link address.

gclid string

The Google Click identifier passed to the client registration link.

POST[host]/api/v2/my/signup/wizard

curl --location --request POST 'https://host.name/api/v2/my/signup/wizard' \
--data-raw '{
  "wizard": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "utm": {
    "utm_source":"google.com"
    "utm_medium":"cpc"
    "utm_campaign":"spring_sale"
    "utm_content":"logolink"
    "utm_term":"ETH"
    "utm_uri":"https://www.google.com/page?utm_content=logolink&utm_medium=cpc&utm_source=google.com&utm_campaign=spring_sale"
    "utm_referral":"29734fc149dc93809d18f"
    "gclid":"Tester123#xyz"
    "referral": "29734fc149dc93809d18f49ae970810a"
  }
}'

Response

code integer

An HTTP code specifying the current step in a progression of wizard pages:

  • HTTP code 200 for an intermediary step after which another page of an authentication form is displayed to a user

  • HTTP code 202 for a final wizard step signaling that user authentication succeeded

data object or null

Contains an object providing the following field:

fields object

An array of wizard fields displayed on a client registration form.

done boolean

If true, the wizard initialization succeeded; otherwise, false.

uuid string

The universally unique identifier (UUID) assigned to a client authentication session.

workflow string

A string value indicating the next stage of an authentication procedure.

RESPONSE EXAMPLE
{
  "code": 202,
  "data": {
    "fields": {}
  },
  "done": true,
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "workflow": "basic_register_form"
}

Sign up to the B2Core UI

Use this method to sign up to the B2Core UI.

Request

Body:

uuid string required

The universally unique identifier (UUID) assigned to a client authentication session.

email string required

The client email.

password string required

The client password.

password_confirmation string required

The repeatedly entered password for its confirmation.

device_fingerprint string required

The free-form JSON data (which includes the required user_agent field) generated by a client in the format of a Base64-encoded string that uniquely identifies a device from which a request is sent.

To learn how to get a device fingerprint, refer to Obtain a device fingerprint.

addresses object

A list of country codes indicating a client’s location.

info object

An object specifying a client name:

Show object fields
familyName string

The client last name.

givenName string

The client first name.

recaptchaResponse string

The reCAPTCHA response token.

POST[host]/api/v2/my/signup

curl --location --request POST 'https://host.name/api/v2/my/signup' \
--data-raw '{
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "email": "foo@bar.com",
  "password": "Secret123",
  "password_confirmation": "Secret123",
  "device_fingerprint": "dwqdnNFJBOEBFJEBjqewbkjqbdwjqwbndjnbj",
  "addresses": {
    "0": {
      "country_code": "16"
    }
  },
  "info": {
    "familyName": "Brown",
    "givenName": "John"
  },
  "recaptchaResponse": "ut nu"
}'

Response

code integer

An HTTP code specifying the current step in a progression of wizard pages:

  • HTTP code 200 for an intermediary step after which another page of an authentication form is displayed to a user

  • HTTP code 202 for a final wizard step signaling that user authentication succeeded

  • HTTP code 400 for an invalid authentication request

data object or null

The access token and refresh token data:

Show object fields
token string

The access or refresh token.

createdAt string

The date and time when a token was generated.

expiresAt string

The date and time when a token is due to expire.

done boolean

If true, authentication has succeeded; otherwise, false.

uuid string

The universally unique identifier (UUID) assigned to a client authentication session.

workflow string

A string value indicating the current stage of an authentication procedure.

RESPONSE EXAMPLE
{
  "code": 202,
  "data": {},
  "done": true,
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "workflow": "login"
}