Painel (Overview)

O painel inicial do sistema, com os dados sintéticos de todas as entidades, pode ser acessado via API também.

Listar Painel

GET /overview?period=this_month

Retorna 200 OK e todos os dados sintéticos da conta, por entidade, tal qual no Painel inicial da versão HTML.

Caso usuário não possua acesso a entidades da conta, não haverá dados no painel e será retornada uma mensagem em conjunto da resposta.

É possível buscar por período pré-definidos ou por um range de datas. No primeiro caso, o período deve ser indicado pelo parâmetro period na requisição e deve possuir um dos valores abaixos (this_month é o valor padrão, caso o parâmetro period não seja informado):

  • this_month
  • until_next_month
  • next_30_days
  • next_60_days
  • next_90_days

Exemplo de Requisição

{
  "period": "next_30_days"
}
<period>next_30_days</period>

No segundo caso, devem ser informados dois parâmetros: start_date e end_date. Ambos devem possuir datas no formato YYYY-MM-DD.

Exemplo de Requisição

{
  "start_date": "2013-10-24",
  "end_date": "2014-01-31"
}
<start-date>2013-10-24</start-date>
<end-date>2014-01-31</end-date>

Exemplo de Resposta

HTTP/1.1 200 OK
Date: Thu, 05 Jul 2012 19:34:03 GMT
Content-Type: application/json; charset=utf-8
{
  "overview":{
      "period": "this_month",
      "start_date": "2012-07-01",
      "end_date": "2012-07-31",
      "links": [
        {
          "rel": "self",
          "href": "http://localhost:3000/overview?period=this_month",
          "method": "get"
        },
        {
          "rel": "next_30_days",
          "href": "http://localhost:3000/overview?period=next_30_days",
          "method": "get"
        },
        {
          "rel": "this_month",
          "href": "http://localhost:3000/overview?period=this_month",
          "method": "get"
        },
        {
          "rel": "next_60_days",
          "href": "http://localhost:3000/overview?period=next_60_days",
          "method": "get"
        },
        { parâmetro <tt>period</tt> na requisição com um dos valores a seguir: <tt>this_month</tt>, <tt>next_30_days</tt>, <tt>next_60_days</tt> e <tt>next_90_days</tt>.

          "rel": "next_90_days",
          "href": "http://localhost:3000/overview?period=next_90_days",
          "method": "get"
        }
      ],"
      entities":[
        {
          "entity":{
            "id":2,
            "name":"Empresa",
            "federation_subscription_number":"26.683.453/0001-53",
            "overview_data":{
              "payable_accounts":{
                "amount":"0.0",
                "quantity":0
              },
              "receivable_accounts":{
                "amount":"0.0",
                "quantity":0
              },
              "deposit_accounts":[
                {
                  "id":7,
                  "name":"123456789",
                  "amount":"2400.0",
                  "deposit_account_type": {
                    "id":1,
                    "code":"corrente",
                    "name":"Conta Corrente"
                  }
                }
              ],
              "deposit_accounts_total_amount":"2400.0",
              "period_result":"2400.0",
              "credit_cards": [
                {
                  "id": 1,
                  "name": "Cartão pessoal",
                  "balance": "-222.0",
                  "flag": "Aura",
                  "closing_day": 21,
                  "expiration_day": 1,
                  "first_opened_invoice_date": "2014-02-01",
                  "observation": "",
                  "category_id": null,
                  "person_id": null,
                  "classification_center_id": null,
                  "flag_image_url": "/assets/logos/logo-creditcard-aura.png",
                  "competency_month": "2014-02",
                  "due_date": "2014-02-01"
                },
                {
                  "id": 3,
                  "name": "teste",
                  "balance": "-180.0",
                  "flag": "American Express",
                  "closing_day": 21,
                  "expiration_day": 1,
                  "first_opened_invoice_date": "2014-02-01",
                  "observation": "",
                  "category_id": null,
                  "person_id": null,
                  "classification_center_id": null,
                  "flag_image_url": "/assets/logos/logo-creditcard-americanexpress.png",
                  "competency_month": "2014-02",
                  "due_date": "2014-02-01"
                },
                {
                  "id": 1,
                  "name": "Cartão pessoal",
                  "balance": "-300.0",
                  "flag": "Aura",
                  "closing_day": 21,
                  "expiration_day": 1,
                  "first_opened_invoice_date": "2014-02-01",
                  "observation": "",
                  "category_id": null,
                  "person_id": null,
                  "classification_center_id": null,
                  "flag_image_url": "/assets/logos/logo-creditcard-aura.png",
                  "competency_month": "2014-03",
                  "due_date": "2014-03-01"
                },
                {
                  "id": 3,
                  "name": "teste",
                  "balance": "-1500.0",
                  "flag": "American Express",
                  "closing_day": 21,
                  "expiration_day": 1,
                  "first_opened_invoice_date": "2014-02-01",
                  "observation": "",
                  "category_id": null,
                  "person_id": null,
                  "classification_center_id": null,
                  "flag_image_url": "/assets/logos/logo-creditcard-americanexpress.png",
                  "competency_month": "2014-03",
                  "due_date": "2014-03-01"
                }
              ],
              "credit_cards_total_amount": "-2202.0",
              "entity_graphic": [
                [
                  "29/08", 100.0
                ],
                [
                  "30/08", 100.0
                ]
              ]
            }
          }
        },
        {
          "entity":{
            "id":1,
            "name":"Minhas Finanças",
            "federation_subscription_number":null,
            "overview_data":{
              "payable_accounts":{
               "amount":"4298.7",
                "quantity":10
              },
              "receivable_accounts":{
                "amount":"0.0",
                "quantity":0
              },
              "deposit_accounts":[
                {
                  "id":1,
                  "name":"Carteira",
                  "amount":"4000.0"
                  "deposit_account_type": {
                    "id":2,
                    "code":"dinheiro",
                    "name":"Dinheiro"
                  }
                },
                {
                  "id":2,
                  "name":"Conta de Dinheiro",
                  "amount":"2767.95"
                  "deposit_account_type": {
                    "id":2,
                    "code":"dinheiro",
                    "name":"Dinheiro"
                  }
                },
                {
                  "id":4,
                  "name":"Investimento",
                  "amount":"-5981.7"
                  "deposit_account_type": {
                    "id":4,
                    "code":"investimento",
                    "name":"Investimento"
                  }
                }
              ],
              "credit_cards": [],
              "credit_cards_total_amount": "0.0",
              "deposit_accounts_total_amount":"4655.65",
              "period_result":"356.95"
            }
          }
        }
      ]
  }
}
HTTP/1.1 200 OK
Date: Thu, 05 Jul 2012 19:34:03 GMT
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<overview>
  <period>this_month</period>
  <start-date type="date">2012-07-01</start-date>
  <end-date type="date">2012-07-31</end-date>
  <links type="array">
    <link>
      <rel>self</rel>
      <href>http://localhost:3000/overview?period=this_month</href>
      <method>get</method>
    </link>
    <link>
      <rel>next_30_days</rel>
      <href>http://localhost:3000/overview?period=next_30_days</href>
      <method>get</method>
    </link>
    <link>
      <rel>this_month</rel>
      <href>http://localhost:3000/overview?period=this_month</href>
      <method>get</method>
    </link>
    <link>
      <rel>next_60_days</rel>
      <href>http://localhost:3000/overview?period=next_60_days</href>
      <method>get</method>
    </link>
    <link>
      <rel>next_90_days</rel>
      <href>http://localhost:3000/overview?period=next_90_days</href>
      <method>get</method>
    </link>
  </links>
  <entities type="array">
    <entity>
      <id type="integer">2</id>
      <name>Empresa</name>
      <federation-subscription-number>26.683.453/0001-53</federation-subscription-number>
      <overview-data>
        <payable-accounts>
          <amount type="decimal">0.0</amount>
          <quantity type="integer">0</quantity>
        </payable-accounts>
        <receivable-accounts>
          <amount type="decimal">0.0</amount>
          <quantity type="integer">0</quantity>
        </receivable-accounts>
        <deposit-accounts type="array">
          <deposit-account>
            <id type="integer">7</id>
            <name>123456789</name>
            <amount type="decimal">2400.0</amount>
            <deposit-account-type>
              <id type="integer">1</id>
              <code>corrente</code>
              <name>Conta Corrente</name>
            </deposit-account-type>
          </deposit-account>
        </deposit-accounts>
        <credit-cards type="array">
          <credit-card>
            <id type="integer">1</id>
            <name>Cartão pessoal</name>
            <balance type="decimal">-222.0</balance>
            <flag>Aura</flag>
            <closing-day type="integer">21</closing-day>
            <expiration-day type="integer">1</expiration-day>
            <first-opened-invoice-date>2014-02-01</first-opened-invoice-date>
            <observation></observation>
            <category-id nil="true" />
            <person-id nil="true" />
            <classification-center-id nil="true" />
            <flag-image-url>http://test.host/assets/logos/logo-creditcard-aura.png</flag-image-url>
            <competency-month>2014-02</competency-month>
            <due-date>2014-02-01</due-date>
          </credit-card>
          <credit-card>
            <id type="integer">3</id>
            <name>teste</name>
            <balance type="decimal">-180.0</balance>
            <flag>American Express</flag>
            <closing-day type="integer">21</closing-day>
            <expiration-day type="integer">1</expiration-day>
            <first-opened-invoice-date>2014-02-01</first-opened-invoice-date>
            <observation></observation>
            <category-id nil="true" />
            <person-id nil="true" />
            <classification-center-id nil="true" />
            <flag-image-url>http://test.host/assets/logos/logo-creditcard-americanexpress.png</flag-image-url>
            <competency-month>2014-02</competency-month>
            <due-date>2014-02-01</due-date>
          </credit-card>
          <credit-card>
            <id type="integer">1</id>
            <name>Cartão pessoal</name>
            <balance type="decimal">-300.0</balance>
            <flag>Aura</flag>
            <closing-day type="integer">21</closing-day>
            <expiration-day type="integer">1</expiration-day>
            <first-opened-invoice-date>2014-02-01</first-opened-invoice-date>
            <observation></observation>
            <category-id nil="true" />
            <person-id nil="true" />
            <classification-center-id nil="true" />
            <flag-image-url>http://test.host/assets/logos/logo-creditcard-aura.png</flag-image-url>
            <competency-month>2014-03</competency-month>
            <due-date>2014-03-01</due-date>
          </credit-card>
          <credit-card>
            <id type="integer">3</id>
            <name>teste</name>
            <balance type="decimal">-1500.0</balance>
            <flag>American Express</flag>
            <closing-day type="integer">21</closing-day>
            <expiration-day type="integer">1</expiration-day>
            <first-opened-invoice-date>2014-02-01</first-opened-invoice-date>
            <observation></observation>
            <category-id nil="true" />
            <person-id nil="true" />
            <classification-center-id nil="true" />
            <flag-image-url>http://test.host/assets/logos/logo-creditcard-americanexpress.png</flag-image-url>
            <competency-month>2014-03</competency-month>
            <due-date>2014-03-01</due-date>
          </credit-card>
        </credit-cards>
        <deposit-accounts-total-amount type="decimal">2400.0</deposit-accounts-total-amount>
        <period-result type="decimal">2400.0</period-result>
      </overview-data>
    </entity>
    <entity>
      <id type="integer">1</id>
      <name>Minhas Finanças</name>
      <federation-subscription-number nil="true"></federation-subscription-number>
      <overview-data>
        <payable-accounts>
          <amount type="decimal">4298.7</amount>
          <quantity type="integer">10</quantity>
        </payable-accounts>
        <receivable-accounts>
          <amount type="decimal">0.0</amount>
          <quantity type="integer">0</quantity>
        </receivable-accounts>
        <deposit-accounts type="array">
          <deposit-account>
            <id type="integer">3</id>
            <name>Cartão de Crédito</name>
            <amount type="decimal">2330.1</amount>
            <deposit-account-type>
              <id type="integer">3</id>
              <code>cartao</code>
              <name>Cartão de Crédito</name>
            </deposit-account-type>
          </deposit-account>
          <deposit-account>
            <name>Carteira</name>
            <id type="integer">1</id>
            <amount type="decimal">4000.0</amount>
            <deposit-account-type>
              <id type="integer">2</id>
              <code>dinheiro</code>
              <name>Dinheiro</name>
            </deposit-account-type>
          </deposit-account>
          <deposit-account>
            <name>Conta Bancária</name>
            <id type="integer">5</id>
            <amount type="decimal">1539.3</amount>
            <deposit-account-type>
              <id type="integer">1</id>
              <code>corrente</code>
              <name>Conta Corrente</name>
            </deposit-account-type>
          </deposit-account>
          <deposit-account>
            <name>Conta de Dinheiro</name>
            <id type="integer">2</id>
            <amount type="decimal">2767.95</amount>
            <deposit-account-type>
              <id type="integer">2</id>
              <code>dinheiro</code>
              <name>Dinheiro</name>
            </deposit-account-type>
          </deposit-account>
          <deposit-account>
            <name>Conta para Transferência</name>
            <id type="integer">6</id>
            <amount type="decimal">0.0</amount>
            <deposit-account-type>
              <id type="integer">1</id>
              <code>corrente</code>
              <name>Conta Corrente</name>
            </deposit-account-type>
          </deposit-account>
          <deposit-account>
            <name>Investimento</name>
            <id type="integer">4</id>
            <amount type="decimal">-5981.7</amount>
            <deposit-account-type>
              <id type="integer">4</id>
              <code>investimento</code>
              <name>Investimento</name>
            </deposit-account-type>
          </deposit-account>
        </deposit-accounts>
        <credit-cards type="array" />
        <credit-cards-total-amount type="decimal">0.0</credit-cards-total-amount>
        <deposit-accounts-total-amount type="decimal">4655.65</deposit-accounts-total-amount>
        <period-result type="decimal">356.95</period-result>
      </overview-data>
    </entity>
  </entities>
</overview>

Exemplo de Resposta de usuário sem acesso a entidades da conta

HTTP/1.1 200 OK
Date: Thu, 05 Jul 2012 19:34:03 GMT
Content-Type: application/json; charset=utf-8
{
  "overview":{
      "period": "this_month",
      "start_date": "2012-07-01",
      "end_date": "2012-07-31",
  }
  "message": "Você não possui acesso a entidades nesta conta. Contate o administrador da conta (adm@email.com.br) para mais detalhes."
}
HTTP/1.1 200 OK
Date: Thu, 05 Jul 2012 19:34:03 GMT
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <overview>
    <period>this_month</period>
    <start-date type="date">2012-07-01</start-date>
    <end-date type="date">2012-07-31</end-date>
  </overview>
  <message>Você não possui acesso a entidades nesta conta. Contate o administrador da conta (adm@email.com.br) para mais detalhes.</message>
</hash>