This method can become intricate due to the rules that must be adhered to.
Thus, as createAccountingEntry is now
There are two highly simplified methods for adding accounting entries, createAccountingEntryUsingCodes and createAccountingEntryUsingIds, which handle all use cases for adding such entries.
These two methods now fully cover the functionality of the old method, so it is strongly recommended to stop using this old method and replace it with one of the two new methods.
HTTP | Operation | Type | Object | DTO Why-DTOs? |
---|---|---|---|---|
Mutation | createAccountingEntry |
AccountingEntryCreateGLDtoInput |
Thus, as createAccountingEntry is now
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
This example concerns a sales invoice, to transform it into a purchase invoice, just :
{
"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}",
"vatNumber": "{vatNumber}"
},
"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"
}
]
}
}
Key | Value |
---|---|
Authorization |
Bearer Current access Token How to find? |
X-TenantId |
Current tenant id How to find? |
X-OrganizationId |
Current organization Id How to find? |
x-api-key |
Primary or secondary subscription key of your app How to find? |
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 |
This value is optional
This value is optional
This value is mandatory.
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 |
|
accountingEntryInvoice | ObjectType | Invoice |
GENERAL
or FINANCIAL
or CARRY_FORWARD
, always assign UNDEFINED
for each line.PURCHASE_INVOICE
or SALES_INVOICE
:
CUSTOMER
or SUPPLIER
, always assign UNDEFINED
CUSTOMER
, assign ISSUED
SUPPLIER
, assign RECEIVED
CUSTOMER
, SUPPLIER
, EMPLOYEE
.CUSTOMER
, SUPPLIER
for journal types PURCHASE_INVOICE
or SALES_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.
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 |
vatNumber | String | vat Number |
25 |
socialName
for customer & supplier and name
for employee, must be filled in.code
, must be filled in.documentTypeId
, must be filled in.documentId
, must be filled in.A value is not mandatory in the context of FR
legislation.
A value is mandatory in the context of ES
legislation if the third party is part of the VIES system and is not an ES
third party.
A value is mandatory in the context of DE
legislation if the third party is part of the VIES system and is not an DE
third party.
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 |
documentDate
.documentDate
.documentDate
.ISSUED
RECEIVED
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 |
groupId
of tax = taxGroupId
of Tax Treatment