## DETRAN / GO / Débitos
Consulta débitos do veículo no Departamento Estadual de Trânsito (DETRAN) de Goiás (GO).Se você deseja utilizar uma única API para consultar restrições de veículos em DETRANs de todos os estados do Brasil, recomendamos utilizar a API Detran / Restrições (Unificada).


### Site URL
- https://www.go.gov.br/servicos-digitais/detran/consulta-veiculos/consultar-dados

### Request
POST endpoint: `https://api.infosimples.com/api/v2/consultas/detran/go/debitos`



| Parameter     | Description                                                                                                                                                                                                                                                                |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token*        | The token that will authenticate and authorize the request.                                                                                                                                                                                                                |
| placa*        | License plate of the vehicle to be queried.                                                                                                                                                                                                                                |
| renavam*      | RENAVAM of the vehicle to be queried.                                                                                                                                                                                                                                      |
| login_cpf**   | Este parâmetro é necessário caso o login no GOV.BR seja feito com CPF e senha. Deve ser informado o CPF para fazer login no GOV.BR.                                                                                                                                        |
| login_senha** | Este parâmetro é necessário caso o login no GOV.BR seja feito com CPF e senha. Deve ser informada a senha para fazer login no GOV.BR.                                                                                                                                      |
| pkcs12_cert** | Este parâmetro é necessário caso o login no GOV.BR seja feito com certificado digital. Conteúdo do arquivo do certificado digital A1 encriptado seguindo <a href="https://api.infosimples.com/consultas/docs/certificados#criptografia">as instruções de criptografia</a>. |
| pkcs12_pass** | Este parâmetro é necessário caso o login no GOV.BR seja feito com certificado digital. Senha do certificado digital A1 encriptada seguindo <a href="https://api.infosimples.com/consultas/docs/certificados#criptografia">as instruções de criptografia</a>.               |

> * 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.15-20240103121652",
    "product": "Consultas",
    "service": "detran/go/debitos",
    "parameters": {
      "pkcs12_cert_md5": "aa25eae9298a43740f9a763477c20a1f",
      "pkcs12_pass_md5": "c9c59c5246576b81c3f2712100204dec",
      "placa": "AAA1111",
      "renavam": "1111111111"
    },
    "client_name": "Minha Empresa",
    "token_name": "Token de Produção",
    "billable": true,
    "price": "0.26",
    "requested_at": "2024-01-04T12:46:17.000-03:00",
    "elapsed_time_in_milliseconds": 795,
    "remote_ip": "111.111.111.111",
    "signature": "U2FsdGVkX1/fTFpx25DF2Hx3ES1HsWDq1NHok2HwO+neMVaSwDfCXPgK3ZW+VgEG38C2ykZoOEfJxMHal0MlYw=="
  },
  "data_count": 1,
  "data": [
    {
      "divida_ativa": [],
      "infracoes": {
        "vencidas": [
          {
            "ait": "A123456789",
            "pontos": "5",
            "orgao_atuador": "DETRAN - GO",
            "data_infracao": "11/11/1111",
            "responsavel_infracao": "PROPRIETARIO",
            "data_notificacao": "11/11/1111",
            "data_vencimento": "11/11/1111",
            "hora_infracao": "08:40",
            "valor": 142.1,
            "grupo_infracao": "MEDIA",
            "valor_desconto": 130.16,
            "situacao": "Multa com Auto em Penalidade",
            "local_infracao": "Exemplo de endereço",
            "infracao_descricao": "DEIXAR DE EFETUAR REG VEIC EM 30 DIAS TRANSF PROP",
            "boleto_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "ait_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "codigo_barras": "123456789012345678901234567890123456789012345678",
            "boleto_vencimento": "11/11/1111"
          },
          {
            "ait": "A123456789",
            "pontos": "5",
            "orgao_atuador": "GOINFRA - GO",
            "data_infracao": "11/11/1111",
            "responsavel_infracao": "PROPRIETARIO",
            "data_notificacao": "11/11/1111",
            "data_vencimento": "11/11/1111",
            "hora_infracao": "10:02",
            "valor": 210.96,
            "grupo_infracao": "GRAVE",
            "valor_desconto": 195.23,
            "situacao": "Multa com Auto em Penalidade",
            "local_infracao": "Exemplo de endereço",
            "infracao_descricao": "CONDUZIR VEÍC C/ VIDRO TOTAL/PARC COBERTO PELÍC.",
            "boleto_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "ait_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "codigo_barras": "123456789012345678901234567890123456789012345678",
            "boleto_vencimento": "11/11/1111"
          },
          {
            "ait": "A123456789",
            "pontos": "5",
            "orgao_atuador": "DNIT",
            "data_infracao": "11/11/1111",
            "responsavel_infracao": "CONDUTOR",
            "data_notificacao": "11/11/1111",
            "data_vencimento": "11/11/1111",
            "hora_infracao": "10:38",
            "valor": 142.1,
            "grupo_infracao": "MEDIA",
            "valor_desconto": 130.16,
            "situacao": "Multa com Auto em Penalidade",
            "local_infracao": "Exemplo de endereço",
            "infracao_descricao": "TRANSITAR VELOCIDADE SUPERIOR MAX PERMIT ATE 20%",
            "boleto_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "ait_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "codigo_barras": "123456789012345678901234567890123456789012345678",
            "boleto_vencimento": "11/11/1111"
          },
          {
            "ait": "A123456789",
            "pontos": "5",
            "orgao_atuador": "DNIT",
            "data_infracao": "11/11/1111",
            "responsavel_infracao": "CONDUTOR",
            "data_notificacao": "11/11/1111",
            "data_vencimento": "11/11/1111",
            "hora_infracao": "13:42",
            "valor": 143.3,
            "grupo_infracao": "MEDIA",
            "valor_desconto": 130.16,
            "situacao": "Multa com Auto em Penalidade",
            "local_infracao": "Exemplo de endereço",
            "infracao_descricao": "TRANSITAR VELOCIDADE SUPERIOR MAX PERMIT ATE 20%",
            "boleto_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "ait_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "codigo_barras": "123456789012345678901234567890123456789012345678",
            "boleto_vencimento": "11/11/1111"
          }
        ],
        "nao_vencida": [],
        "sob_juice": [],
        "parcelada": [],
        "notificada": [
          {
            "ait": "A123456789",
            "pontos": 5,
            "orgao_atuador": "PREF. DE: GO - RIO VERDE",
            "data_infracao": "11/11/1111",
            "responsavel_infracao": "CONDUTOR",
            "data_notificacao": "11/11/1111",
            "data_vencimento": "11/11/1111",
            "hora_infracao": "09:50",
            "valor": 130.16,
            "grupo_infracao": "MEDIA",
            "valor_desconto": 104.13,
            "situacao": "Multa com Notificacao de Autuacao",
            "local_infracao": "Exemplo de endereço",
            "infracao_descricao": "TRANSITAR VELOCIDADE SUPERIOR MAX PERMIT ATE 20%",
            "boleto_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "ait_pdf_url": "https://www.exemplo.com/exemplo-de-url",
            "codigo_barras": "123456789012345678901234567890123456789012345678",
            "boleto_vencimento": "11/11/1111"
          }
        ],
        "nao_notificada": [],
        "sne": []
      },
      "debitos_veiculo": [
        {
          "boleto_pdf_url": null,
          "ipva_valor": "PAGO",
          "licenciamento": "PAGO",
          "seguro_obrigatorio": "----",
          "infracoes": "----",
          "data_vencimento": "15/10/2025",
          "valor_total": "----",
          "valor_venal": null,
          "aliquota": null,
          "situacao": null,
          "descricao_cota_unica": null,
          "descricao_popular": null,
          "descricao_nf_goiania": null,
          "valor_original_ipva": null,
          "nomralizado_valor_venal": null,
          "nomralizado_valor_original_ipva": null,
          "normalizado_ipva_valor": null,
          "normalizado_licenciamento": null,
          "normalizado_seguro_obrigatorio": null,
          "normalizado_infracoes": null,
          "normalizado_data_vencimento": null,
          "normalizado_valor_total": null
        }
      ],
      "licenciamento_notificado": [],
      "outros_debitos": [
        {
          "data": "15/04/2025",
          "status": "INCLUSAO DE GRAVAME - FINANCIAMENTO",
          "valor": "R$ 69,55",
          "normalizado_valor": 69.55
        },
        {
          "data": "15/04/2025",
          "status": "TRANSF. PROPRIEDADE",
          "valor": "R$ 318,03",
          "normalizado_valor": 318.03
        }
      ],
      "total": [],
      "site_receipt": "https://www.exemplo.com/exemplo-de-url"
    }
  ],
  "site_receipts": [
    "https://www.exemplo.com/exemplo-de-url"
  ]
}
```


### 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
import base64
# pip install aes-bridge
import aes_bridge

url = 'https://api.infosimples.com/api/v2/consultas/detran/go/debitos'
args = {
  "placa":       "VALUE_OF_PARAMETER_PLACA",
  "renavam":     "VALUE_OF_PARAMETER_RENAVAM",
  "login_cpf":   "VALUE_OF_PARAMETER_LOGIN_CPF",
  "login_senha": "VALUE_OF_PARAMETER_LOGIN_SENHA",
  "pkcs12_cert": aes_bridge.encrypt(base64.b64encode(open("certificate.pfx", "rb").read()).decode(), "ENCRYPTION_KEY").decode("ascii").replace("+", "-").replace("/", "_").rstrip("="),
  "pkcs12_pass": aes_bridge.encrypt("CERTIFICATE_PASSWORD", "ENCRYPTION_KEY").decode("ascii").replace("+", "-").replace("/", "_").rstrip("="),
  "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.
