# Index

1. [When to use the batch processing tool?](#quando-usar)
2. [Creating a batch](#criacao-lote)
3. [Downloading the input file](#download-entrada)
4. [Downloading the results](#download-resultados)
5. [Replicate columns to the output CSV file](#replicar-colunas)

## [When to use the batch processing tool?](#quando-usar)
The [batch processing tool](https://api.infosimples.com/consultas/lotes) in the web panel allows performing batch queries and is intended for end users, since it does not require programming knowledge.

The workflow is simple: a CSV file is sent by the user as input and, after the processing has been completed, output files become available for download. These files are compressed (Zip), **password protected** and can include:

- A file (similar to the input) with enriched data (CSV).
- Preview files generate by the requested service (HTML or PDF).
- Raw responses from the Infosimples API (JSON).

The batch processing tool is therefore recommended if your business needs work well with the workflow of sending and receiving files or if the user does not have the programming knowledge required to create a custom integration with the APIs.

The video tutorials below demonstrate how to process batches.


## [Creating a batch](#criacao-lote)
Learn how to create a batch and upload a properly formatted CSV file.


## [Downloading the input file](#download-entrada)
If necessary, it is possible to recover the input file used to create a batch.

> HEADS UP: the input file is kept on our storage for a predefined amount of time and then it is automatically deleted permanently. Check for how long the file will be available on the details of your batch.


## [Downloading the results](#download-resultados)
After the processing of a batch has completed, password protected Zip files are generated as outputs. Learn how to download and unzip these files on your local computer.

> HEADS UP: the output files (results) are kept on our storage for a predefined amount of time and then they are automatically deleted permanently. Check for how long the files will be available on the details of your batch.


## [Replicate columns to the output CSV file](#replicar-colunas)
When you create a batch using the web interface, you are able to configure to which API parameter each of the input CSV columns refers to. These columns are automatically replicated to the output CSV so that it is straightfoward to relate input and output data.

If your use case requires a column of the input CSV **to be ignored as an API parameter but nevertheless replicated to the output CSV** , this can be achieved by prefixing this column in the input CSV with `incluir_`.

For example, the CSV below could be used with the service `Receita Federal / CPF` in order to replicate the column `my_internal_user_id` to the output CSV.

```csv
cpf,data_de_nascimento,incluir_id_interno_do_meu_usuario
11111111111,1111-11-11,12345
22222222222,2222-22-22,ABCDE
```

The columns `cpf` and `birthdate` are required by the service. The column `my_internal_user_id`, on the other hand, would just be replicated to the output CSV file.

It is possible to prefix multiple columns with `incluir_`.


## [Constant parameters](#parametros-constantes)
When creating a batch which one or more parameters are the same for each row (e.g. `login_cpf`, `ignora_nao_lidas`, etc.), you may add a **constant parameter**.

This value will be used as input for all rows where the column is empty.


## We're here to help
Do you still need to figure something out? Reach us at [suporte@infosimples.com.br](mailto:suporte@infosimples.com.br) and our highly qualified support team will be happy to help.
