Sumário


Objetivo


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

Recurso disponível a partir da release 12.1.2406.

1 - Campos e Parâmetros





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

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-
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 
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-
MoedaValores(valuesCurrencies)
CampoIdentificadorTipoDescriçãoObservação
companyIdCODCOLIGADAIntColigada MoedaObrigatório 
entryNumberIdIDPARTIDAIntIdentificador da PartidaObrigatório 
currencyMOEDAStringSímbolo da MoedaObrigatório 
valueVALORDecimalValor MoedaObrigatório 
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:

2.1 - GET


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

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

Domínio: localhost

Porta: 8051

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

{
    "hasNext": false,
    "items": [
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "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",
                    "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": []
                }
            ]
        },
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "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",
                    "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)

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

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

Domínio: localhost

Porta: 8051

Campo: description

Tipo de Ordenação: Ascendente

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

{
    "hasNext": false,
    "items": [
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "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",
                    "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": []
                }
            ]
        },
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 11,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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": []
                }
            ]
        }
     ]
}

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

Domínio: localhost

Porta: 8051

Campo: description

Tipo de Ordenação: Descendente

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

   {
    "hasNext": false,
    "items": [
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 20,
            "batchCode": 0,
            "description": "GAS 2",
            "accountEntry": [
                {
                    "entryNumberId": 23,
                    "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",
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 21,
                        "idpartida": 23,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        },
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 22,
            "batchCode": 0,
            "description": "GAS 2",
            "accountEntry": [
                {
                    "entryNumberId": 25,
                    "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",
                    "generationType": "O",
                    "user": "mestre",
                    "complementaryFields": {
                        "codlote": 0,
                        "lctref": 23,
                        "idpartida": 25,
                        "idinteiro": 0
                    },
                    "batchCodeOrigin": 0,
                    "operationId": 0,
                    "reversalAccountId": 0,
                    "groupAccountId": 0,
                    "accountId": 0,
                    "itemAmountRAS": 0,
                    "apportionmentDebit": [],
                    "apportionmentCredit": [],
                    "valuesCurrencies": [],
                    "apportionmentValuesCurrencies": []
                }
            ]
        }
  ]
}


2.1.3 - Filter (Resultado filtrado)


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

Domínio: localhost

Porta: 8051

Campo: entryId

Valor: 9

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

{
    "hasNext": false,
    "items": [
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "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",
                    "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": []
                }
            ]
        }
    ]
}

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


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

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

Domínio: localhost

Porta: 8051

Valor1: 1

Valor2: 3

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

{
    "hasNext": true,
    "items": [
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 9,
            "batchCode": 0,
            "description": "GAS",
            "accountEntry": [
                {
                    "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",
                    "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": []
                }
            ]
        },
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 10,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "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",
                    "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": []
                }
            ]
        },
        {
            "reversal": false,
            "companyId": 6,
            "entryId": 11,
            "batchCode": 0,
            "description": "BLOCO K",
            "accountEntry": [
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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": []
                },
                {
                    "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",
                    "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)


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

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

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

{
    "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 put"
        },
        {
            "entryId": 14,
            "batchCode": 50,
            "description": "Contabilização aquisição do Patrimônio 01.01.001__1"
        },
        {
            "entryId": 20,
            "batchCode": 0,
            "description": "GAS 2"
        },
        {
            "entryId": 22,
            "batchCode": 0,
            "description": "GAS 2"
        },
        {
            "entryId": 23,
            "batchCode": 0,
            "description": "GAS"
        },
        {
            "entryId": 24,
            "batchCode": 0,
            "description": "GAS"
        },
        {
            "entryId": 26,
            "batchCode": 0,
            "description": "GAS"
        },
        {
            "entryId": 29,
            "batchCode": 0,
            "description": "EQUIVALENCIA - AUTOMAÇÃO"
        }
    ]
}

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


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.

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

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 9

batchCode: 0

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

{
    "reversal": false,
    "companyId": 6,
    "entryId": 9,
    "batchCode": 0,
    "description": "GAS",
    "accountEntry": [
        {
            "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",
            "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)


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

Domínio: localhost

Porta: 8051

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

{
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "userId": "mestre",
    "description": "EQUIVALENCIA - AUTOMAÇÃO put",
    "accountEntry": [
        {
            "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",
            "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": []
        },
        {
            "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",
            "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": []
        }
    ]
}
{
    "reversal": false,
    "companyId": 6,
    "entryId": 30,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO",
    "accountEntry": [
        {
            "entryNumberId": 37,
            "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",
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 35,
                "idpartida": 37,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        },
        {
            "entryNumberId": 38,
            "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",
            "generationType": "O",
            "user": "mestre",
            "complementaryFields": {
                "codlote": 0,
                "lctref": 36,
                "idpartida": 38,
                "idinteiro": 0
            },
            "batchCodeOrigin": 0,
            "operationId": 0,
            "reversalAccountId": 0,
            "groupAccountId": 0,
            "accountId": 0,
            "itemAmountRAS": 0,
            "apportionmentDebit": [],
            "apportionmentCredit": [],
            "valuesCurrencies": [],
            "apportionmentValuesCurrencies": []
        }
    ]
}
{
    "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


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

Domínio: localhost

Porta: 8051

CompanyId: 6

entryId: 12

batchCode: 0

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

{
    "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"
        }
    ]
}
{
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO",
    "accountEntry": [
        {
            "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",
            "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": []
        },
        {
            "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",
            "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": []
        }
    ]
}
{
    "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)


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

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 12

batchCode: 0

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

{
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "userId": "mestre",
    "description": "EQUIVALENCIA - AUTOMAÇÃO put",
    "accountEntry": [
        {
            "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",
            "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": []
        },
        {
            "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",
            "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": []
        }
    ]
}
{
    "reversal": false,
    "companyId": 6,
    "entryId": 12,
    "batchCode": 0,
    "description": "EQUIVALENCIA - AUTOMAÇÃO put",
    "accountEntry": [
        {
            "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",
            "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": []
        },
        {
            "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",
            "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": []
        }
    ]
}
{
    "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
}
{
    "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
}
{
    "code": "FE016",
    "message": "O campo \"companyId - Código da Coligada\" deve ser preenchido no Lançamento e na Partida.",
    "detailedMessage": "",
    "helpUrl": "",
    "details": null
}
{
    "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)


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

Domínio: localhost

Porta: 8051

companyId: 6

entryId: 13

batchCode: 0

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

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

{
    "code": "FE011",
    "message": "Registro não encontrado na base de dados.",
    "detailedMessage": "",
    "helpUrl": "",
    "details": null
}