Accounting Entry Generation API Documentation
Accounting Entry Generation Overview
The Accounting Entry Generation module takes a JSON-structured input containing key information extracted from a financial document—such as invoices or receipts—and automatically produces accounting entries following the French PCG (Plan Comptable Général).
Key Points
-
Structured Input
Accepts a JSON object with essential financial details (e.g., invoice ID, total amount, VAT rate). -
PCG Compliance
Maps the provided data to relevant PCG accounts, ensuring correct debit/credit line items. -
Automated Output
Generates a comprehensive list of journal entries, ready for integration into accounting software. -
Agent Reasoning
Optionally, the module can provide an AI-generated “chain of thought” or reasoning steps that explain how the accounting entries were determined based on the provided financial data and PCG rules.
Example
Suppose your JSON input includes an invoice total, VAT rate, and payment details. The module automatically:
- Identifies the appropriate PCG accounts (e.g., “411 - Clients”, “44571 - TVA Collectée”).
- Creates line items (debits/credits) reflecting the transaction’s financial flow.
- Returns a JSON array of accounting entries conforming to French standards.
- (Optional) Provides an AI-driven explanation of why each line item was assigned to specific PCG accounts.
This makes it effortless to convert raw financial data into PCG-compliant journal entries—with or without an explanatory reasoning trace—saving significant manual effort in both accounting and auditing processes.
EXAMPLE OUTPUT
{
"reasoning": <Reasoning that led to the accounting entries>,
"response": {
'accounting_entries': [
{
"description": "Achat d'un iPhone 16 Pro Black 1TB-ZDD",
"account": 605,
"amount": 1549.17,
"direction": "debit"
},
{
"description": "TVA sur achat d'un iPhone 16 Pro Black 1TB-ZDD",
"account": 44566,
"amount": 309.83,
"direction": "debit"
},
{
"description": "Paiement pour l'achat d'un iPhone 16 Pro Black 1TB
"account": 401,
"amount": 1859,
"direction": "credit"
}
]
}