Lançamentos (FinancialTransaction)

Os lançamentos devem ser acessados de maneira aninhada à conta (DepositAccount) à qual pertencem.

Listar lançamentos

GET /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions

Retorna uma lista (paginada) de todos os Lançamentos da Deposit Account que usuários possui acesso. Para designar o número de registros por página, passar o parâmetro per_page no endpoint. Caso o parâmetro não seja passado, o default de 50 será utilizado. O limite superior é de 500 registros por página. Para navegar entre as diferentes páginas, basta usar o parâmetro page. Exemplo:

GET /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions?per_page=15&page=3

O endpoint acima irá retornar a terceira página da listagem de Lançamentos com 15 registros em cada.

Exemplo de Resposta

HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:00:02 GMT
Content-Type: application/json; charset=utf-8
Links: <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.json?page=1&per_page=50>;rel="first",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.json?page=3&per_page=50>;rel="last",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.json?page=3&per_page=50>;rel="next",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.json?page=1&per_page=50>;rel="prev"
[
  {
    "financial_transaction": {
      "absolute_amount":"25.07",
      "amount":"-25.07",
      "balance_difference":false,
      "bank_statement_id":427,
      "category_id":null,
      "classification_center_id":null,
      "created_at":"2011-05-17T10:15:47-03:00",
      "currency_id":1,
      "deposit_account_id":71,
      "document":"20110428001",
      "force_destroy":false,
      "id":8384,
      "imported_from_sync":false,
      "is_pending":false,
      "notes":null,
      "observation":null,
      "occurred_at":"2011-04-28",
      "original_description":"RSHOP-RESTAURANTE-27/04",
      "owner_id":null,
      "parent_id":null,
      "person_id":null,
      "observation":"",
      "reconciled":false,
      "transfer_deposit_account_id":71,
      "transfer_id":4,
      "custom_classifications": [
        {
          "id": 1,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "name": "Sudeste",
          "value": "Sudeste",
          "amount": "25.07",
          "percentage": 100
        }
      ],
      "classification_center_classifications":[
        {
          id: "1",
          classification_center_id: 1,
          name: "Sudeste",
          percentage: "100.0",
          amount: "25.07"
        }
      ],
      "updated_at":"2011-05-17T10:15:47-03:00",
      "user_description":null,
      "type":"Debit",
      "attachment_id_list": [],
      "reconciliations": {
        "financial_accounts": []
        "financial_transactions": []
      },
      "links": [
        {
          "rel": "self",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279"
          "method": "get"
        },
        {
          "rel": "destroy",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279"
          "method": "delete"
        },
        {
          "rel": "transfer",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4",
          "method": "get"
        }
      ]
    }
  }
]
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:00:02 GMT
Content-Type: application/xml; charset=utf-8
Links: <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.xml?page=1&per_page=50>;rel="first",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.xml?page=3&per_page=50>;rel="last",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.xml?page=3&per_page=50>;rel="next",
       <http://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions.xml?page=1&per_page=50>;rel="prev"
<financial-transactions type="array">
  <financial-transaction>
    <absolute-amount type="decimal">25.07</absolute-amount>
    <amount type="decimal">-25.07</amount>
    <balance-difference type="boolean">false</balance-difference>
    <bank-statement-id type="integer">427</bank-statement-id>
    <category-id type="integer" nil="true"/>
    <classification-center-id type="integer" nil="true"/>
    <created-at type="datetime">2011-05-17T10:15:47-03:00</created-at>
    <currency-id type="integer">1</currency-id>
    <deposit-account-id type="integer">71</deposit-account-id>
    <document>20110428001</document>
    <force-destroy type="boolean">false</force-destroy>
    <id type="integer">8384</id>
    <imported-from-sync type="boolean">false</imported-from-sync>
    <is-pending type="boolean">false</is-pending>
    <notes nil="true"/>
    <observation nil="true"/>
    <reconciled type="boolean">false</reconciled>
    <occurred-at type="date">2011-04-28</occurred-at>
    <original-description>RSHOP-RESTAURANTE-27/04</original-description>
    <owner-id type="integer" nil="true"/>
    <parent-id type="integer" nil="true"/>
    <person-id type="integer" nil="true"/>
    <observation/>
    <transfer-deposit-account-id type="integer">71</transfer-deposit-account-id>
    <transfer-id type="integer">4</transfer-id>
    <custom-classifications type="array">
      <custom-classification>
        <id type="integer">1</id>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <custom-classifier-name>Região</custom-classifier-name>
        <name>Sudeste</name>
        <value>Sudeste</value>
        <amount type="decimal">25.07</amount>
        <percentage type="decimal">100.0</percentage>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <id type="integer">1</id>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <percentage type="decimal">100.0</percentage>
        <amount type="decimal">25.07</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <updated-at type="datetime">2011-05-17T10:15:47-03:00</updated-at>
    <user-description nil="true"/>
    <type>Debit</type>
    <attachment-id-list type="array"></attachment-id-list>
    <reconciliations>
      <financial-accounts type="array">
      </financial-accounts>
      <financial-transactions type="array">
      </financial-transacitons>
    </reconciliations>
    <links type="array">
      <link>
        <rel>self</rel>
        <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
        <method>get</method>
      </link>
      <link>
        <rel>destroy</rel>
        <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
        <method>delete</method>
      </link>
      <link>
        <rel>transfer</rel>
        <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4</href>
        <method>get</method>
      </link>
    </links>
  </financial-transaction>
</financial-transactions>

Exibir modelo de novo lançamento

GET /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/new

Retorna os atributos de um novo lançamento, com os valores default. Use como modelo para criar novos lançamentos.

Exemplo de Resposta

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Wed, 26 Jan 2011 13:11:23 GMT
{
  "financial_transaction": {
    "absolute_amount": null,
    "amount": null,
    "api_related": false,
    "attachments_count": 0,
    "automatic_rule_related": null,
    "balance_difference": false,
    "bank_slips_count": 0,
    "bank_statement_id": null,
    "category_id": null,
    "classification_center_id": null,
    "created_at": null,
    "currency_id": null,
    "deposit_account_id": 1,
    "divided": false,
    "document": null,
    "duplicity_suspicion_id": null,
    "excel_import_id": null,
    "force_destroy": false,
    "id": null,
    "imported_from_sync": false,
    "indexed_at": null,
    "is_pending": false,
    "notes": null,
    "observation": null,
    "occurred_at": "2017-05-10",
    "original_description": null,
    "parent_id": null,
    "person_id": null,
    "reconciled": false,
    "transfer_id": null,
    "updated_at": null,
    "user_description": null,
    "type": "Debit",
    "custom_classifications_attributes": [
      {
        "custom_classifier_name": null,
        "name": null
      }
    ],
  }
}
HTTP/1.1 200 OK
  Content-Type: application/xml; charset=utf-8
  Date: Wed, 26 Jan 2011 13:11:23 GMT
<financial-transaction>
    <absolute-amount nil="true"/>
    <amount nil="true"/>
    <api-related type="boolean">false</api-related>
    <attachments-count type="integer">0</attachments-count>
    <automatic-rule-related nil="true"/>
    <balance-difference type="boolean">false</balance-difference>
    <bank-slips-count type="integer">0</bank-slips-count>
    <bank-statement-id nil="true"/>
    <category-id nil="true"/>
    <classification-center-id nil="true"/>
    <created-at nil="true"/>
    <currency-id nil="true"/>
    <deposit-account-id type="integer">1</deposit-account-id>
    <divided type="boolean">false</divided>
    <document nil="true"/>
    <duplicity-suspicion-id nil="true"/>
    <excel-import-id nil="true"/>
    <force-destroy type="boolean">false</force-destroy>
    <id nil="true"/>
    <imported-from-sync type="boolean">false</imported-from-sync>
    <indexed-at nil="true"/>
    <is-pending type="boolean">false</is-pending>
    <notes nil="true"/>
    <observation nil="true"/>
    <occurred-at type="date">2017-05-10</occurred-at>
    <original-description nil="true"/>
    <parent-id nil="true"/>
    <person-id nil="true"/>
    <reconciled type="boolean">false</reconciled>
    <transfer-id nil="true"/>
    <updated-at nil="true"/>
    <user-description nil="true"/>
    <type>Debit</type>
    <custom-classifications_attributes type="array">
        <custom-classification>
            <custom-classifier-name nil="true"/>
            <name nil="true"/>
        </custom-classification>
    </custom-classifications_attributes>
</financial-transaction>
h2 Exibir um lançamento
GET /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/:id

Retorna 200 OK e os dados do lançamento solicitado.

Exemplo de Resposta

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Wed, 26 Jan 2011 13:11:23 GMT
{
  "financial_transaction":
    {
      "absolute_amount":"68.5",
      "amount":"-68.5",
      "balance_difference":false,
      "bank_statement_id":421,
      "category_id":null,
      "classification_center_id":null,
      "created_at":"2011-05-13T20:07:50-03:00",
      "currency_id":1,
      "deposit_account_id":71,
      "document":"20110427002",
      "force_destroy":false,
      "id":8279,
      "imported_from_sync":false,
      "is_pending":false,
      "notes":null,
      "observation":null,
      "occurred_at":"2011-04-27",
      "original_description":"RSHOP-LIVRARIA DA-26/04",
      "owner_id":null,
      "parent_id":null,
      "person_id":null,
      "observation":"",
      "reconciled":true,
      "transfer_deposit_account_id":71,
      "transfer_id":4,
      "custom_classifications": [
        {
          "id": 1,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "value": "Sudeste", # DEPRECATED
          "name": "Sudeste",
          "amount": "68.5",
          "percentage": 100
        }
      ],
      "classification_center_classifications":[
        {
          id: "1",
          classification_center_id: 1,
          name: "Sudeste",
          percentage: "100.0",
          amount: "68.5"
        }
      ],
      "updated_at":"2011-05-13T20:07:50-03:00",
      "user_description":null,
      "type":"Debit",
      "attachment-id-list": [],
      "reconciliations": {
        "financial_accounts": [{
          "id": 5,
          "links": [{
            "rel": "self",
            "href": "https://app.myfinance.com.br/entities/1/payable_accounts/5",
            "method": "get"
          }]
        }],
        "financial_transactions": []
      },
      "links": [
        {
          "rel": "self",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279",
          "method": "get"
        },
        {
          "rel": "destroy",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279",
          "method": "delete"
        },
        {
          "rel": "transfer",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4",
          "method": "get"
        }
      ]
    }
  }
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Wed, 26 Jan 2011 13:11:23 GMT
<financial-transaction>
  <absolute-amount type="decimal">68.5</absolute-amount>
  <amount type="decimal">-68.5</amount>
  <balance-difference type="boolean">false</balance-difference>
  <bank-statement-id type="integer">421</bank-statement-id>
  <category-id type="integer" nil="true"/>
  <classification-center-id type="integer" nil="true"/>
  <created-at type="datetime">2011-05-13T20:07:50-03:00</created-at>
  <currency-id type="integer">1</currency-id>
  <deposit-account-id type="integer">71</deposit-account-id>
  <document>20110427002</document>
  <force-destroy type="boolean">false</force-destroy>
  <id type="integer">8279</id>
  <imported-from-sync type="boolean">false</imported-from-sync>
  <is-pending type="boolean">false</is-pending>
  <notes nil="true"/>
  <observation nil="true"/>
  <reconciled type="boolean">false</reconciled>
  <occurred-at type="date">2011-04-27</occurred-at>
  <original-description>RSHOP-LIVRARIA DA-26/04</original-description>
  <owner-id type="integer" nil="true"/>
  <parent-id type="integer" nil="true"/>
  <person-id type="integer" nil="true"/>
  <observation/>
  <transfer-deposit-account-id type="integer">71</transfer-deposit-account-id>
  <transfer-id type="integer">4</transfer-id>
  <custom-classifications type="array">
    <custom-classification>
      <id type="integer">1</id>
      <custom-classifier-id type="integer">1</custom-classifier-id>
      <custom-classifier-name>Região</custom-classifier-name>
      <name>Sudeste</name>
      <amount type="decimal">68.5</amount>
      <percentage type="decimal">100.0</percentage>
    </custom-classification>
  </custom-classifications>
  <classification-center-classifications type="array">
    <classification-center-classification>
      <id type="integer">1</id>
      <classification-center-id type="integer">1</classification-center-id>
      <name>Sudeste</name>
      <percentage type="decimal">100.0</percentage>
      <amount type="decimal">68.5</amount>
    </classification-center-classification>
  </classification-center-classifications>
  <updated-at type="datetime">2011-05-13T20:07:50-03:00</updated-at>
  <user-description nil="true"/>
  <type>Debit</type>
  <attachment-id-list type="array"></attachment-id-list>
  <reconciliatons>
    <financial-accounts type="array">
      <financial-account>
        <id type="integer">5</id>
        <links type="array">
          <link>
            <rel>self</rel>
            <href>https://app.myfinance.com.br/entities/1/payable_accounts/5</href>
            <method>get</method>
          </link>
        </links>
      </financial-account>
    </financial-accounts>
    <financial-transacitons type="array">
    </financial-transactions>
  </reconciliatons>
  <links type="array">
    <link>
      <rel>self</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
      <method>get</method>
    </link>
    <link>
      <rel>destroy</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
      <method>delete</method>
    </link>
    <link>
      <rel>transfer</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4</href>
      <method>get</method>
    </link>
  </links>
</financial-transaction>

Criar um lançamento

POST /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions

Enviar os parâmetros para criação do objeto como XML ou JSON (conforme o formato escolhido) no corpo da requisição HTTP.

Em caso de sucesso, retorna 201 Created mais o caminho para o objeto criado no header Location, além dos dados do lançamento criado. Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque o lançamento não pôde ser criado.

Exemplo de Requisição

{
  "financial_transaction":
    {
      "absolute_amount":"68.5",
      "amount":"68.5",
      "balance_difference":false,
      "bank_statement_id":null,
      "category_id":null,
      "classification_center_id":null,
      "created_at":null,
      "currency_id":1,
      "deposit_account_id":71,
      "document":null,
      "force_destroy":false,
      "imported_from_sync":false,
      "is_pending":false,
      "notes":null,
      "observation":null,
      "occurred_at":"2011-07-15",
      "original_description":null,
      "owner_id":null,
      "parent_id":null,
      "person_id":null,
      "transfer_id":4,
      "updated_at":null,
      "user_description":null,
      "type":"Debit",
      "custom_classifications": [
        {
          "custom_classifier_id": 1,
          "name": "Sudeste",
          "amount": "68.5"
        }
      ],
      "classification_center_classifications":[
        {
          classification_center_id: 1,
          name: "Sudeste",
          percentage: "100.0"
        }
      ],
    }
  }
<financial-transaction>
  <absolute-amount type="decimal">68.5</absolute-amount>
  <amount type="decimal">68.5</amount>
  <balance-difference type="boolean">false</balance-difference>
  <bank-statement-id type="integer" nil="true"/>
  <category-id type="integer" nil="true"/>
  <classification-center-id type="integer" nil="true"/>
  <created-at type="datetime" nil="true"/>
  <currency-id type="integer">1</currency-id>
  <deposit-account-id type="integer">71</deposit-account-id>
  <document nil="true"/>
  <force-destroy type="boolean">false</force-destroy>
  <imported-from-sync type="boolean">false</imported-from-sync>
  <is-pending type="boolean">false</is-pending>
  <notes nil="true"/>
  <observation nil="true"/>
  <occurred-at type="date">2011-07-15</occurred-at>
  <original-description nil="true"/>
  <owner-id type="integer" nil="true"/>
  <parent-id type="integer" nil="true"/>
  <person-id type="integer" nil="true"/>
  <transfer-id type="integer">4</transfer-id>
  <updated-at type="datetime" nil="true"/>
  <user-description nil="true"/>
  <type>Debit</type>
  <custom-classifications type="array">
    <custom-classification>
      <custom-classifier-id type="integer">1</custom-classifier-id>
      <name type="string">Sudeste</name>
      <amount type="decimal">68.5</amount>
    </custom-classification>
  </custom-classifications-attributes>
  <classification-center-classifications type="array">
    <classification-center-classification>
      <classification-center-id type="integer">1</classification-center-id>
      <name>Sudeste</name>
      <amount type="decimal">25.07</amount>
    </classification-center-classification>
  </classification-center-classifications>
</financial-transaction>

Exemplo de Resposta

HTTP/1.1 201 Created
Location: https://app.myfinance.com.br/entities/7/deposit_accounts/5/financial_transactions/8279
Content-Type: application/json; charset=utf-8
Date: Wed, 26 Jan 2011 13:27:00 GMT
{
  "financial_transaction":
    {
      "absolute_amount":"68.5",
      "amount":"68.5",
      "balance_difference":false,
      "bank_statement_id":421,
      "category_id":null,
      "classification_center_id":null,
      "created_at":"2011-05-13T20:07:50-03:00",
      "currency_id":1,
      "deposit_account_id":71,
      "document":"20110427002",
      "force_destroy":false,
      "id":8279,
      "imported_from_sync":false,
      "is_pending":false,
      "notes":null,
      "observation":null,
      "occurred_at":"2011-04-27",
      "original_description":"RSHOP-LIVRARIA DA-26/04",
      "owner_id":null,
      "parent_id":null,
      "person_id":null,
      "observation":"",
      "reconciled": false,
      "transfer_deposit_account_id":71,
      "transfer_id":4,
      "custom_classifications": [
        {
          "id": 27,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "value": "Sudeste", # DEPRECATED
          "name": "Sudeste",
          "amount": "68.5",
          "percentage": 100
        }
      ],
      "classification_center_classifications":[
        {
          id: "1",
          classification_center_id: 1,
          name: "Sudeste",
          percentage: "100.0",
          amount: "25.07"
        }
      ],
      "updated_at":"2011-05-13T20:07:50-03:00",
      "user_description":null,
      "type":"Debit",
      "attachment_id_list": [],
      "reconciliations": {
        "financial_accounts": [],
        "financial_transactions": []
      },
      "links": [
        {
          "rel": "self",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279",
          "method": "get"
        },
        {
          "rel": "destroy",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279",
          "method": "delete"
        },
        {
          "rel": "transfer",
          "href": "https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4",
          "method": "get"
        }
      ]
    }
  }
HTTP/1.1 201 Created
Location: https://app.myfinance.com.br/entities/7/deposit_accounts/5/financial_transactions/8279
Content-Type: application/xml; charset=utf-8
Date: Wed, 26 Jan 2011 13:27:00 GMT
<financial-transaction>
  <absolute-amount type="decimal">68.5</absolute-amount>
  <amount type="decimal">-68.5</amount>
  <balance-difference type="boolean">false</balance-difference>
  <bank-statement-id type="integer">421</bank-statement-id>
  <category-id type="integer" nil="true"/>
  <classification-center-id type="integer" nil="true"/>
  <created-at type="datetime">2011-05-13T20:07:50-03:00</created-at>
  <currency-id type="integer">1</currency-id>
  <deposit-account-id type="integer">71</deposit-account-id>
  <document>20110427002</document>
  <force-destroy type="boolean">false</force-destroy>
  <id type="integer">8279</id>
  <imported-from-sync type="boolean">false</imported-from-sync>
  <is-pending type="boolean">false</is-pending>
  <notes nil="true"/>
  <observation nil="true"/>
  <reconciled type="boolean">false</reconciled>
  <occurred-at type="date">2011-04-27</occurred-at>
  <original-description>RSHOP-LIVRARIA DA-26/04</original-description>
  <owner-id type="integer" nil="true"/>
  <parent-id type="integer" nil="true"/>
  <person-id type="integer" nil="true"/>
  <observation/>
  <transfer-deposit-account-id type="integer">71</transfer-deposit-account-id>
  <transfer-id type="integer">4</transfer-id>
  <custom-classifications type="array">
    <custom-classification>
      <id type="integer">24</id>
      <custom-classifier-id type="integer">1</custom-classifier-id>
      <custom-classifier-name>Região</custom-classifier-name>
      <name>Sudeste</name>
      <value>Sudeste</value>
      <amount type="decimal">68.5</amount>
      <percentage type="decimal">100.0</percentage>
    </custom-classification>
  </custom-classifications>
  <classification-center-classifications type="array">
    <classification-center-classification>
      <id type="integer">1</id>
      <classification-center-id type="integer">1</classification-center-id>
      <name>Sudeste</name>
      <percentage type="decimal">100.0</percentage>
      <amount type="decimal">25.07</amount>
    </classification-center-classification>
  </classification-center-classifications>
  <updated-at type="datetime">2011-05-13T20:07:50-03:00</updated-at>
  <user-description nil="true"/>
  <type>Debit</type>
  <attachment-id-list type="array"></attachment-id-list>
  <reconciliations>
    <financial-accounts type="array">
    </financial-accounts>
    <financial-transactions type="array">
    </financial-transactions>
  </reconciliations>
  <links type="array">
    <link>
      <rel>self</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
      <method>get</method>
    </link>
    <link>
      <rel>destroy</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/8279</href>
      <method>delete</method>
    </link>
    <link>
      <rel>transfer</rel>
      <href>https://app.myfinance.com.br/entities/1/deposit_accounts/71/financial_transactions/4</href>
      <method>get</method>
    </link>
  </links>
</financial-transaction>

Alterar um lançamento

Requisição (Request)

PUT /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/:id

Enviar os parâmetros para alteração do objeto como XML ou JSON (conforme o formato escolhido) no corpo da requisição HTTP.

Em caso de sucesso, retorna 200 OK. Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque o lançamento não pôde ser criado.

Exemplo de Requisição

{
  "financial_transaction":
    {
      "absolute_amount":"68.5",
      "amount":"-68.5",
      "balance_difference":false,
      "bank_statement_id":421,
      "category_id":null,
      "classification_center_id":null,
      "created_at":"2011-05-13T20:07:50-03:00",
      "currency_id":1,
      "deposit_account_id":71,
      "document":"20110427002",
      "force_destroy":false,
      "id":8279,
      "imported_from_sync":false,
      "is_pending":false,
      "notes":null,
      "occurred_at":"2011-04-27",
      "observation":null,
      "original_description":"RSHOP-LIVRARIA DA-26/04",
      "owner_id":null,
      "parent_id":null,
      "person_id":null,
      "transfer_id":null,
      "updated_at":"2011-05-13T20:07:50-03:00",
      "user_description":null,
      "type":"Debit"
    }
  }
<financial-transaction>
  <absolute-amount type="decimal">68.5</absolute-amount>
  <amount type="decimal">-68.5</amount>
  <balance-difference type="boolean">false</balance-difference>
  <bank-statement-id type="integer">421</bank-statement-id>
  <category-id type="integer" nil="true"/>
  <classification-center-id type="integer" nil="true"/>
  <created-at type="datetime">2011-05-13T20:07:50-03:00</created-at>
  <currency-id type="integer">1</currency-id>
  <deposit-account-id type="integer">71</deposit-account-id>
  <document>20110427002</document>
  <force-destroy type="boolean">false</force-destroy>
  <id type="integer">8279</id>
  <imported-from-sync type="boolean">false</imported-from-sync>
  <is-pending type="boolean">false</is-pending>
  <notes nil="true"/>
  <observation nil="true"/>
  <occurred-at type="date">2011-04-27</occurred-at>
  <original-description>RSHOP-LIVRARIA DA-26/04</original-description>
  <owner-id type="integer" nil="true"/>
  <parent-id type="integer" nil="true"/>
  <person-id type="integer" nil="true"/>
  <transfer-id type="integer" nil="true"/>
  <updated-at type="datetime">2011-05-13T20:07:50-03:00</updated-at>
  <user-description nil="true"/>
  <type>Debit</type>
</financial-transaction>

Criar/Alterar classificadores de um Lançamento pelo nome

POST /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions
ou
PUT /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/:id

Na criação/alteração de um lançamento ao invés de informar o atributo id do classificador (Category, ClassificationCenter, Person, Custom) é possível informar o atributo nome do mesmo. Caso já exista um classificador com o mesmo nome o existente será utilizado, caso o contrário, criará um novo classificador apartir do nome passado como parâmetro.

Exemplo de Requisição

{ 
  "financial_transaction": {
    "amount":"-68.5",
    "category_name":"Nova Categoria",
    "classification_center_name":"Novo centro de custo/receita",
    "person_name":"Nova pessoa",
    "type":"Debit" 
  }
}
<financial-transaction>
  <amount type="decimal">-68.5</amount>
  <category-name>Nova categoria</category-name>
  <classification-center-name>Nove centro de custo/receita<classification-center-name/>
  <person-name>Nova pessoa</person-name>
  <type>Debit</type>
  <occurred_at>2012-11-08</occurred_at>
</financial-transaction>

Apagar um lançamento

Exemplo de Requisição

DELETE /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/:id

Retorna 200 OK.

Apagar vários lançamentos

DELETE /entities/:entity_id/deposit_accounts/:deposit_account_id/financial_transactions/destroy_many?selected_ids=:id1,id2,id3

Apaga todos os lançamentos especificados. Retorna 200 OK.