# Create a user with a registration code

Wise uses email address as unique identifier for users. If email is new (there is no active user already) then a new user will be created.

When you are submitting an email which already exists amongst our users then you will get a warning that "You're already a member. Please login". If user already exists then you need to redirect to "Get user authorization" webpage.

Endpoint: POST /v1/user/signup/registration_code
Security: ClientCredentialsToken

## Request fields (application/json):

  - `email` (string, required)
    New user's email address.
    Example: "user@email.com"

  - `registrationCode` (string, required)
    Randomly generated registration code that is unique to this user and request. At least 32 characters long.
You need to store registration code to obtain access token on behalf of this newly created user in next step.
Please apply the same security standards to handling registration code as if it was a password.
    Example: "a]#Et6(yLW@mq4Ky_+EAjXxpHGq7*&lr"

  - `language` (string)
    User default language for UI and email communication.
Allowed values: EN, US, PT, ES, FR, DE, IT, JA, RU, PL, HU, TR, RO, NL, HK.
Default value: EN.
    Example: "EN"

## Response 200 fields (application/json):

  - `id` (integer)
    User ID.
    Example: 101

  - `name` (string,null)
    User's full name.
    Example: "Example Person"

  - `email` (string)
    User's email.
    Example: "person@example.com"

  - `active` (boolean)
    If user is active or not.
    Example: true

  - `details` (object,null)
    User details.

  - `details.firstName` (string)
    User's first name.
    Example: "Example"

  - `details.lastName` (string)
    User's last name.
    Example: "Person"

  - `details.phoneNumber` (string)
    Phone number.
    Example: "+37111111111"

  - `details.dateOfBirth` (string)
    Date of birth (YYYY-MM-DD).
    Example: "1977-01-01"

  - `details.occupation` (string)
    Person's occupation.

  - `details.avatar` (string)
    Link to person avatar image.
    Example: "https://lh6.googleusercontent.com/photo.jpg"

  - `details.primaryAddress` (integer)
    Address object ID to use in addresses endpoints.
    Example: 111

  - `details.address` (object)
    User's address.

  - `details.address.countryCode` (string)
    Address country code in 2 digits. "US" for example.
    Example: "EE"

  - `details.address.firstLine` (string)
    Address first line.
    Example: "Road 123"

  - `details.address.postCode` (string)
    Address post code.
    Example: "11111"

  - `details.address.city` (string)
    Address city name.
    Example: "Tallinn"

  - `details.address.state` (string)
    Address state code. Required if country is US, CA, AU, or BR.

  - `details.address.occupation` (string)
    User occupation. Required for US, CA, JP.

## Response 409 fields (application/json):

  - `errors` (array)

  - `errors.code` (string)

  - `errors.message` (string)

  - `errors.path` (string)

  - `errors.arguments` (array)


