# Incremento de Créditos

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

## Incremento de créditos varejo

<mark style="color:green;">`POST`</mark> `/`event-increment-limits

**Headers**

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

**Body**

| Name              | Type   | Description                                                                                                             |
| ----------------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| username \*       | string | Username do usuário a receber o incremento de créditos.                                                                 |
| allowedTypes \*   | Array  | Lista com os tipos de usuário permitidos na operação. Verifica o tipo gravado para o usuário está dentre os informados. |
| credits \*        | Object | Objeto contendo os parâmetros de créditos a inputar ao usuário.                                                         |
| credits.days      | Number | Dias a serem adicionados na data de vencimento do usuário.                                                              |
| credits.dueDate   | Date   | Data do vencimento do plano. Quando informado, desconsidera o parâmetro `credits.days`.                                 |
| credits.signature | Number | Quantidade de assinaturas digitais a incrementar aos créditos do usuário.                                               |
| credits.login     | Number | Quantidade de autenticações a incrementar aos créditos do usuário.                                                      |

&#x20;\* Campo obrigatório&#x20;

> Exemplo de um Body JSON:&#x20;
>
> ```json
> {
>     "username": "12345678901",
>     "allowedTypes": ["normal"],
>     "credits": {
>         "days": 30,
>         "signature": 5,
>         "login": 5
>     }
> }
> ```

**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 \"USERNAME\" not found."
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "title": "Bad Request", 
    "status": 400, 
    "detail": "User type not in allowed types."
}
```

{% endtab %}
{% endtabs %}

**Exemplo**

```bash
curl -X POST \
  http://url_billing/event-increment-limits \
  -H 'Authorization: Bearer df496b06454204849ffe677ef96292085c209464' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "username": "12345678901",
    "allowedTypes": ["normal"],
    "credits": {
        "days": 30,
        "signature": 5,
        "login": 5
    }
}'
```


---

# 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/incremento-de-creditos.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.
