Note

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

Description

Old and deprecated approach to creating an accounting entry.
This method can become intricate due to the rules that must be adhered to.

Thus, as createAccountingEntry is now , it is recommended to explore the capabilities of createAccountingEntryUsingCodes or createAccountingEntryUsingIds, depending on your preference.

img

Caution

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}",
          "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?

accountingEntries

Fields Type Description Length  
id UUID Id    
         
date Datetime Date    
journalTypeId UUID Journal Id    
number Decimal Number    
entryType
  • GENERAL
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: A value used as a template for lines from the interface.

    This value is optional

    This value is optional

    This value is mandatory.

  • 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
  • UNDEFINED
  • ISSUED
  • RECEIVED
  • BOTH
Type of tax register 6
accountingEntryThirdParty ObjectType ThirdParty  
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 or FINANCIAL or CARRY_FORWARD, always assign UNDEFINED for each line.
    • For journals types equal to PURCHASE_INVOICE or SALES_INVOICE :
      • For lines without a third party CUSTOMER or SUPPLIER, always assign UNDEFINED
      • For lines with a third party CUSTOMER, assign ISSUED
      • For lines with a third party SUPPLIER, assign RECEIVED
  • accountingEntryThirdParty : mandatory for lines with a third party CUSTOMER, SUPPLIER, EMPLOYEE.
  • accountingEntryInvoice : mandatory for lines with a third party 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.


accountingEntries/accountingEntryLines/accountingEntryThirdParty
Fields Type Description Length
id UUID Id  
       
thirdPartyId UUID Third Id  
socialName String Third Name 70
code String Code 17
origin
  • CUSTOMER
  • SUPPLIER
  • EMPLOYEE
Type of third  
identificationTypeId UUID DocumentType Id  
documentId String Document Id 25
vatNumber String vat Number 25
Info
  • thirdPartyId : Third party id :
    • If journal type equal to PURCHASE_INVOICE the third party is a Supplier.
    • If journal type equal to SALES_INVOICE the third party is a Customer.
    • In the other cases, the third party can be a Supplier, Customer or Employee.
  • socialName : Found in the third party as socialName for customer & supplier and name 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.
  • vatNumber : VAT Number of the third party.

    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.


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
  • UNDEFINED
  • ISSUED
  • RECEIVED
  • BOTH
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


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
  • GENERAL
Always fill in GENERAL
Info