---
description: User wallet
---

# Wallet

Each Dentity user will have a corresponding wallet. This wallet will be used to save credentials that are issued by the issuer through Dentity. You can see more about how a credential is added to a wallet [here](credential).

{% hint style="info" %}
A user will be created when you call API to create a wallet successfully. If the user already has a Dentity wallet, the API will return the wallet ID.
{% endhint %}

## Create Wallet&#x20;

<mark style="color:green;">`POST`</mark> `https://api.dentity.com/core/api/v1/programmatic/wallet`

This is the first step in the process. A Dentity wallet must be created before any credentials can be issued to the wallet holder. &#x20;

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                          | Type   | Description                                                                                    |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------- |
| firstName<mark style="color:red;">\*</mark>   | String | First name                                                                                     |
| phoneNumber<mark style="color:red;">\*</mark> | Object | <p>Phone number<br>{</p><p>    "dialCode": "+1", </p><p>    "phone": "2048089972"<br>}<br></p> |
| email<mark style="color:red;">\*</mark>       | String | Email                                                                                          |
| lastName<mark style="color:red;">\*</mark>    | String | Last name                                                                                      |

{% tabs %}
{% tab title="200: OK Create a new wallet successfully. User wallet address will be returned." %}
```javascript
{
   walletId: "62ccf87d452c6c3ab43a815e"
}
```
{% endtab %}

{% tab title="400: Bad Request Occurs when a phone number or email already exists in the Dentity system or when the wrong data type is entered." %}
```javascript
{
   message: "User email or phone number already exists or wrong data type"
}  
```
{% endtab %}

{% tab title="500: Internal Server Error Please contact the Dentity system administrator as soon as possible" %}
```javascript
{
    // Response
}
```
{% endtab %}
{% endtabs %}
