> For the complete documentation index, see [llms.txt](https://docs.vaultid.com.br/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vaultid.com.br/workspace/wings/usuario-varejo/alteracao-tipo-usuario-varejo.md).

# Alteração Tipo Usuário Varejo

**A autenticação deve ser feita via** [**external client credentials**](/workspace/wings/autenticacao/credenciais-de-cliente-externo.md)

## Alteração Tipo Usuário Varejo

<mark style="color:green;">`PATCH`</mark> `/user-retail/{username}`&#x20;

#### Parâmetro da URL

* **Nome**: \``username`\`&#x20;
* **Tipo**: String
* **Descrição**: CPF do usuário
* **Exemplo**: Para atualizar informações do usuário com CPF "123.456.789-00", a URL deve ser `PATCH /user-retail/21890128643`

Alterar tipo usuário varejo

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name        | Type   | Description                          |
| ----------- | ------ | ------------------------------------ |
| userType \* | string | Tipo de usuário \[`normal`\|`trial`] |

&#x20;\* Campo obrigatório

**Response**

{% tabs %}
{% tab title="201" %}

```json
```

{% endtab %}

{% tab title="401" %}

```json
{    
    "title": "Unauthorized", 
    "status": 401,
    "detail": "User auth error."
}
```

{% endtab %}

{% tab title="400" %}

```json
{    
    "title": "Bad Request", 
    "status": 400,
    "detail": "User retail not found."
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "title": "Bad Request", 
    "status": 400,
    "detail": "User Type is invalid."
}
```

{% endtab %}
{% endtabs %}

**Exemplo**

```bash
curl --location --request PATCH 'localhost:89/user-retail/21890128643' \
    --header 'Authorization: Bearer bc0d305a769d9ab768ebf4d09bcf9013710d37ce' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "userType": "normal"
    }'
```
