AccountingEntry
BETA
Note:
There exists a highly simplified method for adding accounting entries, createSimplifiedAccountingEntry, which handles the majority of use cases for adding such entries.
It is recommended to explore the capabilities of createSimplifiedAccountingEntry before attempting to add entries with createAccountingEntry.
The utilization of createAccountingEntry for adding entries may be unnecessary given the effectiveness of the simplified method.
Operation | Type | Object | Dto |
---|---|---|---|
Mutation | createAccountingEntry |
AccountingEntryCreateGLDtoInput |
|
Mutation | deleteAccountingEntry |
AccountingEntryDeleteGLDtoInput |
|
Query | accountingEntryById |
AccountingEntryGLDto |
|
Query | accountingEntries |
AccountingEntryGLDto |
Description
Accounting entries management
Given the model of the accounting entries and the mandatory object types in the context of purchase or sale journal entries, we absolutely recommend that you start with an example from the postman collection and adapt it rather than starting from scratch.
To see examples of mutations that include the adding of accounting entries :
download the Postman collection: Quick start / 5. Test your first query in Postman
Would you like to see an example of how to add an entry?
This example concerns a sales invoice, to transform it into a purchase invoice, just :
- replace origin CUSTOMER by SUPPLIER
- replace registerType ISSUED by RECEIVED
- Assign a third party Supplier instead of a Customer
{
"values":{
"description": "Facture FA0022",
"date": "2023-03-01",
"entryType": "GENERAL",
"journalTypeId": "{journalId}",
"accountingEntryLines": [
{
"description": "Facture FA0022",
"creditAmount": 0,
"debitAmount": 1824.67,
"subAccountId": "{customerAccountId}",
"accountingEntryThirdParty": {
"socialName":"{customerSocialName}",
"origin":"CUSTOMER",
"thirdPartyId":"{customerId}",
"identificationTypeId":"{documentTypeId}",
"documentId":"{customerDocumentId}"
},
"registerType":"ISSUED",
"accountingEntryInvoice":{
"amount":1824.67,
"documentDate":"2023-03-01",
"expeditionDate":"2023-03-01",
"operationDate":"2023-03-01",
"settlementDate":"2023-03-01",
"externalInvoiceNumber":"FA0022",
"registerType":"ISSUED"
}
},
{
"description": "Facture FA0022",
"creditAmount": 1520.56,
"debitAmount": 0,
"subAccountId": "{AccountId}",
"registerType":"UNDEFINED"
},
{
"description": "Facture FA0022",
"creditAmount": 304.11,
"debitAmount": 0,
"subAccountId": "{taxAccountId}",
"registerType":"UNDEFINED"
}
]
}
}
Header
Key | Value |
---|---|
Authorization |
Bearer Current access Token |
X-TenantId |
Current tenant id obtained from userProfile |
X-OrganizationId |
Current organization Id |
x-api-key |
Primary or secondary subscription key of your app |
accountingEntries
Fields | Type | Description | Length | |
---|---|---|---|---|
id | UUID | Id | ||
date |
datetime | Date | ||
journalTypeId |
UUID | Journal Id | ||
number |
decimal | Number |
||
entryType |
|
Always fill in GENERAL | ||
description | string | Description |
200 | |
closeDate |
datetime | closing date of entry | ||
isClosed |
boolean | True if closed | ||
accountingEntryLines[] | Array | List of all lines of entry |
Info
- number : operational Number Counter Id
- description : optional value, used as template for lines from the interface to assign default value to lines.
- accountingEntryLines : List of lines in the accounting entry, the accounting entry must be balanced, the total of the lines with a debit must be equal to the total of the lines with a credit. Adding an unbalanced entry will return an error.
accountingEntries/accountingEntryLines
Fields | Type | Description | Length |
---|---|---|---|
id |
UUID | Id | |
subAccountId |
UUID | Id of accountingAccount | |
description | string | Description | 200 |
debitAmount |
decimal | Amount debit |
|
creditAmount |
decimal | Amount credit |
|
registerType |
|
Type of tax register |
6 |
accountingEntryThirdParty | ObjectType | ThirdParty |
|
accountingEntryPayment | ObjectType | Matching | |
accountingEntryInvoice | ObjectType | Invoice |
Info
- creditAmount, debitAmount : The accounting entry must be balanced, the total of the lines with a debit must be equal to the total of the lines with a credit. Adding an unbalanced entry will return an error.
- registerType : used for tax registers, mandatory value.
- For journal types equal to
GENERAL
orFINANCIAL
orCARRY_FORWARD
, always assignUNDEFINED
for each line. - For journals types equal to
PURCHASE_INVOICE
orSALES_INVOICE
:- For lines without a third party
CUSTOMER
orSUPPLIER
, always assignUNDEFINED
- For lines with a third party
CUSTOMER
, assignISSUED
- For lines with a third party
SUPPLIER
, assignRECEIVED
- For lines without a third party
- For journal types equal to
- accountingEntryThirdParty : mandatory for lines with a third party
CUSTOMER
,SUPPLIER
,EMPLOYEE
. - accountingEntryInvoice : mandatory for lines with a third party
CUSTOMER
,SUPPLIER
for journal typesPURCHASE_INVOICE
orSALES_INVOICE
. Must not be defined for other journals.
It is not possible to group several invoices in one accounting entry for the journals PURCHASE_INVOICE
or SALES_INVOICE
.
So only one accountingEntryThirdParty and one accountingEntryInvoice per accountingEntry for these journals.
accountingEntries/accountingEntryLines/accountingEntryThirdParty
Fields | Type | Description | Length |
---|---|---|---|
id |
UUID | Id | |
thirdPartyId |
UUID | Third Id |
|
socialName |
string | Third Name |
70 |
code |
string | Code |
17 |
origin |
|
Type of third | |
identificationTypeId |
UUID | DocumentType Id |
|
documentId |
string | Document Id |
25 |
Info
- thirdPartyId : Third party id :
- socialName : Found in the third party as
socialName
for customer & supplier andname
for employee, must be filled in. - code : Found in the third party as
code
, must be filled in. - identificationTypeId : Found in the third party as
documentTypeId
, must be filled in. - documentId : Found in the third party as
documentId
, must be filled in.
accountingEntries/accountingEntryLines/accountingEntryPayment
Fields | Type | Description | Length |
---|---|---|---|
id |
UUID | Id | |
matching |
|
Status matching |
|
matchingLetter |
string | Letter matching |
5 |
Info
Information available only in reading mode concerning the lettering of the line.
- matching : Indicates whether the line is lettered
- matchingLetter : letter A,B,C … for a complete lettering, letter a,b,c … for a partial lettering.
accountingEntries/accountingEntryLines/accountingEntryInvoice
Fields | Type | Description | Length |
---|---|---|---|
id |
UUID | Id | |
documentDate |
datetime | Document date | |
expeditionDate |
datetime | Expedition date |
|
operationDate |
datetime | Operation date |
|
settlementDate |
datetime | Settlement date |
|
externalInvoiceNumber |
string | Invoice number | 50 |
amount |
decimal | Amount | |
registerType |
|
Type of tax register |
6 |
accountingEntryTaxes[] | Array | Tax registers |
Info
- expeditionDate : mandatory, assign it by default with
documentDate
. - operationDate : mandatory, assign it by default with
documentDate
. - settlementDate : mandatory, assign it by default with
documentDate
. - amount : Amount of the invoice, must be equal to the amount of the entry line where the third party is present (accountingEntryThirdParty)
- registerType : used for tax registers, mandatory value.
- For customer invoice, assign
ISSUED
- For supplier invoice, assign
RECEIVED
- For customer invoice, assign
accountingEntries/accountingEntryLines/accountingEntryInvoice/accountingEntryTaxes
Fields | Type | Description |
---|---|---|
id |
UUID | Id |
taxTreatmentId | UUID | Id of the tax Treatment |
taxGroupId | UUID | Id of the Taxe Group of tax treatment |
taxType |
|
Tax Type of the tax treatment |
taxId | UUID | Id Tax found by groupId=taxGroupId |
taxPercentage | decimal | Percentage of the tax found by groupId=taxGroupId |
taxBase | decimal | Base of tax calculation |
taxAmount | decimal | Tax amount |
deductible | boolean | true for a deductible tax, false for a collected tax |
regimeType |
|
Always fill in GENERAL |
Info
- taxTreatmentId : A tax Treatment must be associated to each line of acounting Entry taxes. see Taxes Treatments
- taxGroupId : found in Taxes Treatments
- taxType : found in Taxes Treatments
- taxId : Id of the taxe found by
groupId
of tax =taxGroupId
of Tax Treatment - taxPourcentage : Pourcentage of the taxe found in tax