Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Sumário


Índice
excludeSumário

Objetivo


      Esse documento tem o objetivo de exemplificar o uso da API de Lançamento e Partida utilizando todos os métodos implementados.

Nota
titleImportante

Recurso disponível a partir da release 12.1.2406.

1 - Campos e Parâmetros



Informações
titleParâmetros



Informações
iconfalse
Expandir
titleLançamento
LANÇAMENTO
CampoIdentificadorTipoDescriçãoObservação
operationIdIDOPERACAOIntIdentificador de OperaçãoObrigatório
reversalESTORNOBooleanLançamento de EstornoObrigatório
companyIdCODCOLIGADAIntColigadaObrigatório
entryIdIDLANCAMENTOIntId do LançamentoObrigatório
batchCodeCODLOTEIntCódigo do Lote ContábilObrigatório
descriptionDESCRICAOStringDescrição do LançamentoObrigatório
accountEntryPARTIDAListaPartidasObrigatório
Informações
iconfalse
Expandir
titlePartida

PARTIDA (accountEntry)

Campo

IdentificadorTipoDescriçãoObservação
companyIdCODCOLIGADAIntColigadaRecupera a Coligada do Lançamento
batchCodeCODLOTEIntCódigo do lote atualRecupera o Lote do Lançamento
entryIdIDLANCAMENTOIntIdentificador do lançamentoObrigatório
entryNumberIdIDPARTIDAIntIdentificador da PartidaObrigatório
branchIdCODFILIALIntFilialObrigatório
branchNameNOMEFILIALStringDescrição Filial-
dateDATADateDataObrigatório validado de acordo com o período contábil
dateInclusionDATAINCLUSAODateData da inclusão do lançamentoRecupera a data da execução
companyIdDebitAccountCodColDebitoIntColigada da Conta a DébitoObrigatório se tiver conta Debito
debitAccountCodContaDebitoStringCód. conta débitoObrigatório pelo menos uma conta de debito ou credito
debitDescriptionDescricaoDebitoStringDescrição da Conta Débito-
companyIdCreditAccountCodColCreditoIntColigada da Conta a CréditoObrigatório pelo menos uma conta de debito ou credito
creditAccountCodContaCreditoStringCód. conta créditoObrigatório se tiverconta Credito
creditDescriptionDescricaoCreditoStringDescrição da Conta Crédito-
companyIdAgainstEntryCodColContraPartidaIntColigada da Conta Contra Partida-
valueVALORDecimalValorObrigatório 
value2VALOR2DecimalSegundo Valor -
date2DATA2DataData da Cotação do Segundo Valor-
integrateApplicationIntegraAplicacaoStringCódigo da Aplicação que Gerou o Lct.Obrigatório 
originNewModOriginadoNovoModoIntIndica se a partida é originada do novoObrigatório 
generationTypeTipoGeracaoStringTipo de GeraçãoObrigatório 
userUsuarioStringUsuário que incluiu lançamentoObrigatório 
complementaryFieldsCamposComplementaresListaComplemento-
apportionmentDebitRateioDebitoListaRateio Debito -
apportionmentCreditRateioCreditoListaRateio Credito-
valuesCurrenciesMoedaValoresListaMultiMoedas-
apportionmentValuesCurrenciesRateioMoedasValoresListaRateio MultiMoedas-
Informações
iconfalse
Expandir
titleCampos Complementares
CamposComplementares (complementaryFields)
CampoIdentificadorTipoDescriçãoObservação
codloteCODLOTEIntCódigo do lote atualObrigatório 
lctrefLCTREFIntReferência do LançamentoObrigatório 
idpartidaIDPARTIDAIntIdentificador da PartidaObrigatório 
idinteiroIDINTERNOIntIdentificador de Campo ComplementarObrigatório 
Informações
iconfalse
Expandir
titleRateios Credito/Debito
RateioDebito (apportionmentDebit) / RateioCredito(apportionmentCredit)
CampoIdentificadorTipoDescriçãoObservação
companyIdCODCOLIGADAIntColigada do RateioObrigatório 
dateDATADataData do Lançamento do RateioObrigatório 
companyIdAccountManagementCODCOLCONTAIntCódigo da Coligada da Conta ContábilObrigatório 
accountManagementInactiveATIVOIntStatusObrigatório 
accountManagementCodeCODCONTAStringCódigo da ContaObrigatório 
apportionmentIdIDRATEIOIntIdentificador do RateioObrigatório 
entryNumberIdIDPARTIDAIntIdentificador da PartidaObrigatório 
valueVALORDecimalValorObrigatório 
percentualPERCENTUALStringPorcentagem do Rateio-
Informações
iconfalse
Expandir
titleMultimoeda
MoedaValores(valuesCurrencies)
CampoIdentificadorTipoDescriçãoObservação
companyIdCODCOLIGADAIntColigada MoedaObrigatório 
entryNumberIdIDPARTIDAIntIdentificador da PartidaObrigatório 
currencyMOEDAStringSímbolo da MoedaObrigatório 
valueVALORDecimalValor MoedaObrigatório 
Informações
iconfalse
Expandir
titleRateio Multimoeda
RateioMoedasValores(apportionmentValuesCurrencies)
CampoIdentificadorTipoDescriçãoObservação
companyIdCODCOLIGADAIntColigadaObrigatório 
apportionmentIdIDMULTIMOEDAIntIdentificador de MultiMoedaObrigatório 
currencyMOEDAStringMoeda utlizada no rateio multi moeda.Obrigatório 
valueVALORDecimalValor do rateio convertido para moeda cadastrada.Obrigatório 


2 - Métodos


      Serão apresentados 5 métodos, os quais foram implementados na API de Lançamento e Partida, são eles:

  • GET
  • POST
  • PATCH
  • PUT
  • DELETE

2.1 - GET


2.1.1 - Get All (Recuperar todas os Lançamento e Partida)

Informações
iconfalse
titleGetAll

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "hasNext": false,
    "items": [
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 9,
                    "entryNumberId": 8,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-09-15T00:00:00-03:00",
                    "dateInclusion": "2017-09-15T11:44:42-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.892",
                    "debitDescription": "COLIG. 6 FILIAL 12",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.002",
                    "creditDescription": "Caixa Filial Rio de Janeiro",
                    "companyIdAgainstEntry": 0,
                    "value": 111.00,
                    "value2": 200.00,
                    "date2": "2011-09-15T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 8,
                        "idpartida": 8,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        },
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 10,
                    "entryNumberId": 9,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T16:01:07-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.017",
                    "debitDescription": "BLOCO K 200 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "2.1.1.1.015",
                    "creditDescription": "200,00 C",
                    "companyIdAgainstEntry": 0,
                    "value": 200.00,
                    "value2": 400.00,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "historicCode": "011",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 9,
                        "idpartida": 9,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        }
    ]
}


2.1.2 - Order (Retorna os dados ordenados)

Informações
titleParâmetros

Order: parâmetro responsável pela ordenação do resultado, podendo ser ascendente ou descendente. O resultado com a ordem descendente deve ser precedida do caractere "-" (menos).

Exemplo 1: ?order=campo1 (Ascendente)

Exemplo 2: ?order=-campo1 (Descendente)

Múltiplos campos de ordenação: ?order=[-]campo1, [-]campo2, [-]campo3 ...

Informações
iconfalse
titleOrder (Asc)

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}?order={campo}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: description

Tipo de Ordenação: Ascendente

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6?order=description

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "hasNext": false,
    "items": [
        {
            "id": "14|00002",
            "company": 14,
            "code": "00002",
            "description": "00002",
            "instantBalance": 0.0000,
            "databaseBalance": 0.0000,
            "cashAccountDatabase": "2020-02-19T00:00:00-03:00",
            "proprietaryCompany": 14,
            "unpaidBalance": -57378.9400,
            "currencyCode": "R$",
            "active": 1,
            "cashBookCode": "888",
            "allowOpenning": 0
        },
        {
            "id": "1|0005",
            "company": 1,
            "code": "0005",
            "description": "APLICACAO BANCO REAL",
            "instantBalance": 16620.0000,
            "databaseBalance": 120.0000,
            "cashAccountDatabase": "1999-12-15T00:00:00-03:00",
            "proprietaryCompany": 6,
            "bankNumber": "275",
            "agencyNumber": "002233",
            "accountNumber": "22200",
            "unpaidBalance": 0.0000,
            "currencyCode": "R$",
            "active": 1,
            "lastCashNumber": "1",
            "allowOpenning": 1
        },
        {
            "id": "1|0066",
            "company": 1,
            "code": "0066",
            "description": "BANCO BEMGE",
            "instantBalance": 200000.0000,
            "databaseBalance": 200000.0000,
            "cashAccountDatabase": "2015-01-09T00:00:00-03:00",
            "proprietaryCompany": 1,
            "unpaidBalance": 0.0000,
            "currencyCode": "R$",
            "active": 1,
            "branchCode": 1,
            "allowOpenning": 0
        },
        {
            "id": "1|0009",
            "company": 1,
            "code": "0009",
            "description": "BANCO BRADESCO",
            "instantBalance": 65155.2500,
            "databaseBalance": 100000.0000,
            "cashAccountDatabase": "2004-11-03T00:00:00-03:00",
            "proprietaryCompany": 1,
            "bankNumber": "237",
            "agencyNumber": "0065",
            "accountNumber": "0019284",
            "unpaidBalance": 0.0000,
            "currencyCode": "R$",
            "active": 1,
            "allowOpenning": 0
        },
        {
            "id": "1|0008",
            "company": 1,
            "code": "0008",
            "description": "BANCO DO BRASIL",
            "instantBalance": 203690.1300,
            "databaseBalance": 0.0000,
            "cashAccountDatabase": "2004-09-14T00:00:00-03:00",
            "proprietaryCompany": 1,
            "bankNumber": "001",
            "agencyNumber": "3489",
            "accountNumber": "14714",
            "unpaidBalance": 15500.0000,
            "currencyCode": "R$",
            "active": 1,
            "allowOpenning": 0
        }
    ]
}
Informações
iconfalse
titleOrder (Desc)

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}?order=[-]{campo}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: description

Tipo de Ordenação: Descendente

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6?order=-description

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
   {
    "hasNext": false,
    "items": [
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 9,
                    "entryNumberId": 8,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-09-15T00:00:00-03:00",
                    "dateInclusion": "2017-09-15T11:44:42-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.892",
                    "debitDescription": "COLIG. 6 FILIAL 12",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.002",
                    "creditDescription": "Caixa Filial Rio de Janeiro",
                    "companyIdAgainstEntry": 0,
                    "value": 111.00,
                    "value2": 200.00,
                    "date2": "2011-09-15T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 8,
                        "idpartida": 8,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        },
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 12,
            "batchCode": 0,
            "description": "EQUIVALENCIA - AUTOMAÇÃO",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 12,
                    "entryNumberId": 14,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-05-07T00:00:00-03:00",
                    "dateInclusion": "2019-09-12T11:31:48-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.001",
                    "debitDescription": "Caixa Geral",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "4.1.1.1.001",
                    "creditDescription": "Vendas de Sistemas de Contabilidade",
                    "companyIdAgainstEntry": 0,
                    "value": 500000.00,
                    "value2": 1000000.00,
                    "date2": "2011-05-07T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 14,
                        "idpartida": 14,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                },
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 12,
                    "entryNumberId": 15,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-05-07T00:00:00-03:00",
                    "dateInclusion": "2019-09-12T11:31:48-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "3.1.1.3.001",
                    "debitDescription": "DESPESAS FINANCEIRAS",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.001",
                    "creditDescription": "Caixa Geral",
                    "companyIdAgainstEntry": 0,
                    "value": 250000.00,
                    "value2": 500000.00,
                    "date2": "2011-05-07T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 15,
                        "idpartida": 15,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        } 
	]
}


2.1.3 - Filter (Resultado filtrado)


Informações
iconfalse
titleFilter

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}?{campo}={valor}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: entryId

Valor: 9

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6?entryId=9

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "hasNext": false,
    "items": [
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 9,
                    "entryNumberId": 8,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-09-15T00:00:00-03:00",
                    "dateInclusion": "2017-09-15T11:44:42-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.892",
                    "debitDescription": "COLIG. 6 FILIAL 12",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.002",
                    "creditDescription": "Caixa Filial Rio de Janeiro",
                    "companyIdAgainstEntry": 0,
                    "value": 111.00,
                    "value2": 200.00,
                    "date2": "2011-09-15T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 8,
                        "idpartida": 8,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        }
    ]
}
Informações
titleFiltros Complexos - OData

Para realizar filtros complexos na API de Lançamento e Partida é possível adotar o padrão OData. Para entender melhor sobre a utilização desse padrão, acesse o link da documentação Utilizando filtros complexos - Exemplos do guia de API - ODATA.

2.1.4 - Paginação


Informações
titleParâmetros

Page: Página que será apresentada.

PageSize: Quantidade máxima de registros por página que serão apresentados.

Exemplo: ?page=1&pageSize=1

Valores padrão: Caso não sejam preenchidos os parâmetros evidenciados acima serão preenchidos com valores padrão.

Page: 1

PageSize: 20

Informações
iconfalse
titlePaginação

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}?page={valor1}&pageSize={valor2}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Valor1: 1

Valor2: 3

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6?page=1&pageSize=3

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "hasNext": true,
    "items": [
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 9,
                    "entryNumberId": 8,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2011-09-15T00:00:00-03:00",
                    "dateInclusion": "2017-09-15T11:44:42-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.892",
                    "debitDescription": "COLIG. 6 FILIAL 12",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.002",
                    "creditDescription": "Caixa Filial Rio de Janeiro",
                    "companyIdAgainstEntry": 0,
                    "value": 111.00,
                    "value2": 200.00,
                    "date2": "2011-09-15T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 8,
                        "idpartida": 8,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        },
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 10,
                    "entryNumberId": 9,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T16:01:07-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.017",
                    "debitDescription": "BLOCO K 200 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "2.1.1.1.015",
                    "creditDescription": "200,00 C",
                    "companyIdAgainstEntry": 0,
                    "value": 200.00,
                    "value2": 400.00,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "historicCode": "011",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 9,
                        "idpartida": 9,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        },
        {
            "operationId": 0,
            "reversal": false,
            "companyId": 6,
            "entryId": 11,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 11,
                    "entryNumberId": 10,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T17:06:56-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "2.1.1.1.016",
                    "debitDescription": "585,76 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.018",
                    "creditDescription": "585,76 C",
                    "companyIdAgainstEntry": 0,
                    "value": 585.76,
                    "value2": 1171.52,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 10,
                        "idpartida": 10,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                },
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 11,
                    "entryNumberId": 11,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T18:10:39-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "2.1.1.1.017",
                    "debitDescription": "1122,12 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.019",
                    "creditDescription": "1122,12 C",
                    "companyIdAgainstEntry": 0,
                    "value": 1122.12,
                    "value2": 2244.24,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 11,
                        "idpartida": 11,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                },
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 11,
                    "entryNumberId": 12,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T18:26:03-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "1.1.1.1.020",
                    "debitDescription": "6,00 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "2.1.1.1.018",
                    "creditDescription": "6,00 C",
                    "companyIdAgainstEntry": 0,
                    "value": 6.00,
                    "value2": 12.00,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "historicCode": "011",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 12,
                        "idpartida": 12,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                },
                {
                    "companyId": 6,
                    "batchCode": 0,
                    "entryId": 11,
                    "entryNumberId": 13,
                    "branchId": 12,
                    "branchName": "ESCOLA EXEMPLO 1",
                    "date": "2017-04-11T00:00:00-03:00",
                    "dateInclusion": "2018-04-11T18:36:57-03:00",
                    "companyIdDebitAccount": 6,
                    "debitAccount": "2.1.1.1.019",
                    "debitDescription": "256,00 D",
                    "companyIdCreditAccount": 6,
                    "creditAccount": "1.1.1.1.021",
                    "creditDescription": "256,00 C",
                    "companyIdAgainstEntry": 0,
                    "value": 256.00,
                    "value2": 512.00,
                    "date2": "2017-04-11T00:00:00-03:00",
                    "integrateApplication": "C",
                    "originNewMod": 1,
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 13,
                        "idpartida": 13,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "userModified": "mestre",
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        }
    ]
}

2.1.5 - Fields (Retorno de campos específicos no resultado)


Informações
titleParâmetros

Fields: parâmetro responsável pela especialização de campos em um resultado, ou seja, o usuário define quais campos serão apresentados no resultado.

Exemplo: ?fields=campo1

Múltiplos campos de ordenação: ?fields=campo1, campo2, campo3 ...

Informações
iconfalse
titleFields

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}?fields={campos}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Campo 1: entryId

Campo 2: batchCode

Campo 3: description

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6?fields=entryId,batchCode,description

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "hasNext": false,
    "items": [
        {
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS"
        },
        {
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K"
        },
        {
            "entryId": 11,
            "batchCode": 0,
            "description": "BLOCO K"
        },
        {
            "entryId": 12,
            "batchCode": 0,
            "description": "EQUIVALENCIA - AUTOMAÇÃO"
        },
        {
            "entryId": 13,
            "batchCode": 0,
            "description": "EQUIVALENCIA - AUTOMACAO"
        },
        {
            "entryId": 14,
            "batchCode": 50,
            "description": "Contabilização aquisição do Patrimônio 01.01.001__1"
        }
    ]
}

2.1.6 - GetOne (Recuperar Lançamento e Partida pela chave composta)


Informações
titleParâmetros

Nos parâmetros do GetOne é necessário passar uma chave composta ("id"), por isso informamos "companyId" é o código da coligada de Lançamento que queremos selecionar, o "entryId" é o Id de Lançamento, o "batchCode" é o código Lote, sendo eles separados pelo caractere "|" pipe.

Informações
iconfalse
titleGetOne

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}/{entryId}|{batchCode}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 9

batchCode: 0

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6/9|0

Informações
iconfalse
titleExemplo de Resultado
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 9,
    "batchCode": 0,
    "description": "GAS",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 9,
            "entryNumberId": 8,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-09-15T00:00:00-03:00",
            "dateInclusion": "2017-09-15T11:44:42-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "1.1.1.1.892",
            "debitDescription": "COLIG. 6 FILIAL 12",
            "companyIdCreditAccount": 6,
            "creditAccount": "1.1.1.1.002",
            "creditDescription": "Caixa Filial Rio de Janeiro",
            "companyIdAgainstEntry": 0,
            "value": 111.00,
            "value2": 200.00,
            "date2": "2011-09-15T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 8,
                "idpartida": 8,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "userModified": "mestre",
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}


2.2 - POST


2.2.1 - Post (Inserir um Lançamento e Partida)


Informações
iconfalse
titlePost

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6

Informações
iconfalse
titleExemplo de Entrada
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 14,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "1.1.1.1.001",
            "debitDescription": "Caixa Geral",
            "companyIdCreditAccount": 6,
            "creditAccount": "4.1.1.1.001",
            "creditDescription": "Vendas de Sistemas de Contabilidade",
            "companyIdAgainstEntry": 0,
            "value": 500000.00,
            "value2": 1000000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 14,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        },
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 15,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "3.1.1.3.001",
            "debitDescription": "DESPESAS FINANCEIRAS",
            "companyIdCreditAccount": 6,
            "creditAccount": "1.1.1.1.001",
            "creditDescription": "Caixa Geral",
            "companyIdAgainstEntry": 0,
            "value": 250000.00,
            "value2": 500000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 15,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}
Informações
iconfalse
titleExemplo de Resultado Positivo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 29,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 29,
            "entryNumberId": 33,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "1.1.1.1.001",
            "debitDescription": "Caixa Geral",
            "companyIdCreditAccount": 6,
            "creditAccount": "4.1.1.1.001",
            "creditDescription": "Vendas de Sistemas de Contabilidade",
            "companyIdAgainstEntry": 0,
            "value": 500000.00,
            "value2": 1000000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 31,
                "idpartida": 33,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        },
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 29,
            "entryNumberId": 34,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "3.1.1.3.001",
            "debitDescription": "DESPESAS FINANCEIRAS",
            "companyIdCreditAccount": 6,
            "creditAccount": "1.1.1.1.001",
            "creditDescription": "Caixa Geral",
            "companyIdAgainstEntry": 0,
            "value": 250000.00,
            "value2": 500000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 32,
                "idpartida": 34,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}
Informações
iconfalse
titleExemplo de Resultado Negativo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE006",
    "message": "Chave duplicada\r\n\r\nPossíveis causas:\r\n  - inclusão de registro cujo valor da chave primária já existe\r\n  - inclusão de registro cujo valor do índice único já existe",
    "detailedMessage": null,
    "helpUrl": null,
    "details": [
        {
            "code": "Exception",
            "message": "Violation of PRIMARY KEY constraint 'PKCLCOMPL'. Cannot insert duplicate key in object 'dbo.CLCOMPL'. The duplicate key value is (6, 8).\r\nThe statement has been terminated.",
            "detailedMessage": null,
            "helpUrl": null,
            "details": [
                {
                    "code": "Exception",
                    "message": "INSERT INTO [CLCOMPL] ([CODCOLIGADA], [CODLOTE], [LCTREF], [DOCUMENTO], [DIGITADOR], [KWHORA], [DATA], [VALIDADE], [RESPONSABILIDADE], [IDPARTIDA], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON], [SPEDFCONT], [IDDMPL], [IDINTEIRO]) VALUES (6, 0, 28, null, null, , null, null, null, 8, 'mestre', '26/03/2024 09:38:59', 'mestre', '26/03/2024 09:38:59', null, null, 0)",
                    "detailedMessage": null,
                    "helpUrl": null,
                    "details": null
                }
            ]
        },
        {
            "code": "Exception",
            "message": "INSERT INTO [CLCOMPL] ([CODCOLIGADA], [CODLOTE], [LCTREF], [DOCUMENTO], [DIGITADOR], [KWHORA], [DATA], [VALIDADE], [RESPONSABILIDADE], [IDPARTIDA], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON], [SPEDFCONT], [IDDMPL], [IDINTEIRO]) VALUES (6, 0, 28, null, null, , null, null, null, 8, 'mestre', '26/03/2024 09:38:59', 'mestre', '26/03/2024 09:38:59', null, null, 0)",
            "detailedMessage": null,
            "helpUrl": null,
            "details": null
        }
    ]
}

2.3 - PATCH


2.3.1 - Patch (Atualização parcial de um Lançamento e Partida) (INCOMPLETO)


Informações
iconfalse
titlePatch

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}/{entryId}|{batchCode}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

CompanyId: 6

entryId: 12

batchCode: 0

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6/12|0

Informações
iconfalse
titleExemplo de Entrada
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 14,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1 2",
            "debitDescription": "Caixa Geral 2 ",
            "creditDescription": "Vendas de Sistemas de Contabilidade 2"
        }
    ]
}
Informações
iconfalse
titleExemplo de Resultado Positivo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
	"id": "1|TesteAPI",
    "company": 1,
    "code": "TesteAPI",
    "description": "Teste edição conta caixa",
    "instantBalance": 0.0000,
    "databaseBalance": 0.0000,
    "cashAccountDatabase": "2023-10-31T00:00:00-03:00",
    "lastNumberCheckBank": "124758",
    "proprietaryCompany": 1,
    "unpaidBalance": 0.0000,
    "currencyCode": "R$",
    "bankAccountCompany": 1,
    "userLowerLimit": 1,
    "lowerLimit": 15000.0,
    "allowOpenning": 1,
    "lastCashNumber": "00005",
    "active": 1,
    "cpmfAutomatic": 0,
    "branchCode": 1,
    "batchCode": 0,
    "refundBatchCode": 0,
    "cutoffDateBalance": 0.0000
}
Informações
iconfalse
titleExemplo de Resultado Negativo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "Code": "FE016",
    "Message": "O Corpo da mensagem contêm valores inválidos.",
    "DetailMessage": "",
    "HelpUrl": "http://tdn.totvs.com/x/e0F0GQ",
    "Details": null
}

2.4 - PUT


2.4.1 - Put (Atualização completa de um Lançamento e Partida)


Informações
iconfalse
titlePut

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}/{entryId}|{batchCode}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 12

batchCode: 0

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6/12|0

Informações
iconfalse
titleExemplo de Entrada
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO put",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 14,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "1.1.1.1.001",
            "debitDescription": "Caixa Geral",
            "companyIdCreditAccount": 6,
            "creditAccount": "4.1.1.1.001",
            "creditDescription": "Vendas de Sistemas de Contabilidade",
            "companyIdAgainstEntry": 0,
            "value": 500000.00,
            "value2": 1000000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 14,
                "idpartida": 14,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        },
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 15,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "3.1.1.3.001",
            "debitDescription": "DESPESAS FINANCEIRAS",
            "companyIdCreditAccount": 6,
            "creditAccount": "1.1.1.1.001",
            "creditDescription": "Caixa Geral",
            "companyIdAgainstEntry": 0,
            "value": 250000.00,
            "value2": 500000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 15,
                "idpartida": 15,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}
Informações
iconfalse
titleExemplo de Resultado Positivo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "operationId": 0,
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO put",
    "accountEntry": [
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 14,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "1.1.1.1.001",
            "debitDescription": "Caixa Geral",
            "companyIdCreditAccount": 6,
            "creditAccount": "4.1.1.1.001",
            "creditDescription": "Vendas de Sistemas de Contabilidade",
            "companyIdAgainstEntry": 0,
            "value": 500000.00,
            "value2": 1000000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 14,
                "idpartida": 14,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "userModified": "mestre",
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        },
        {
            "companyId": 6,
            "batchCode": 0,
            "entryId": 12,
            "entryNumberId": 15,
            "branchId": 12,
            "branchName": "ESCOLA EXEMPLO 1",
            "date": "2011-05-07T00:00:00-03:00",
            "dateInclusion": "2019-09-12T11:31:48-03:00",
            "companyIdDebitAccount": 6,
            "debitAccount": "3.1.1.3.001",
            "debitDescription": "DESPESAS FINANCEIRAS",
            "companyIdCreditAccount": 6,
            "creditAccount": "1.1.1.1.001",
            "creditDescription": "Caixa Geral",
            "companyIdAgainstEntry": 0,
            "value": 250000.00,
            "value2": 500000.00,
            "date2": "2011-05-07T00:00:00-03:00",
            "integrateApplication": "C",
            "originNewMod": 1,
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 15,
                "idpartida": 15,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "userModified": "mestre",
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}
Informações
iconfalse
titleExemplo de Resultados Negativo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE013",
    "message": "Os campos que compõem a chave primária não podem ser diferentes dos informados na requisição.",
    "detailedMessage": "",
    "helpUrl": "",
    "details": null
}
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE019",
    "message": "Erro durante a requisição de alteração do registro. A partida não foi incluída, pois a Conta Contábil 1.1.1.1.00 da Coligada 6 não foi encontrada no plano de Contas",
    "detailedMessage": null,
    "helpUrl": null,
    "details": null
}
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE016",
    "message": "O campo \"companyId - Código da Coligada\" deve ser preenchido no Lançamento e na Partida.",
    "detailedMessage": "",
    "helpUrl": "",
    "details": null
}
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE006",
    "message": "Chave duplicada\r\n\r\nPossíveis causas:\r\n  - inclusão de registro cujo valor da chave primária já existe\r\n  - inclusão de registro cujo valor do índice único já existe",
    "detailedMessage": null,
    "helpUrl": null,
    "details": [
        {
            "code": "Exception",
            "message": "Violation of PRIMARY KEY constraint 'PKCLCOMPL'. Cannot insert duplicate key in object 'dbo.CLCOMPL'. The duplicate key value is (6, 14).\r\nThe statement has been terminated.",
            "detailedMessage": null,
            "helpUrl": null,
            "details": [
                {
                    "code": "Exception",
                    "message": "INSERT INTO [CLCOMPL] ([CODCOLIGADA], [CODLOTE], [LCTREF], [DOCUMENTO], [DIGITADOR], [KWHORA], [DATA], [VALIDADE], [RESPONSABILIDADE], [IDPARTIDA], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON], [SPEDFCONT], [IDDMPL], [IDINTEIRO]) VALUES (6, 0, 33, null, null, , null, null, null, 14, 'mestre', '26/03/2024 11:02:14', 'mestre', '26/03/2024 11:02:14', null, null, 0)",
                    "detailedMessage": null,
                    "helpUrl": null,
                    "details": null
                }
            ]
        },
        {
            "code": "Exception",
            "message": "INSERT INTO [CLCOMPL] ([CODCOLIGADA], [CODLOTE], [LCTREF], [DOCUMENTO], [DIGITADOR], [KWHORA], [DATA], [VALIDADE], [RESPONSABILIDADE], [IDPARTIDA], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON], [SPEDFCONT], [IDDMPL], [IDINTEIRO]) VALUES (6, 0, 33, null, null, , null, null, null, 14, 'mestre', '26/03/2024 11:02:14', 'mestre', '26/03/2024 11:02:14', null, null, 0)",
            "detailedMessage": null,
            "helpUrl": null,
            "details": null
        }
    ]
}

2.5 - DELETE


2.5.1 - Delete (Exclui um Lançamento e Partida)


Informações
iconfalse
titleDelete

Máscara de Url: http://{domínio}:{porta}/api/ctb/v1/AccountingEntries/{companyId}/{entryId}|{batchCode}

Informações
iconfalse
titleExemplo de Configuração

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 13

batchCode: 0

Url Utilizada: http://localhost:8051/api/ctb/v1/AccountingEntries/6/13|0

Informações
iconfalse
titleExemplo de Resultado Positivo Postman

Obs.: Em caso de sucesso, será retornado o respondeCode = 204 e a resposta em branco.

Informações
iconfalse
titleExemplo de Resultado Negativo
Expandir
titleVer resultado JSON...
Bloco de código
languagejs
firstline1
titleResultado (JSON)
linenumberstrue
{
    "code": "FE011",
    "message": "Registro não encontrado na base de dados.",
    "detailedMessage": "",
    "helpUrl": "",
    "details": null
}