Attention
This feature is being developed and will be available from release 12.1.2310 onwards.
Data model to be used in the accounting entries API.
Header
Key | Value | Required | NOTE: |
Content-Type | application/json | X | N/A |
tenantId | T1,D MG 01 | X | (Company and Branch in which the accounting entry will be entered, reversed or deleted) Company Group+','+Company+Business Unit+Branch |
NOTE: Header must be sent to all methods
EndPoint: Path of the service REST Protheus + /api/ctb/accountingentry/insert Ex.: http://localhost:9090/api/ctb/accountingentry/insert
Body
Send it in Json format in accordance with the following model
Lot Cover
Field | Description | Type | Required | Note |
CT2_DATA | Entry Date | Character | Date sent in ddmmaaaa character format. For example: 08/29/2022. Default = system base date: | |
CT2_LOTE | Batch Number | Character | Default = '000001' | |
CT2_SBLOTE | Sub-batch Number | Character | Default = '001' | |
ITEMS | Accounting entry rows | Object Array | X | Each item corresponds to an entry row for the same batch cover |
Batch Items
Field | Description | Type | Required | Note |
CT2_DC | Entry Type | Character | X | 1 → Debit 2 → Credit 3→ Double Entry |
CT2_VALOR | Entry Amount | Numeric | X | decimal must be sent with the period character |
CT2_HIST | Entry History | Character | X | ** Default size in Protheus 40 |
CT2_DEBITO | Debit Account | Character | X | Required for entry types: Double Entry and Debit |
CT2_CREDIT | Credit Account | Character | X | Required for entry types: Double Entry and Credit |
CT2_TPSALD | Type of Balance | Character | Default = '1' | |
CT2_CONVER | Conversion Criterion | Character | Default = '1' . Define whether to generate accounting entries in other currencies, converted in accordance with the criterion | |
CT2_ORIGEM | Source of Entry | Character | Default = 'API ACCOUNTINGENTRY' . | |
CT2_HP | Default History | Character | N/A | |
CT2_CCD | Debit Cost Center | Character | N/A | |
CT2_CCC | Credit Cost Center | Character | N/A | |
CT2_ITEMD | Debit Item | Character | N/A | |
CT2_ITEMC | Credit Item | Character | N/A | |
CT2_CLVLDB | Debit Value Class | Character | N/A | |
CT2_CLVLCR | Credit Value Class | Character | N/A | |
CT2_EC05DB | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC05CR | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC06DB | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC06CR | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC07DB | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC07CR | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC08DB | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC08CR | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC09DB | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_EC09CR | Additional Entity (Without Nomenclature) | Character | N/A | |
CT2_KEY | Identifier Key | Character | N/A |
NOTE:
*For each batch cover, send 1 or more items.
**Document number will be automatically generated with the next one available for the key: Date, Batch, Sub-batch.
***Number of rows will be automatically generated for each item sent.
Example of Sending
{ "CT2_DATA":"9/1/2023" , "CT2_LOTE": "008960", "CT2_SBLOTE": "001", "ITENS":[{ "CT2_MOEDLC": "01", "CT2_DC" : "3", "CT2_CREDIT": "CTBXATUC", "CT2_DEBITO": "CTBXATUD", "CT2_VALOR": 1500.60 , "CT2_HIST": "DOUBLE ENTRY ", }, { "CT2_MOEDLC": "01", "CT2_DC" : "2", "CT2_CREDIT": "CTBXATUC", "CT2_VALOR": 1600 , "CT2_HIST": "DOUBLE ENTRY ", }] }
Example of Answer
{ "CompanyGroup": "T1", // company group in which the entry was inserted. "CT2_FILIAL": "D MG 01 ", // Branch in which the entry was inserted. "CT2_DOC": "000003", // Generated document number. "error": "" // Error will be returned blank if the inclusion is successful. In case of error, the error description is returned. }
Important
** If the sent content of field CT2_HIST is greater than the size of the field in Protheus, the system automatically generates history carry-forward rows (CT2_DC = 4) depending on the size of field CT2_HIST
EndPoint: Path of the service REST Protheus + /api/ctb/accountingentry/reversal Ex.: http://localhost:9090/api/ctb/accountingentry/reversal
Body
Send it in Json format in accordance with the following model
Field | Description | Type | Required | Note |
CT2_DATA | Entry Date | Character | X | Date of entry to be reversed. Sent in ddmmaaaa character format. For example: 08/29/2022. |
CT2_LOTE | Batch Number | Character | X | Batch number of entry to be reversed. |
CT2_SBLOTE | Sub-batch Number | Character | X | Sub-batch number of entry to be reversed. |
CT2_DOC | Document Number | Character | X | Document number of entry to be reversed. |
CT2_LOTEST | Batch number for reversal entry | Character | If not entered, it is generated with the same batch number as the source entry. | |
CT2_SBLOTEST | Sub-batch number for reversal entry | Character | If not entered, it is generated with the same Sub-batch number as the source entry. |
NOTE: *Document number will be automatically generated with the next one available for the key: Date, Batch, Sub-batch.
Example of Sending
{ "CT2_DATA": "09/01/2023" , "CT2_LOTE": "THIAGO", "CT2_SBLOTE": "001", "CT2_DOC" : "000003", "CT2_LOTEST":"EST001", "CT2_SBLOTEST":"001" }
Example of Answer
{ "CompanyGroup": "T1", // company group in which the reversal entry was inserted. "CT2_FILIAL": "D MG 01 ", // Branch in which the reversal entry was inserted. "CT2_DOC": "000001", // Generated reversal document number. "error": "" // Error will be returned blank if the reversal is successful. In case of error, the error description is returned. }
EndPoint: Path of the service REST Protheus + /api/ctb/accountingentry/delete Ex.: http://localhost:9090/api/ctb/accountingentry/delete
Body
Send it in Json format in accordance with the following model
Field | Description | Type | Required | Note |
CT2_DATA | Entry Date | Character | X | Date of entry to be deleted. Sent in ddmmaaaa character format. For example: 08/29/2022. |
CT2_LOTE | Batch Number | Character | X | Batch number of entry to be deleted. |
CT2_SBLOTE | Sub-batch Number | Character | X | Sub-batch number of entry to be deleted. |
CT2_DOC | Document Number | Character | X | Document number of entry to be deleted. |
Example of Sending
{ "CT2_DATA": "09/01/2023" , "CT2_LOTE": "000001", "CT2_SBLOTE": "001", "CT2_DOC" : "000005" }
Example of Answer
{ "CompanyGroup": "T1", // company group in which the entry was deleted. "CT2_FILIAL": "D MG 01 ", // Branch in which the entry was deleted. "CT2_DOC": "000005", // Deleted document number. "error": "" // Error will be returned blank if the deletion is successful. In case of error, the error description is returned. }