> For the complete documentation index, see [llms.txt](https://stokn.gitbook.io/welcome-to-stokn.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stokn.gitbook.io/welcome-to-stokn.io/step-1-user-account-creation.md).

# Step 1 - User Account Creation

In this step, the Client will be able to create an account with a login and verify the ownership of the information (telephone number) he has provided through OTP.&#x20;

1 - As on any other application, the Client will have to create an account.&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/user/sign-up" method="post" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

OAuth: client\_auth

2 - The client will then be able to login using his e-mail and password:&#x20;

## Client can login to the application&#x20;

<mark style="color:green;">`POST`</mark>&#x20;

#### Path Parameters

| Name                                          | Type     | Description                                            |
| --------------------------------------------- | -------- | ------------------------------------------------------ |
| "username":<mark style="color:red;">\*</mark> | "string" | Client ads his username                                |
| "password"<mark style="color:red;">\*</mark>  | "string" | Client ads the password he chose in the previous step. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "success": true,
  "data": {},
  "errorCode": 0,
  "errorMessage": "string"
}
```

{% endtab %}
{% endtabs %}

OAuth: client\_auth

3 - The client then need to respond to an OTP challenge, i.e he will receive a text message which includes a 4 digit number that he will need to pasted into the Mobile App:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/user/otp" method="post" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

Responding to the OTP challenge correctly, will allow the user to receive an access token to access features (deposit, withdraw, convert).

OAuth: user\_auth

If this is not the case, it will be possible to refresh the OPT token using:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/user/refresh" method="post" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

4 - If the User loses his password, it is possible to generate a new one using:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/user/change-password" method="put" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

To validate the change of the password, the User will receive a new OTP challenge in the form as describe in point 3 above.&#x20;

You can add this OTP challenge using:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/user/forget-password" method="get" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

5 - Once the KYC process as been completed and validated for a retail client ([as described in step 2 below](/welcome-to-stokn.io/step-2-user-kyc.md)), the account will be validated and it will be possible to generate a Portfolio Id using:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/account/portfolio" method="post" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

OAuth: client\_auth

A portfolio Id is linked to a blockchain public address and several Portfolio Id can be generated for a same Account Id. <br>

6 - Please note that you will also be able to create manually an **AccountId** using:&#x20;

{% openapi src="/files/CxdhNANltvpAtSQ3ieEA" path="/v1/account" method="post" %}
[stokn\_api.json](https://4184423511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F50DZdVHQuJqLLMFS5pFA%2Fuploads%2FtArCzZFBOjwtLNo3PlL8%2Fstokn_api.json?alt=media\&token=f6fefe86-fbfd-49de-9419-503e5c449364)
{% endopenapi %}

OAuth: client\_auth

The PortfolioId will only be generated once the User has completed the KYC process ([as described in Step 2](/welcome-to-stokn.io/step-2-user-kyc.md)).&#x20;
