SimplifiedAccountingEntry
BETA
Note:
While the highly simplified createSimplifiedAccountingEntry method handles the majority of use cases for adding accounting entries, simplifying data definition, there might be rare instances where it cannot manage a particular case.
In such situations, it remains possible to use createAccountingEntry.
Thus, before attempting to add entries with createAccountingEntry, it is recommended to explore the capabilities of createSimplifiedAccountingEntry.
Operation | Type | Object | Dto |
---|---|---|---|
Mutation | createSimplifiedAccountingEntry |
SimplifiedAccountingEntryCreateGLDtoInput |
Description
Simplified creation of Accounting Entries
Advantages:
- Direct use of journal codes, third-party codes, and account codes, eliminating the need for Sage Active IDs.
- Automatic validation of the existence of journal codes, third-party codes, and account codes.
- Automatic detection of the third-party type (Client, Supplier, Employee) based on the sub-account class.
- Optimized performance through the utilization of an internal cache for fetching journal, third-party, and account IDs, thereby reducing the number of queries required.
- Simplified model definition with streamlined lines that eliminate the need to manage accountingEntryThirdParty and accountingEntryInvoice sub-resources.
- Automatic assignment of the description and document number from the header to the lines if not defined in the line.
- No requirement for managing tax registers.
- Automatic summation of debit or credit from multiple lines of the same third party in the entry, merging them into a single entry line.
- Preservation of all business controls managed by Sage Active to ensure the integrity of the added entries.
To see examples of mutations that include the adding of simplified 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 pertains to a sales invoice.
To convert it into a purchase invoice, simply use a purchase journal and a supplier code.
{
"values": {
"description": "Facture FA0022",
"date": "2023-01-01",
"documentDate": "2022-12-16",
"documentNumber": "FA0022",
"journalTypeCode": "VTE",
"accountingEntryLines": [
{
"thirdCode": "BAGUES",
"description": "Facture FA0022 régularisation",
"creditAmount": 0,
"debitAmount": 158.25
"subAccountCode": "411000000"
},
{
"creditAmount": 150,
"debitAmount": 0,
"subAccountCode": "701005000"
},
{
"creditAmount": 8.25,
"debitAmount": 0,
"subAccountCode": "445710500"
}
]
}
}
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 |
createSimplifiedAccountingEntry
Fields | Type | Description |
---|---|---|
date | datetime | Date of the accounting entry |
journalTypeCode |
string | An existing journal code |
documentDate | datetime | Date of the accounting document |
documentNumber | string | Document number or reference of the entry |
description | string | Description |
accountingEntryLines[] |
Array | List of all entry lines |
Info
- documentDate: An optional date field indicating the date of the document associated with the accounting entry.
If not provided, the document date will be automatically set to match the accounting entry date. - documentNumber: The reference number of the document.
For purchases or sales, it can be filled with the invoice number. - description: An optional value used as a template for lines from the interface, which assigns a default value to the lines.
- accountingEntryLines: A list of lines in the accounting entry.
The accounting entry must be balanced, meaning the total of the lines with a debit must be equal to the total of the lines with a credit.
Attempting to add an unbalanced entry will result in an error.
createSimplifiedAccountingEntry/accountingEntryLines
Fields | Type | Description |
---|---|---|
subAccountCode |
string | code of a general account |
thirdCode | string | code of a third |
description | string | Description |
debitAmount |
decimal | Amount debit |
creditAmount |
decimal | Amount credit |
Info
- subAccountCode: An existing general account, which is required on each of the entry lines.
- thirdCode: An existing third-party code, which is necessary on one of the lines if the entry pertains to a third party, such as a purchase invoice, sales invoice, or any other accounting entry that involves a third party.
Based on the class of the subAccountCode, the type of third party (Customer, Supplier, Employee) will be automatically detected. -
description: The description of the line. If not specified, it will be assigned the value from the description field of the entry header.
- creditAmount, debitAmount: The accounting entry must be balanced, meaning the total of the lines with a debit must equal the total of the lines with a credit.
Attempting to add an unbalanced entry will result in an error.
For the PURCHASE_INVOICE
or SALES_INVOICE
journals, if several lines contain the same third party, these lines are merged into one, with the sum of the debit or credit of the lines.
This allows compliance with Sage Active while, for instance, permitting the addition of entries from an import file containing invoices where the due dates are split over several lines.