Contas a Pagar (PayableAccount)

As Contas a Pagar devem ser acessadas de maneira aninhada à entidade (Entity) à qual pertencem.

Atributos

- entity_id                          | integer  | Identificador a entidade associada a conta a pagar
- status                             | integer  | Situação da conta a pagar
                                                  1 - não pago
                                                  2 - pago
                                                  3 - pago e conciliado
- status_name                        | integer  | Descrição da situação da conta a pagar
                                                  unpaid - não pago
                                                  paid - pago
                                                  reconciled - pago e conciliado
- due_date                           | date     | Data de vencimento
- occurred_at                        | date     | Data de ocorrência
- amount                             | decimal  | Valor a pagar
- ticket_amount                      | decimal  | Valor da multa na conta a pagar
- interest_amount                    | decimal  | Valor dos juros da conta a pagar
- discount_amount                    | decimal  | Valor do desconto da conta a pagar
- nominal_amount                     | decimal  | Valor nominal da conta a pagar
- total_amount                       | decimal  | Valor calculado a partir do valor nominal e dos valores de multa, juros e desconto
- description                        | string   | Descrição da conta a pagar
- document                           | string   | Documento da conta a pagar
- document_emission_date             | date     | Data da emissão do documento da conta a pagar
- observation                        | text     | Observações sobre a conta a pagar
- remind                             | boolean  | Recebe um email do vencimento da conta a pagar, default false
- reminded_at                        | date     | Dia que o usuário será lembrado do vencimento da conta a pagar
- income_tax_relevant                | boolean  | Relevante para o imposto de renda, default false
- category_id                        | integer  | Identificador da categoria associada a conta a pagar
- classification_center_id           | integer  | Identificador da centro de custo/receita associado a conta a pagar
- expected_deposit_account_id        | integer  | Identificador da conta bancária que pagará a conciliação
- recurrence_id                      | integer  | Identificador do gerenciador da recorrência
- person_id                          | integer  | Identificador do cliente/fornecedor associado a conta a pagar
- custom_classifications             | array    | Array de classificadores personalizados.
                                                  Deve ser passado o nome do classificador personalizado e seu valor.
- recurrent                          | boolean  | Indica se é recorrente, default false
- parcelled                          | boolean  | Indica se é parcelado, default false,
- recurrence_period                  | integer  | Indica a periodicidade da conta a pagar
                                                  weekly      - semanal
                                                  biweekly    - quinzenal
                                                  monthly     - mensal
                                                  bimonthly   - bimestral
                                                  quarterly   - trimestral
                                                  semiannual  - semestral
                                                  annual      - anual
- number_of_parcels                  | integer  | Número de parcelas
- current_parcel                     | integer  | Atual parcela
- financial_account_taxes_attributes | array    | Array dos impostos, DEPRECIADO use taxes_attributes
- tax_charges                        | array    | Array dos impostos
                                                  amount       - valor do imposto
                                                  tax_id       - id do imposto, veja a documentação de Impostos para saber os valores
                                                  withholding  - retido na fonte, caso seja true será calculado no total
- payment_information_attributes     | hash     | Hash com os dados de pagamento
                                                  payment_type                     - Tipo de Pagamento
                                                                                     BankBillet  - Boleto
                                                                                     TedTransfer - TED
                                                                                     PixTransfer - Pix Transferência
                                                                                     PixPayment  - Pix QR Code

                                                  Para payment_type "BankBillet":
                                                  beneficiary_name                 - Razão Social ou Nome
                                                  beneficiary_document_number      - CPF ou CNPJ
                                                  barcode                          - Código de Barras

                                                  Para payment_type "TedTransfer":
                                                  beneficiary_name                 - Razão Social ou Nome
                                                  beneficiary_document_number      - CPF ou CNPJ
                                                  beneficiary_bank_code            - Código do Banco
                                                  beneficiary_bank_agency          - Número da Agência
                                                  beneficiary_bank_agency_digit    - Digito da Agência
                                                  beneficiary_bank_account_number  - Número da Conta
                                                  beneficiary_bank_account_digit   - Digito da Conta

                                                  Para payment_type "PixPayment":
                                                  qr_code                          - QR Code

                                                  Para payment_type "PixTransfer":
                                                  beneficiary_name                 - Razão Social ou Nome
                                                  beneficiary_document_number      - CPF ou CNPJ
                                                  pix_type                         - Tipo de Pix
                                                                                     key        - Chave
                                                                                     bank_info  - Dados Bancários
                                                  pix_key_type                     - Tipo da Chave (Obrigatório se o pix_type for key)
                                                                                     phone     - Telefone
                                                                                     email     - E-mail
                                                                                     cpf_cnpj  - CPF/CNPJ
                                                                                     random    - Aleatória
                                                  pix_key                          - Chave Pix (Obrigatório se pix_type for key)
                                                  beneficiary_bank_code            - Código do Banco (Obrigatório se pix_type for bank_info)
                                                  beneficiary_bank_agency          - Número da Agência (Obrigatório se pix_type for bank_info)
                                                  beneficiary_bank_agency_digit    - Digito da Agência (Obrigatório se pix_type for bank_info)
                                                  beneficiary_bank_account_number  - Número da Conta (Obrigatório se pix_type for bank_info)
                                                  beneficiary_bank_account_digit   - Digito da Conta (Obrigatório se pix_type for bank_info)

Listar Contas a Pagar

GET /entities/:entity_id/payable_accounts

Retorna 200 OK e uma lista (paginada) de contas a pagar. Passar o parâmetro page na URL para acessar outras páginas.

As informações da paginação virão no Header (conforme exemplo).

Retorna uma lista (paginada) de todas as Contas a Pagar da Entity 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/payable_accounts?per_page=15&page=3

O endpoint acima irá retornar a terceira página da listagem de Contas a Pagar 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: <https://financeiro.fintera.com.br/entities/1/payable_accounts.json?page=1&per_page=50>;rel="first",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.json?page=3&per_page=50>;rel="last",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.json?page=3&per_page=50>;rel="next",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.json?page=1&per_page=50>;rel="prev"
[
    {
        "payable_account": {
            "id": 1,
            "entity_id": 1,
            "status": 1,
            "status_name": "unpaid",
            "due_date": "2011-09-10",
            "occurred_at": null,
            "amount": "-100.0",
            "ticket_amount": null,
            "interest_amount": null,
            "discount_amount": null,
            "nominal_amount": null,
            "total_amount": null,
            "description": "Material para escritório",
            "document": "897671718",
            "document_emission_date": "2011-08-07",
            "observation": "Papel para impressão.",
            "remind": true,
            "reminded_at": null,
            "income_tax_relevant": true,
            "category_id": 3,
            "classification_center_id": null,
            "expected_deposit_account_id": 1,
            "recurrence_id": null,
            "person_id": 3,
            "created_at": "2011-08-17T11:51:26-03:00",
            "updated_at": "2011-08-17T11:51:26-03:00",
            "parcels_amount": "-300.0",
            "recurrent": false,
            "parcelled": true,
            "recurrence_period": "monthly",
            "number_of_parcels": 3,
            "current_parcel": 1,
            "competency_month": "2011-09",
            "sale_account_id": null,
            "sale_ids": [],
            "payment_information_attributes": {
              "id": 1,
              "payment_type": "PixTransfer",
              "beneficiary_name": null,
              "beneficiary_document_number": null,
              "beneficiary_bank_code": null,
              "beneficiary_bank_agency": null,
              "beneficiary_bank_agency_digit": null,
              "beneficiary_bank_account_number": null,
              "beneficiary_bank_account_digit": null,
              "barcode": null,
              "qr_code": null,
              "pix_key": "99999999999",
              "pix_type": "key",
              "pix_key_type": "phone",
              "created_at": "2024-05-21T14:30:54.015-03:00",
              "updated_at": "2024-05-21T15:15:45.883-03:00"
            },
            "financial_account_taxes_attributes": [
              {
                "id": 1,
                "tax_id": 1,
                "amount": "10.0",
                "withholding": true
              },
              {
                "id": 2,
                "tax_id": 2,
                "amount": "2.0",
                "withholding": true
              }
            ],
            "tax_charges": [
              {
                "id": 1,
                "tax_id": 1,
                "amount": "10.0",
                "withholding": true
              },
              {
                "id": 2,
                "tax_id": 2,
                "amount": "2.0",
                "withholding": true
              }
            ],
            "custom_classifications": [
              {
                "id": 27,
                "custom_classifier_id": 1,
                "custom_classifier_name": "Região",
                "value": "Sudeste", # DEPRECATED
                "name": "Sudeste",
                "amount": 36,
                "percentage": 100
              }
            ],
            "classification_center_classifications":[
              {
                "classification_center_id": 1,
                "name": "Sudeste",
                "percentage": "100.0",
                "amount": "36.0"
              }
            ],
            "reconciliations": {
              "financial_transactions": [],
              "financial_accounts": []
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
                    "method": "get"
                },
                {
                    "rel": "destroy",
                    "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
                    "method": "delete"
                },
                {
                    "rel": "pay",
                    "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay",
                    "method": "put"
                }
            ]
        }
    }
]
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:00:02 GMT
Content-Type: application/xml; charset=utf-8
Links: <https://financeiro.fintera.com.br/entities/1/payable_accounts.xml?page=1&per_page=50>;rel="first",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.xml?page=3&per_page=50>;rel="last",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.xml?page=3&per_page=50>;rel="next",
       <https://financeiro.fintera.com.br/entities/1/payable_accounts.xml?page=1&per_page=50>;rel="prev"
<?xml version="1.0" encoding="UTF-8"?>
  <payable-accounts type="array">
    <payable-account>
      <id type="integer">17</id>
      <entity-id type="integer">1</entity-id>
      <status type="integer">1</status>
      <status-name type="symbol">unpaid</status-name>
      <due-date type="date">2011-09-10</due-date>
      <occurred-at nil="true"></occurred-at>
      <amount type="decimal">-100.0</amount>
      <ticket-amount nil="true"></ticket-amount>
      <interest-amount nil="true"></interest-amount>
      <discount-amount nil="true"></discount-amount>
      <nominal-amount nil="true"></nominal-amount>
      <total-amount nil="true"></total-amount>
      <description>Material para escrit&#243;rio</description>
      <document>897671718</document>
      <observation>Papel para impress&#227;o.</observation>
      <remind type="boolean">true</remind>
      <reminded-at nil="true"></reminded-at>
      <income_tax_relevant type="boolean">true</income_tax_relevant>
      <category-id type="integer">3</category-id>
      <classification-center-id nil="true"></classification-center-id>
      <expected-deposit-account-id type="integer">1</expected-deposit-account-id>
      <recurrence-id nil="true"></recurrence-id>
      <person-id type="integer">3</person-id>
      <created-at type="dateTime">2011-08-17T11:51:26-03:00</created-at>
      <updated-at type="dateTime">2011-08-17T11:51:26-03:00</updated-at>
      <parcels-amount type="decimal">-300.0</parcels-amount>
      <recurrent type="boolean">false</recurrent>
      <parcelled type="boolean">true</recurrent>
      <recurrence-period>monthly</recurrence-period>
      <number-of-parcels type="integer">3</number-of-parcels>
      <current-parcel type="integer">1</current-parcel>
      <competency-month>2011-09</competency-month>
      <sale-account-id nil="true" />
      <sale-ids type="array">
      </sale-ids>
      <payment-information-attributes>
        <id type="integer">1</id>
        <payment-type>PixTransfer</payment-type>
        <beneficiary-name nil="true"></beneficiary-name>
        <beneficiary-document-number nil="true"></beneficiary-document-number>
        <beneficiary-bank-code nil="true"></beneficiary-bank-code>
        <beneficiary-bank-agency nil="true"></beneficiary-bank-agency>
        <beneficiary-bank-agency-digit nil="true"></beneficiary-bank-agency-digit>
        <beneficiary-bank-account-number nil="true"></beneficiary-bank-account-number>
        <beneficiary-bank-account-digit nil="true"></beneficiary-bank-account-digit>
        <barcode nil="true"></barcode>
        <qr-code nil="true"></qr-code>
        <pix-key>99999999999</pix-key>
        <pix-type>key</pix-type>
        <pix-key-type>phone</pix-key-type>
        <created-at type="dateTime">2024-05-21T14:30:54.015-03:00</created-at>
        <updated-at type="dateTime">2024-05-21T15:15:45.883-03:00</updated-at>
      </payment-information-attributes>
      <financial-account-taxes-attributes type="array">
        <financial-account-taxes-attribute>
          <id type="integer">1</id>
          <tax-id type="integer">1</tax-id>
          <amount type="decimal">10.0</amount>
          <withholding type="boolean">true</withholding>
        </financial-account-taxes-attribute>
        <financial-account-taxes-attribute>
          <id type="integer">2</id>
          <tax-id type="integer">2</tax-id>
          <amount type="decimal">2.0</amount>
          <withholding type="boolean">true</withholding>
        </financial-account-taxes-attribute>
      </financial-account-taxes-attributes>
      <tax-charges type="array">
        <tax-charge>
          <id type="integer">1</id>
          <tax-id type="integer">1</tax-id>
          <amount type="decimal">10.0</amount>
          <withholding type="boolean">true</withholding>
        </tax-charge>
        <tax-charge>
          <id type="integer">2</id>
          <tax-id type="integer">2</tax-id>
          <amount type="decimal">2.0</amount>
          <withholding type="boolean">true</withholding>
        </financial-account-taxes-attribute>
      </financial-account-taxes-attributes>
      <custom-classifications type="array">
        <custom-classification>
          <id type="integer">27</id>
          <custom-classifier-id type="integer">1</custom-classifier-id>
          <custom-classifier-name>Região</custom-classifier-name>
          <value>Sudeste</value> # DEPRECATED
          <name>Sudeste</name>
          <percentage type="decimal">100.0</percentage>
          <amount type="decimal">36.0</amount>
        </custom-classification>
      </custom-classifications>
      <classification-center-classifications type="array">
        <classification-center-classification>
          <id type="integer">27</id>
          <classification-center-id type="integer">1</classification-center-id>
          <name>Sudeste</name>
          <percentage type="decimal">100.0</percentage>
          <amount type="decimal">36.0</amount>
        </classification-center-classification>
      </classification-center-classifications>
      <reconciliations>
        <financial-transactions type="array">
        </financial-transactions>
        <financial-accounts type="array">
        </financial-accounts>
      </reconciliations>
      <links type="array">
        <link>
          <rel>self</rel>
          <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
          <method>get</method>
        </link>
        <link>
          <rel>destroy</rel>
          <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
          <method>delete</method>
        </link>
        <link>
          <rel>pay</rel>
          <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay</href>
          <method>put</method>
        </link>
      </links>
    </payable-account>
  </payable-accounts>

Exemplo de Busca Avançada

GET /entities/:entity_id/payable_accounts?search[due_date_gte]=10/04/2020

Filtros disponíveis para Busca Avançada

- search[due_date_gte]                       | decimal | Data de vencimento maior que
- search[due_date_lte]                       | decimal | Data de vencimento menor que
- search[occurred_at_gte]                    | decimal | Data de pagamento maior que
- search[occurred_at_lte]                    | decimal | Data de pagamento menor que
- search[competency_month_gte]               | decimal | Mês de competência maior que
- search[competency_month_lte]               | decimal | Mês de competência menor que
- search[document_emission_date_gte]         | decimal | Data do documento maior que
- search[document_emission_date_lte]         | decimal | Data do documento menor que
- search[amount_gte]                         | decimal | Valor a pagar maior que
- search[amount_lte]                         | decimal | Valor a pagar menor que
- search[total_amount_gte]                   | decimal | Valor a pago maior que
- search[total_amount_lte]                   | decimal | Valor a pago menor que
- search[total_taxes_gte]                    | decimal | Total de impostos maior que
- search[total_taxes_lte]                    | decimal | Total de impostos menor que
- search[nominal_amount_gte]                 | decimal | Valor nominal maior que
- search[nominal_amount_lte]                 | decimal | Valor nominal menor que
- search[expected_deposit_account_id_equals] | integer | Paga via (Id de uma conta bancária)
- search[description_contains]               | string  | Descrição contém
- search[person_name_equals]                 | string  | Nome de cliente
- search[person_id_is_null]                  | boolean | Sem cliente ou fornecedor
- search[category_full_name]                 | string  | Nome completo de Categoria ex.: Alimentação/Restaurantes
- search[category_group]                     | boolean | Incluir subcategorias
- search[category_id_is_null]                | boolean | Sem categoria
- search[classification_center_name_equals]  | string  | Nome do Centro de Custo
- search[classification_center_id_is_null]   | boolean | Sem Centro de Custo
- search[document_eq]                        | string  | Numero do documento
- search[observation_contains]               | string  | Observação contém

Exibir modelo de nova Conta a Pagar

GET /entities/:entity_id/payable_accounts/new

Retorna os atributos de uma nova conta a pagar, com os valores default. Use como modelo para criar novas contas a pagar.

Exemplo de Resposta

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Aug 2011 15:23:33 GMT
{
    "payable_account": {
        "entity_id": 1,
        "due_date": "2011-08-19",
        "occurred_at": null,
        "amount": null,
        "ticket_amount": null,
        "interest_amount": null,
        "discount_amount": null,
        "total_amount": null,
        "description": null,
        "document": null,
        "document_emission_date": null,
        "observation": null,
        "remind": false,
        "income_tax_relevant": true,
        "category_id": null,
        "classification_center_id": null,
        "person_id": null,
        "expected_deposit_account_id": null,
        "create_as_recurrent": null,
        "links": [
            {
                "rel": "create",
                "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts",
                "method": "post"
            }
        ]
    }
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Fri, 19 Aug 2011 15:23:33 GMT
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <entity-id type="integer">1</entity-id>
    <due-date type="date">2011-08-19</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount nil="true"></amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <income_tax_relevant type="boolean">true</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <person-id nil="true"></person-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <create-as-recurrent></create-as-recurrent>
    <links type="array">
      <link>
        <rel>create</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts</href>
        <method>post</method>
      </link>
    </links>
  </payable-account>

Exibir uma Conta a Pagar

GET /entities/:entity_id/payable_accounts/:id

Retorna 200 OK e os dados da conta a pagar solicitada.

Exemplo de Resposta

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Aug 2011 15:29:58 GMT
{
  "payable_account": {
    "id": 1,
    "entity_id": 1,
    "status": 3,
    "status_name": "paid",
    "due_date": "2011-09-10",
    "occurred_at": "2011-09-10",
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "total_amount": "-100.00,
    "description": "Material para escritório",
    "document": "897671718",
    "document_emission_date": "2011-08-07",
    "observation": "Papel para impressão.",
    "remind": true,
    "reminded_at": "2011-09-09",
    "income_tax_relevant": true,
    "category_id": 3,
    "classification_center_id": null,
    "expected_deposit_account_id": 1,
    "recurrence_id": null,
    "person_id": 3,
    "created_at": "2011-08-19T11:51:26-03:00",
    "updated_at": "2011-08-19T11:51:26-03:00",
    "parcels_amount": "-300.0",
    "parcelled": true,
    "recurrence_period": "monthly",
    "number_of_parcels": 3,
    "current_parcel": 1,
    "competency_month": "2011-09",
    "sale_account_id": null,
    "sale_ids": [],
    "payment_information_attributes": {
      "id": 1,
      "payment_type": "PixTransfer",
      "beneficiary_name": null,
      "beneficiary_document_number": null,
      "beneficiary_bank_code": null,
      "beneficiary_bank_agency": null,
      "beneficiary_bank_agency_digit": null,
      "beneficiary_bank_account_number": null,
      "beneficiary_bank_account_digit": null,
      "barcode": null,
      "qr_code": null,
      "pix_key": "99999999999",
      "pix_type": "key",
      "pix_key_type": "phone",
      "created_at": "2024-05-21T14:30:54.015-03:00",
      "updated_at": "2024-05-21T15:15:45.883-03:00"
    },
    "financial_account_taxes_attributes": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "50.0",
        "withholding": true
      },
      {
        "id": 2,
        "tax_id": 2,
        "amount": "2.0",
        "withholding": true
      }
    ],
    "tax_charges": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "50.0",
        "withholding": true
      },
      {
        "id": 2,
        "tax_id": 2,
        "amount": "2.0",
        "withholding": true
      }
    ],
    "custom_classifications": [
      {
        "id": 27,
        "custom_classifier_id": 1,
        "custom_classifier_name": "Região",
        "value": "Sudeste", # DEPRECATED
        "name": "Sudeste",
        "amount": 36,
        "percentage": 100
      }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "percentage": "100.0",
        "amount": "36.0"
      }
    ],
    "reconciliations": {
      "financial_transactions": [{
        "id": 5,
        "links": [{
          "rel": "self",
          "href": "https://financeiro.fintera.com.br/entities/1/deposit_accounts/1/financial_transactions/5",
          "method": "get"
        }]
      }],
      "financial_accounts": []
    },
    "links": [
      {
        "rel": "self",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "get"
      },
      {
        "rel": "destroy",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "delete"
      },
      {
        "rel": "pay",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay",
        "method": "put"
      }
    ]
  }
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Fri, 19 Aug 2011 15:29:58 GMT
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <id type="integer">1</id>
    <entity-id type="integer">1</entity-id>
    <status type="integer">3</status>
    <status-name type="symbol">paid</status-name>
    <due-date type="date">2011-09-10</due-date>
    <occurred-at>2011-09-10</occurred-at>
    <amount type="decimal">-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount><-100.0/total-amount>
    <description>Material para escrit&#243;rio</description>
    <document>897671718</document>
    <observation>Papel para impress&#227;o.</observation>
    <remind type="boolean">true</remind>
    <reminded-at nil="true"></reminded-at>
    <income_tax_relevant type="boolean">true</income_tax_relevant>
    <category-id type="integer">3</category-id>
    <classification-center-id nil="true"></classification-center-id>
    <expected-deposit-account-id type="integer">1</expected-deposit-account-id>
    <recurrence-id nil="true"></recurrence-id>
    <person-id type="integer">3</person-id>
    <created-at type="dateTime">2011-08-19T11:51:26-03:00</created-at>
    <updated-at type="dateTime">2011-08-19T11:51:26-03:00</updated-at>
    <parcels-amount type="decimal">-300.0</parcels-amount>
    <recurrent type="boolean">false</recurrent>
    <parcelled type="boolean">true</recurrent>
    <recurrence-period>monthly</recurrence-period>
    <number-of-parcels type="integer">3</number-of-parcels>
    <current-parcel type="integer">1</current-parcel>
    <comptency-month>2011-09</competency-month>
    <sale-account-id nil="true" />
    <sale-ids type="array">
    </sale-ids>
    <payment-information-attributes>
      <id type="integer">1</id>
      <payment-type>PixTransfer</payment-type>
      <beneficiary-name nil="true"></beneficiary-name>
      <beneficiary-document-number nil="true"></beneficiary-document-number>
      <beneficiary-bank-code nil="true"></beneficiary-bank-code>
      <beneficiary-bank-agency nil="true"></beneficiary-bank-agency>
      <beneficiary-bank-agency-digit nil="true"></beneficiary-bank-agency-digit>
      <beneficiary-bank-account-number nil="true"></beneficiary-bank-account-number>
      <beneficiary-bank-account-digit nil="true"></beneficiary-bank-account-digit>
      <barcode nil="true"></barcode>
      <qr-code nil="true"></qr-code>
      <pix-key>99999999999</pix-key>
      <pix-type>key</pix-type>
      <pix-key-type>phone</pix-key-type>
      <created-at type="dateTime">2024-05-21T14:30:54.015-03:00</created-at>
      <updated-at type="dateTime">2024-05-21T15:15:45.883-03:00</updated-at>
    </payment-information-attributes>
    <financial-account-taxes-attributes type="array">
      <financial-account-taxes-attribute>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">50.0</amount>
        <withholding type="boolean">true</withholding>
      </financial-account-taxes-attribute>
      <financial-account-taxes-attribute>
        <id type="integer">2</id>
        <tax-id type="integer">2</tax-id>
        <amount type="decimal">2.0</amount>
        <withholding type="boolean">true</withholding>
      </financial-account-taxes-attribute>
    </financial-account-taxes-attributes>
    <tax-charges type="array">
      <tax-charge>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">50.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
      <tax-charge>
        <id type="integer">2</id>
        <tax-id type="integer">2</tax-id>
        <amount type="decimal">2.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
    <custom-classifications type="array">
      <custom-classification>
        <id type="integer">27</id>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <custom-classifier-name>Região</custom-classifier-name>
        <value>Sudeste</value> # DEPRECATED
        <name>Sudeste</name>
        <percentage type="decimal">100.0</percentage>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <id type="integer">27</id>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <percentage type="decimal">100.0</percentage>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <reconciliations>
      <financial-transactions type="array">
        <financial-transaction>
          <id type="integer"></id>
          <links type="array">
            <link>
              <rel>self</rel>
              <href>https://financeiro.fintera.com.br/entities/1/deposit_accounts/1/financial_transactions/5</href>
              <method>get</method>
            </link>
          </links>
        </financial-transaction>
      </financial-transactions>
      <financial-accounts type="array">
      </financial-accounts>
    </reconciliations>
    <links type="array">
      <link>
        <rel>self</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>get</method>
      </link>
      <link>
        <rel>destroy</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>delete</method>
      </link>
      <link>
        <rel>pay</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay</href>
        <method>put</method>
      </link>
    </links>
  </payable-account>

Criar uma Conta a Pagar

POST /entities/:entity_id/payable_accounts

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 objeto criado. Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque a conta a pagar não pôde ser criada.

Exemplo de Requisição

{
  "payable_account": {
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "document_emission_date": null,
    "observation": null,
    "remind": false,
    "income_tax_relevant": true,
    "category_id": null,
    "classification_center_id": null,
    "person_id": null,
    "expected_deposit_account_id": null,
    "create_as_recurrent": null,
    "competency_month": "2011-11",
    "payment_information_attributes": {
      "payment_type": "BankBillet",
      "beneficiary_name": "Empresa LTDA.",
      "beneficiary_document_number": "11111111111111",
      "barcode": "99999999999999999999999999999999999999999999"
    },
    "custom_classifications": [
      {
        "custom_classifier_id": 1,
        "name": "Sudeste",
        "amount": 36
      }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "amount": "36.0"
      }
    ],
    "tax_charges": [
      {
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ]
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount>100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <income_tax_relevant type="boolean">true</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <person-id nil="true"></person-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <create-as-recurrent></create-as-recurrent>
    <competency-month>2011-11</competency-month>
    <payment-information-attributes>
      <payment-type>BankBillet</payment-type>
      <beneficiary-name nil="true">Empresa LTDA.</beneficiary-name>
      <beneficiary-document-number nil="true">11111111111111</beneficiary-document-number>
      <barcode nil="true">99999999999999999999999999999999999999999999</barcode>
    </payment-information-attributes>
    <custom-classifications type="array">
      <custom-classification>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <tax-charges type="array">
      <tax-charge>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
  </payable-account>

Exemplo de Resposta

HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:02 GMT
{
  "payable_account": {
    "id": 1,
    "entity_id": 1,
    "status": 1,
    "status_name": "unpaid",
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "observation": null,
    "remind": false,
    "reminded_at": null,
    "income_tax_relevant": true,
    "category_id": null,
    "classification_center_id": null,
    "expected_deposit_account_id": null,
    "recurrence_id": null,
    "person_id": null,
    "created_at": "2011-08-19T13:36:29-03:00",
    "updated_at": "2011-08-19T13:36:29-03:00",
    "recurrent": false,
    "parcelled": false,
    "recurrence_period": null,
    "number_of_parcels": null,
    "current_parcel": null,
    "competency_month": "2011-11",
    "sale_account_id": null,
    "sale_ids": [],
    "payment_information_attributes": {
      "id": 1,
      "payment_type": "BankBillet",
      "beneficiary_name": "Empresa LTDA.",
      "beneficiary_document_number": "11111111111111",
      "beneficiary_bank_code": null,
      "beneficiary_bank_agency": null,
      "beneficiary_bank_agency_digit": null,
      "beneficiary_bank_account_number": null,
      "beneficiary_bank_account_digit": null,
      "barcode": "99999999999999999999999999999999999999999999"
      "qr_code": null,
      "pix_key": null,
      "pix_type": null,
      "pix_key_type": null,
      "created_at": "2024-05-21T14:30:54.015-03:00",
      "updated_at": "2024-05-21T15:15:45.883-03:00"
    },
    "custom_classifications": [
        {
          "id": 27,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "value": "Sudeste", # DEPRECATED
          "name": "Sudeste"
        }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "percentage": "100.0",
        "amount": "36.0"
      }
    ],
    "financial_account_taxes_attributes": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "tax_charges": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "reconciliations": {
      "financial_transactions": [],
      "financial_accounts": []
    },
    "links": [
      {
        "rel": "self",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "get"
      },
      {
        "rel": "destroy",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "delete"
      },
      {
        "rel": "pay",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay",
        "method": "put"
      }
    ]
  }
}
HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/xml; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:03 GMT
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <id type="integer">1</id>
    <entity-id type="integer">1</entity-id>
    <status type="integer">1</status>
    <status-name type="symbol">unpaid</status-name>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount type="decimal">-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <reminded-at nil="true"></reminded-at>
    <income_tax_relevant type="boolean">false</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <recurrence-id nil="true"></recurrence-id>
    <person-id nil="true"></person-id>
    <created-at type="dateTime">2011-08-19T13:33:02-03:00</created-at>
    <updated-at type="dateTime">2011-08-19T13:33:02-03:00</updated-at>
    <recurrent type="boolean">false</recurrent>
    <parcelled type="boolean">false</recurrent>
    <number-of-parcels nil="true" />
    <current-parcel nil="true" />
    <competency-month>2011-11</competency-month>
    <sale-account-id nil="true" />
    <sale-ids type="array">
    </sale-ids>
    <payment-information-attributes>
      <payment-type>BankBillet</payment-type>
      <beneficiary-name nil="true">Empresa LTDA.</beneficiary-name>
      <beneficiary-document-number nil="true">11111111111111</beneficiary-document-number>
      <beneficiary-bank-code nil="true"></beneficiary-bank-code>
      <beneficiary-bank-agency nil="true"></beneficiary-bank-agency>
      <beneficiary-bank-agency-digit nil="true"></beneficiary-bank-agency-digit>
      <beneficiary-bank-account-number nil="true"></beneficiary-bank-account-number>
      <beneficiary-bank-account-digit nil="true"></beneficiary-bank-account-digit>
      <barcode nil="true">99999999999999999999999999999999999999999999</barcode>
      <qr-code nil="true"></qr-code>
      <pix-key></pix-key>
      <pix-type></pix-type>
      <pix-key-type></pix-key-type>
    </payment-information-attributes>
    <custom-classifications type="array">
      <custom-classification>
        <id type="integer">27</id>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <custom-classifier-name>Região</custom-classifier-name>
        <value>Sudeste</value> # DEPRECATED
        <name>Sudeste</name>
        <percentage type="decimal">100.0</percentage>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <id type="integer">27</id>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <percentage type="decimal">100.0</percentage>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <financial-account-taxes-attributes type="array">
      <financial-account-taxes-attribute>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </financial-account-taxes-attribute>
    </financial-account-taxes-attributes>
    <tax-charges type="array">
      <tax-charge>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
    <reconciliations>
      <financial-transactions type="array">
      </financial-transactions>
      <financial-accounts type="array">
      </financial-accounts>
    </reconciliations>
    <links type="array">
      <link>
        <rel>self</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>get</method>
      </link>
      <link>
        <rel>destroy</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>delete</method>
      </link>
      <link>
        <rel>pay</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay</href>
        <method>put</method>
      </link>
    </links>
  </payable-account>

Criar uma Conta a Pagar Recorrente

POST /entities/:entity_id/payable_accounts

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 objeto criado. Os dados do objeto incluem o tipo da recorrência. Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque a conta a pagar não pôde ser criada.

Opções para o campo "create_as_recurrent":

  • weekly (Semanal)
  • biweekly (Quinzenal)
  • monthly (Mensal)
  • bimonthly (Bimestral)
  • quarterly (Trimestral)
  • semiannual (Semestral)
  • annual (Anual)

Exemplo de Requisição

{
  "payable_account": {
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "observation": null,
    "remind": false,
    "income_tax_relevant: true,
    "category_id": null,
    "classification_center_id": null,
    "person_id": null,
    "expected_deposit_account_id": null,
    "create_as_recurrent": "weekly",
    "tax_charges": [
      {
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ]
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount>-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <income_tax_relevant type="boolean">true</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <person-id nil="true"></person-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <create-as-recurrent>weekly</create-as-recurrent>
    <tax-charges type="array">
      <tax-charge>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
  </payable-account>

Exemplo de Resposta

HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:02 GMT
{
  "payable_account": {
    "id": 1,
    "entity_id": 1,
    "status": 1,
    "status_name": "unpaid",
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "observation": null,
    "remind": false,
    "reminded_at": null,
    "income_tax_relevant": true,
    "category_id": null,
    "classification_center_id": null,
    "expected_deposit_account_id": null,
    "recurrence_id":19,
    "person_id": null,
    "created_at": "2011-08-19T13:36:29-03:00",
    "updated_at": "2011-08-19T13:36:29-03:00",
    "recurrent": true,
    "parcelled": false,
    "recurrence_period": "weekly",
    "number_of_parcels": null,
    "current_parcel": null,
    "competency_month": "2011-09",
    "sale_account_id": null,
    "sale_ids": [],
    "financial_account_taxes_attributes": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "tax_charges": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "custom_classifications": [
        {
          "id": 27,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "value": "Sudeste", # DEPRECATED
          "name": "Sudeste"
        }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "percentage": "100.0",
        "amount": "36.0"
      }
    ],
    "reconciliations": {
      "financial_transactions": [],
      "financial_accounts": []
    },
    "links": [
      {
        "rel": "self",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "get"
      },
      {
        "rel": "destroy",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "delete"
      },
      {
        "rel": "pay",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay",
        "method": "put"
      },
      {
        "rel": "destroy recurrence",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/recurrence",
        "method": "delete"
      }
    ]
  }
}
HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/xml; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:03 GMT
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <id type="integer">1</id>
    <entity-id type="integer">1</entity-id>
    <status type="integer">1</status>
    <status-name type="symbol">unpaid</status-name>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount type="decimal">-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <reminded-at nil="true"></reminded-at>
    <income_tax_relevant type="boolean">false</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <recurrence-id>19</recurrence-id>
    <person-id nil="true"></person-id>
    <created-at type="dateTime">2011-08-19T13:33:02-03:00</created-at>
    <updated-at type="dateTime">2011-08-19T13:33:02-03:00</updated-at>
    <recurrent type="boolean">true</recurrent>
    <parcelled type="boolean">false</parcelled>
    <recurrence-type>weekly</recurrence-type>
    <number-of-parcels nil="true" />
    <current-parcel nil="true" />
    <competency-month>2011-09</competency-month>
    <sale-account-id nil="true" />
    <sale-ids type="array">
    </sale-ids>
    <financial-account-taxes-attributes type="array">
      <financial-account-taxes-attribute>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </financial-account-taxes-attribute>
    </financial-account-taxes-attributes>
    <tax-charges type="array">
      <tax-charge>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
    <custom-classifications type="array">
      <custom-classification>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <reconciliations>
      <financial-transactions type="array">
      </financial-transactions>
      <financial-accounts type="array">
      </financial-accounts>
    </reconciliations>
    <links type="array">
      <link>
        <rel>self</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>get</method>
      </link>
      <link>
        <rel>destroy</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>delete</method>
      </link>
      <link>
        <rel>pay</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay</href>
        <method>put</method>
      </link>
      <link>
        <rel>destroy recurrence</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/recurrence</href>
        <method>delete</method>
      </link>
      <link>
        <rel>next</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/2</href>
        <method>get</method>
      </link>
    </links>
  </payable-account>

Criar uma Conta a Pagar Parcelada

POST /entities/:entity_id/payable_accounts

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 objeto criado. Os dados do objeto incluem a quantidade e a parcela atual e o tipo da recorrência. Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque a conta a pagar não pôde ser criada.

Opções para o campo "create_as_recurrent":

  • weekly (Semanal)
  • biweekly (Quinzenal)
  • monthly (Mensal)
  • bimonthly (Bimestral)
  • quarterly (Trimestral)
  • semiannual (Semestral)
  • annual (Anual)

Exemplo de Requisição

{
  "payable_account": {
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "observation": null,
    "remind": false,
    "income_tax_relevant: true,
    "category_id": null,
    "classification_center_id": null,
    "person_id": null,
    "expected_deposit_account_id": null,
    "create_as_recurrent": "weekly",
    "number_of_parcels": 7,
    "tax_charges": [
      {
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ]
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount>-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <income_tax_relevant type="boolean">true</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <person-id nil="true"></person-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <create-as-recurrent>weekly</create-as-recurrent>
    <number-of-parcels>7</number-of_parcels>
    <tax-charges type="array">
      <tax-charge>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
  </payable-account>

Exemplo de Resposta

HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:02 GMT
{
  "payable_account": {
    "id": 1,
    "entity_id": 1,
    "status": 1,
    "status_name": "unpaid",
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "total_amount": null,
    "description": null,
    "document": null,
    "observation": null,
    "remind": false,
    "reminded_at": null,
    "income_tax_relevant": true,
    "category_id": null,
    "classification_center_id": null,
    "expected_deposit_account_id": null,
    "recurrence_id":19,
    "person_id": null,
    "created_at": "2011-08-19T13:36:29-03:00",
    "updated_at": "2011-08-19T13:36:29-03:00",
    "recurrent": false,
    "parcelled": true,
    "recurrence_period": "weekly",
    "number_of_parcels": 7,
    "current_parcel": 1,
    "competency_month": "2011-09",
    "sale_account_id": null,
    "sale_ids": [],
    "financial_account_taxes_attributes": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "tax_charges": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      }
    ],
    "custom_classifications": [
        {
          "id": 27,
          "custom_classifier_id": 1,
          "custom_classifier_name": "Região",
          "value": "Sudeste", # DEPRECATED
          "name": "Sudeste"
        }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "percentage": "100.0",
        "amount": "36.0"
      }
    ],
    "reconciliations": {
      "financial_transactions": [],
      "financial_accounts": []
    },
    "links": [
      {
        "rel": "self",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "get"
      },
      {
        "rel": "destroy",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1",
        "method": "delete"
      },
      {
        "rel": "pay",
        "href": "https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay",
        "method": "put"
      },
      {
        "rel": "destroy recurrence",
        "href": "https://financeiro.fintera.com.br/entities/1/recurrence",
        "method": "delete"
      }
    ]
  }
}
HTTP/1.1 201 Created
Location: https://financeiro.fintera.com.br/entities/1/payable_accounts/1
Content-Type: application/xml; charset=utf-8
Date: Fri, 19 Aug 2011 16:33:03 GMT
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <id type="integer">1</id>
    <entity-id type="integer">1</entity-id>
    <status type="integer">1</status>
    <status-name type="symbol">unpaid</status-name>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount type="decimal">-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document nil="true"></document>
    <observation nil="true"></observation>
    <remind type="boolean">false</remind>
    <reminded-at nil="true"></reminded-at>
    <income_tax_relevant type="boolean">false</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <recurrence-id>19</recurrence-id>
    <person-id nil="true"></person-id>
    <created-at type="dateTime">2011-08-19T13:33:02-03:00</created-at>
    <updated-at type="dateTime">2011-08-19T13:33:02-03:00</updated-at>
    <recurrent type="boolean">false</recurrent>
    <parcelled type="boolean">true</parcelled>
    <recurrence-period>weekly</recurrence-period>
    <number-of-parcels type="integer">7</number-of-parcels>
    <current-parcel type="integer">1</current-parcel>
    <competency-month>2011-09</competency-month>
    <sale-account-id nil="true" />
    <sale-ids type="array">
    </sale-ids>
    <financial-account-taxes-attributes type="array">
      <financial-account-taxes-attribute>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </financial-account-taxes-attribute>
    </financial-account-taxes-attributes>
    <tax-charges type="array">
      <tax-charge>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charge>
    </tax-charges>
    <custom-classifications type="array">
      <custom-classification>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
    <reconciliations>
      <financial-transactions type="array">
      </financial-transactions>
      <financial-accounts type="array">
      </financial-accounts>
    </reconciliations>
    <links type="array">
      <link>
        <rel>self</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>get</method>
      </link>
      <link>
        <rel>destroy</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1</href>
        <method>delete</method>
      </link>
      <link>
        <rel>pay</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/1/pay</href>
        <method>put</method>
      </link>
      <link>
        <rel>next</rel>
        <href>https://financeiro.fintera.com.br/entities/1/payable_accounts/2</href>
        <method>get</method>
      </link>
    </links>
  </payable-account>

Alterar uma Conta a Pagar

Requisição

PUT /entities/:entity_id/payable_accounts/: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 e uma representação do objeto, como é mostrado no exemplo de resposta em "Exibir uma Conta a Pagar". Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque o objeto não pôde ser criado.

Exemplo de Requisição

{
  "payable_account": {
    "due_date": "2011-09-20",
    "occurred_at": null,
    "amount": "-100.0",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "total_amount": null,
    "description": null,
    "document": "827982719",
    "observation": "Papelaria",
    "remind": false,
    "income_tax_relevant": false,
    "category_id": null,
    "classification_center_id": null,
    "person_id": null,
    "expected_deposit_account_id": null,
    "create_as_recurrent": null,
    "competency_month": "2011-11",
    "payment_information_attributes": {
      "id": 1,
      "payment_type": "TedTransfer",
      "beneficiary_name": "João da Silva",
      "beneficiary_document_number": "11111111111",
      "beneficiary_bank_code": "341",
      "beneficiary_bank_agency": "1234",
      "beneficiary_bank_agency_digit": "0",
      "beneficiary_bank_account_number": "09999",
      "beneficiary_bank_account_digit": "0"
    },
    "tax_charges": [
      {
        "id": 1,
        "tax_id": 1,
        "amount": "20.0",
        "withholding": true
      },
      {
        "id": 2,
        "_destroy": "true"
      }
    ],
    "custom_classifications": [
      {
        "id": 27,
        "custom_classifier_id": 1,
        "custom_classifier_name": "Região",
        "value": "Sudeste", # DEPRECATED
        "name": "Sudeste",
        "amount": 36,
      }
    ],
    "classification_center_classifications":[
      {
        "classification_center_id": 1,
        "name": "Sudeste",
        "amount": "36.0"
      }
    ],
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <due-date type="date">2011-09-20</due-date>
    <occurred-at nil="true"></occurred-at>
    <amount>-100.0</amount>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount nil="true"></total-amount>
    <description nil="true"></description>
    <document>34839430</document>
    <observation>Papelaria</observation>
    <remind type="boolean">false</remind>
    <income_tax_relevant type="boolean">false</income_tax_relevant>
    <category-id nil="true"></category-id>
    <classification-center-id nil="true"></classification-center-id>
    <person-id nil="true"></person-id>
    <expected-deposit-account-id nil="true"></expected-deposit-account-id>
    <create-as-recurrent></create-as-recurrent>
    <competency-month>2011-11</competency-month>
    <payment-information-attributes>
      <id type="integer">1</id>
      <payment-type>TedTransfer</payment-type>
      <beneficiary-name nil="true">João da Silva</beneficiary-name>
      <beneficiary-document-number nil="true">11111111111</beneficiary-document-number>
      <beneficiary-bank-code nil="true">341</beneficiary-bank-code>
      <beneficiary-bank-agency nil="true">1234</beneficiary-bank-agency>
      <beneficiary-bank-agency-digit nil="true">0</beneficiary-bank-agency-digit>
      <beneficiary-bank-account-number nil="true">09999</beneficiary-bank-account-number>
      <beneficiary-bank-account-digit nil="true">0</beneficiary-bank-account-digit>
    </payment-information-attributes>
    <tax-charges-attributes type="array">
      <tax-charges-attribute>
        <id type="integer">1</id>
        <tax-id type="integer">1</tax-id>
        <amount type="decimal">20.0</amount>
        <withholding type="boolean">true</withholding>
      </tax-charges-attribute>
      <tax-charges-attribute>
        <id type="integer">2</id>
        <_destroy type="boolean">true</_destroy>
      </tax-charges-attribute>
    </tax-charges-attributes>
    <custom-classifications type="array">
      <custom-classification>
        <id type="integer">27</id>
        <custom-classifier-id type="integer">1</custom-classifier-id>
        <custom-classifier-name>Região</custom-classifier-name>
        <value>Sudeste</value> # DEPRECATED
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </custom-classification>
    </custom-classifications>
    <classification-center-classifications type="array">
      <classification-center-classification>
        <id type="integer">27</id>
        <classification-center-id type="integer">1</classification-center-id>
        <name>Sudeste</name>
        <amount type="decimal">36.0</amount>
      </classification-center-classification>
    </classification-center-classifications>
  </payable-account>

Criar/Alterar classificadores de uma Conta a Pagar pelo nome

POST /entities/:entity_id/payable_accounts
ou
PUT /entities/:entity_id/payable_accounts/:id

Na criação/alteração de uma conta a pagar ao invés de informar o atributo id do classificador (Category, ClassificationCenter, Person) é 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

{
  "payable_account": {
    "amount": "100.0",
    "due_date": "2011-09-20",
    "description": null,
    "category_name": "Nova categoria",
    "classification_center_name": "Novo Centro de custo",
    "person_name": "Nova pessoa",
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <amount>100.0</amount>
    <due-date type="date">2011-09-20</due-date>
    <description nil="true"></description>
    <category-name>Nova categoria</category-name>
    <classification-center-name>Novo Centro de custo</classification-center-name>
    <person-name>Noca pessoa</person-name>
  </payable-account>

Pagar uma Conta a Pagar

Requisição

PUT /entities/:entity_id/payable_accounts/:id/pay

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

Em caso de sucesso, retorna 200 OK e uma representação do objeto, como é mostrado no exemplo de resposta em "Exibir uma Conta a Pagar". Em caso de erro, retorna 422 Unprocessable Entity e as mensagens de erro informando porque a conta não pôde ser paga.

Exemplo de Requisição

{
  "payable_account": {
    "occurred_at": "2011-08-19",
    "ticket_amount": null,
    "interest_amount": null,
    "discount_amount": null,
    "nominal_amount": null,
    "amount": "-100.0",
    "total_amount": "-100.0",
    "attachment_id_list": [19, 42]
  }
}
<?xml version="1.0" encoding="UTF-8"?>
  <payable-account>
    <occurred-at type="date">2011-09-20</occurred-at>
    <ticket-amount nil="true"></ticket-amount>
    <interest-amount nil="true"></interest-amount>
    <discount-amount nil="true"></discount-amount>
    <nominal-amount nil="true"></nominal-amount>
    <total-amount>-100.0</total-amount>
    <amount>-100.0</amount>
    <attachment_id_list type="array">
      <fixnum type="integer">19</fixnum>
      <fixnum type="integer">42</fixnum>
    </attachment_id_list>
  </payable-account>

Desfazer o pagamento de uma Conta a Pagar já paga

Requisição

PUT /entities/:entity_id/payable_accounts/:id/undo_payment

Retorna 200 OK e uma representação do objeto, como é mostrado no exemplo de resposta em "Exibir uma Conta a Pagar".

Apagar uma Conta a Pagar

Exemplo de Requisição

DELETE /entities/:entity_id/payable_accounts/:id

Retorna 200 OK.

Apagar uma Conta a Pagar Recorrente e terminar a recorrência

Exemplo de Requisição

DELETE /entities/:entity_id/payable_accounts/:id/recurrence

Retorna 200 OK.

Apagar várias Contas a Pagar

DELETE /entities/:entity_id/payable_accounts?selected_ids=:id1,:id2,:id3

Apaga todas as contas a pagar especificadas. Retorna 200 OK.