# Index

1. [When to use the account information endpoint?](#quando-usar)
2. [Sending a request](#criacao-pedido)
3. [Configuration parameters](#parametros-configuracao)
4. [Response structure](#estrutura-de-resposta)
5. [Example](#exemplo-de-utilizacao)

## [When to use the account information endpoint?](#quando-usar)
This endpoint returns useful information about the authenticated account, such as:

- Basic account data;
- Billing information;
- Current balance (prepaid accounts only);
- Current services usage;
- Current month usage.

> This endpoint has no cost.


## [Sending a request](#criacao-pedido)
|                 |                                               |
| --------------- | --------------------------------------------- |
| HTTP Method     | GET                                           |
| URL             | https://api.infosimples.com/api/admin/account |
| Response Format | JSON                                          |


## [Configuration parameters](#parametros-configuracao)
`*`: Required parameter
| Parameter | Description                                                 |
| --------- | ----------------------------------------------------------- |
| token*    | The token that will authenticate and authorize the request. |


## [Response structure](#estrutura-de-resposta)
Responses from this endpoint have the following fields in the <code>data</code> key:
| Field             | Type    | Description                                                                                                                               |
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| name              | string  | Account holder's name.                                                                                                                    |
| type              | string  | Whether the account belongs to a person or a company.                                                                                     |
| cnpj              | string  | Account holder's CNPJ, if the account belongs to a company.                                                                               |
| cpf               | string  | Account holder's CPF, if the account belongs to a person.                                                                                 |
| prepaid           | boolean | Whether the account is prepaid or not.                                                                                                    |
| balance           | float   | Current balance (prepaid accounts only).                                                                                                  |
| balance_threshold | float   | When the account balance is lower than this threshold, a warning e-mail is sent. This value can be changed in the account settings.       |
| dynamic_price     | boolean | Whether the account is configured with dynamic pricing or not.                                                                            |
| base_price        | float   | Account's base price (for accounts with fixed price).                                                                                     |
| min_bill          | float   | Minimum monthly bill.                                                                                                                     |
| default_timeout   | integer | Default value for the <code>timeout</code> parameter that can be used on API requests. This value can be changed in the account settings. |
| current_bill      | float   | Current value of the ongoing billing period's bill (current month), if the account is not prepaid.                                        |
| current_usage     | float   | Current value of the services usage in the ongoing billing period (current month).                                                        |


## [Example](#exemplo-de-utilizacao)
### Request

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

url = "https://api.infosimples.com/api/admin/account"
args = {
  "token": "VALUE_OF_PARAMETER"
}

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

print(response_json)
```


### Response

#### Success
```json
{
  "code": 200,
  "code_message": "A requisição foi processada com sucesso.",
  "data": [
    {
      "name": "Exemplo de nome",
      "type": "Pessoa jurídica",
      "cnpj": "00000000000000",
      "cpf": null,
      "prepaid": true,
      "balance": 111.11,
      "balance_threshold": 11.11,
      "dynamic_price": false,
      "base_price": 0.2,
      "min_bill": 100,
      "default_timeout": 600,
      "current_bill": 100,
      "current_usage": 11.11
    }
  ]
}
```


#### Error
```json
{
    "code": 601,
    "code_message": "Não foi possível se autenticar com o token informado."
}
```



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