## SEFAZ / DF / IPTU (Emissão Guia)
Emite guia de IPTU na secretaria da fazenda (SEFAZ) do distrito federal.


### Site URL
- https://ww1.receita.fazenda.df.gov.br/emissao-segunda-via/iptu

### Request
POST endpoint: `https://api.infosimples.com/api/v2/consultas/sefaz/df/iptu`



| Parameter         | Description                                                                                                                                                                                                      |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token*            | The token that will authenticate and authorize the request.                                                                                                                                                      |
| inscricao_imovel* | Inscricao_imovel                                                                                                                                                                                                 |
| exercicio**       | Exercício a ser retornado.  Deve ser informado um dos valores a seguir: <br><ul><li><strong>1</strong> para o ano atual (valor padrão)</li><li><strong>2</strong> para débitos anteriores ao ano atual</li></ul> |

> * 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",
    "api_version_full": "2.2.5-20230306150414",
    "product": "Consultas",
    "service": "sefaz/df/iptu",
    "parameters": {
      "exercicio": 1,
      "inscricao_imovel": "11111111"
    },
    "client_name": "Minha Empresa",
    "token_name": "Token de Produção",
    "billable": true,
    "price": "0.2",
    "requested_at": "2023-03-06T15:41:30.000-03:00",
    "elapsed_time_in_milliseconds": 135,
    "remote_ip": "111.111.111.111",
    "signature": "U2FsdGVkX1+7H3EUbUrJx3zG/SZVYUecnrHiRqKjcilP7rhhYbUj0lXpnEhmYeAhlNxbFzdoa72W8F+yYyQNBw=="
  },
  "data_count": 1,
  "data": [
    {
      "debitos": [
        {
          "ano": "2023",
          "cota": "00 IPTU / TLP",
          "valor": "4.536,62",
          "multa": "0,00",
          "juros": "0,00",
          "outros": "",
          "valor_total": "4.536,62",
          "normalizado_valor_total": 4536.62,
          "normalizado_outros": 0.0,
          "normalizado_juros": 0.0,
          "normalizado_multa": 0.0,
          "normalizado_valor": 4536.62,
          "guia_pdf_url": "https://www.exemplo.com/exemplo-de-url"
        },
        {
          "ano": "2023",
          "cota": "01 IPTU / TLP",
          "valor": "756,09",
          "multa": "0,00",
          "juros": "0,00",
          "outros": "",
          "valor_total": "756,09",
          "normalizado_valor_total": 756.09,
          "normalizado_outros": 0.0,
          "normalizado_juros": 0.0,
          "normalizado_multa": 0.0,
          "normalizado_valor": 756.09,
          "guia_pdf_url": "https://www.exemplo.com/exemplo-de-url"
        },
        {
          "ano": "2023",
          "cota": "02 IPTU / TLP",
          "valor": "756,09",
          "multa": "0,00",
          "juros": "0,00",
          "outros": "",
          "valor_total": "756,09",
          "normalizado_valor_total": 756.09,
          "normalizado_outros": 0.0,
          "normalizado_juros": 0.0,
          "normalizado_multa": 0.0,
          "normalizado_valor": 756.09,
          "guia_pdf_url": "https://www.exemplo.com/exemplo-de-url"
        }
      ],
      "endereco": "Avenida Paulista, 807. São Paulo. SP. Brasil.",
      "inscricao": "111111111111",
      "nome_razao_social": "Exemplo de Nome",
      "site_receipt": "https://www.exemplo.com/exemplo-de-url"
    }
  ],
  "site_receipts": []
}
```


### Preview file

The preview file (`site_receipts`) in the response JSON may be **synthesized by Infosimples** using data from the source (website/app) that processed the automation if the file generated by the source is not suitable for viewing.

### 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/df/iptu'
args = {
  "inscricao_imovel": "VALUE_OF_PARAMETER_INSCRICAO_IMOVEL",
  "exercicio":        "VALUE_OF_PARAMETER_EXERCICIO",
  "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.
