> 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/obter-dados-do-usuario.md).

# Obter dados do Usuário

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

## Dados usuário do varejo

<mark style="color:green;">`GET`</mark> `/`user-data-external/\[:username]

#### Parâmetro da URL

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

API responsável por obter os dados um usuário do varejo no billing.

**Headers**

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

**Response**

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

```json
{
    "user": {
        "id": 545,
        "status": 0,
        "username": "28877031298",
        "name": "Nome do Usuário",
        "email": "email@email.com",
        "userType": "trial",
        "serialNumber": "554455",
        "initDate": {
            "date": "2020-02-06 19: 27: 00.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "billingLimits": {
            "id": 3,
            "limitRules": {
                "dueDate": {
                    "date": "2020-04-06 00: 00: 00.000000",
                    "timezone_type": 3,
                    "timezone": "UTC"
                },
                "signature": 10,
                "login": 10
            }
        }
    },
    "detail": {
        "code": 1093,
        "status": "USER_LISTED",
        "message": "User list"
    }
}
```

{% endtab %}

{% tab title="401" %}

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

{% endtab %}

{% tab title="400" %}

```json
{
    "title": "Bad Request", 
    "status": 400, 
    "detail": 
        { 
            "code": 1126, 
            "status": "USER_NOT_FOUND", 
            "message": "User not found" 
        }
}
```

{% endtab %}
{% endtabs %}

**Exemplo**

```bash
curl --location --request GET 'http://localhost:89/user-data-external/28877031298' \
--header 'Authorization: Bearer 0f4501697743789b1d7d3a5a2df4b4aed9151cab' \
--header 'Content-Type: application/json' \
--data-raw ''
```
