## SEFAZ / MT / IPVA
Pesquisa dados de Imposto sobre Propriedades de Veículos Automotores (IPVA).


### Site URL
- https://www.sefaz.mt.gov.br/ipva/emissaoguia/emitir

### Request
POST endpoint: `https://api.infosimples.com/api/v2/consultas/sefaz/mt/ipva`



| Parameter | Description                                                 |
| --------- | ----------------------------------------------------------- |
| token*    | The token that will authenticate and authorize the request. |
| renavam** | RENAVAM of the vehicle to be queried.                       |
| chassi**  | Chassis number of the vehicle to be queried.                |
| cpf**     | CPF of the individual to be queried.                        |
| cnpj**    | CNPJ of the company to be queried.                          |

> * Required parameter.

> ** Optional parameter. Sometimes it is necessary to set at least one of the optional parameters for the service to work properly.


### Response examples (OK)
```json
{
  "code": 200,
  "code_message": "A requisição foi processada com sucesso.",
  "errors": [],
  "header": {
    "api_version": "v2",
    "service": "sefaz/mt/ipva",
    "parameters": {
      "renavam": "11111111111",
      "email": "exemplo@email.com",
      "telefone": "(11) 1111-1111"
    },
    "client_name": "Minha Empresa",
    "token_name": "Token de Produção",
    "billable": true,
    "price": "0.2",
    "requested_at": "2021-06-15T13:41:11.000-03:00",
    "elapsed_time_in_milliseconds": 333,
    "remote_ip": "111.111.111.111",
    "signature": "U2FsdGVkX190/OU1HbwXVy3ir+fMt3yt/4h4PfzXAmu4KkoRiknTy9J+VS9vSO70QX0Lsa8wfemM4QIU5KN1Xw=="
  },
  "data_count": 1,
  "data": [
    {
      "ano": "2010",
      "chassi": "1AAAA11A1A1111111",
      "documento": "11111111111",
      "guia_pdf_url": "Exemplo de URL",
      "ipva": [
        {
          "ano": "2021",
          "valor": "-560.76",
          "juros": "0.00",
          "multa": "0.00",
          "correcao": "0.00",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "-560.76",
          "parcelas_pagas": "-",
          "total_parcelas": "2",
          "situacao": "Parcelamento em cota"
        },
        {
          "ano": "2020",
          "valor": "561.24",
          "juros": "0.00",
          "multa": "0.00",
          "correcao": "0.00",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "561.24",
          "parcelas_pagas": "-",
          "total_parcelas": "-",
          "situacao": "Quitado"
        },
        {
          "ano": "2019",
          "valor": "583.44",
          "juros": "24.05",
          "multa": "60.11",
          "correcao": "17.70",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "685.30",
          "parcelas_pagas": "-",
          "total_parcelas": "-",
          "situacao": "Quitado"
        },
        {
          "ano": "2018",
          "valor": "603.81",
          "juros": "18.69",
          "multa": "62.29",
          "correcao": "19.08",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "703.87",
          "parcelas_pagas": "-",
          "total_parcelas": "-",
          "situacao": "Quitado"
        },
        {
          "ano": "2017",
          "valor": "639.36",
          "juros": "0.00",
          "multa": "0.00",
          "correcao": "0.00",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "639.36",
          "parcelas_pagas": "-",
          "total_parcelas": "-",
          "situacao": "Quitado"
        },
        {
          "ano": "2016",
          "valor": "669.06",
          "juros": "4.53",
          "multa": "19.24",
          "correcao": "3.34",
          "tse": "0.00",
          "desconto": "0.00",
          "total": "696.17",
          "parcelas_pagas": "-",
          "total_parcelas": "-",
          "situacao": "Quitado"
        }
      ],
      "modelo": "FORD/FIESTA SEDAN1.6FLEX",
      "placa": "AAA1A11",
      "proprietario": "Nome de Exemplo",
      "renavam": "111111111",
      "situacao": "Normal",
      "site_receipt": null
    }
  ],
  "site_receipts": []
}
```


### Preview file

The preview file (`site_receipts`) in the response JSON is **generated by the source (website/app)** that processed the automation.

### Code snippets


#### Python
```python
# Tested with: Python 3.10.19, Python 3.14.0
import requests

url = 'https://api.infosimples.com/api/v2/consultas/sefaz/mt/ipva'
args = {
  "renavam": "VALUE_OF_PARAMETER_RENAVAM",
  "chassi":  "VALUE_OF_PARAMETER_CHASSI",
  "cpf":     "VALUE_OF_PARAMETER_CPF",
  "cnpj":    "VALUE_OF_PARAMETER_CNPJ",
  "token":   "WRITE_YOUR_TOKEN_HERE",
  "timeout": "300"
}

response = requests.post(url, args)
response_json = response.json()
response.close()

if response_json['code'] == 200:
  print("Retorno com sucesso: ", response_json['data'])
elif response_json['code'] in range(600, 799):
  mensagem = "Resultado sem sucesso. Leia para saber mais: \n"
  mensagem += "Código: {} ({})\n".format(response_json['code'], response_json['code_message'])
  mensagem += "; ".join(response_json['errors'])
  print(mensagem)

print("Cabeçalho da consulta: ", response_json['header'])
print("URLs com arquivos de visualização (HTML/PDF): ", response_json['site_receipts'])
```


## We are 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.
