# Consulta de crédito

### Autenticação client credentials

API responsável pela realização da autenticação da aplicação.&#x20;

**Exemplo**

```
curl -X POST \
  http://url_billing/auth/client \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "client_id": "minha_app",
    "client_secret": "minha_app_secret",
    "grant_type": "client_credentials",
    "lifetime": 6500,
}'
```

#### Resposta

```
{
    "access_token": "e6f70ef1861a3cavc1585e63afaf07443d905cda",
    "token_type": "bearer",
    "expires_in": 6500
}
```

### API obter usuários varejo da corporação

API responsável por obter a lista de usuários varejo com seus devidos créditos de uma corporação.

* A autenticação deve ser feita via [client credentials](#autenticacao-client-credentials). Utilizando o clientid da corporação.

|                      |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Title**            | Lista os dados do varejo de usuários da corporação                                                                                                                                                                                                                                                                                                                                                                        |
| **URL**              | `/user-retail-corporation`                                                                                                                                                                                                                                                                                                                                                                                                |
| **Methods**          | `GET`                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **URL Params**       |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `page`               | `Number` \| Opcional (default 1) \| Número da paginação.                                                                                                                                                                                                                                                                                                                                                                  |
| `page_size`          | `Number` \| Opcional (default 25, máx 500) \| Quantidade de itens em cada página.                                                                                                                                                                                                                                                                                                                                         |
| **Success Response** | <p><strong>Code:</strong> <code>200</code><br><strong>Content:</strong> <code>{"total\_items":1,"page":"1","page\_size":100,"items":\[{"id":1,"username":"05964224822","name":"Usuario Teste","serialNumber":"113D","userType":"trial","billingLimits":{"id":1,"limitRules":{"dueDate":{"date":"2024-10-07 23:59:59.000000","timezone\_type":3,"timezone":"UTC"},"login":100000000,"signature":2147483647}}}]}</code></p> |
| **Error Response**   | **Code:** `401`                                                                                                                                                                                                                                                                                                                                                                                                           |

**Exemplo**

```
curl --location 'http://url_billing/user-retail-corporation?page=1&page_size=100' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer e6f70ef1861a3cavc1585e63afaf07443d905cda' \
--data ''
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vaultid.com.br/workspace/wings/usuario-varejo/consulta-de-credito.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
