journal, the integration must record the expense as journal entries in the Accounting System.
This page defines how journal entries must be constructed during export processing, including how debit and credit lines are derived from the Export Item payload.
Journal entry creation operates after bookkeeping method resolution (see Determine Bookkeeping Method) and applies Accounts Mapping, Data Mapping, and Posting Behaviour rules described elsewhere in this documentation set.
Implementation
See the corresponding how-to article for API usage and step-by-step instructions:Journal Entry Construction Modes
An integration may need to construct journal entries in one of three modes depending on configuration and accounting system constraints:- Single journal entry per Export Item (default)
- Split line journal entry
- Single journal entry per Export Job (optional aggregation)
Example Export Item Payload (Journal Entry)
Example Export Item Payload (Journal Entry)
1. Single Journal Entry per Export Item (Default)
Detection
IfaccountingEntryLines contains a single entry, the Export Item must be recorded as a single journal entry.
Rule
The integration must create one journal entry representing the full expense. For each journal entry:- The full expense amount must be represented
- Debit, credit, and tax data must be recorded according to the Accounting System’s structure
- Attachments (e.g., receipts) should be linked if supported
2. Split Line Handling
Detection
IfaccountingEntryLines contains more than one entry, the Export Item must be treated as a split line entry.
Rule
Each entry inaccountingEntryLines represents a debit posting.
The API provides individual split amounts, each with its own account and tax code.
The integration is responsible for:
- Creating one debit posting per
accountingEntryLinesentry - Calculating the credit total as the sum of all
lineAmount.inWalletCurrency.valuevalues across the lines
amount.inWalletCurrency.value
Example
Create the following in the Accounting System if two split lines exist:- Line 1 (API): £120 → create 1 debit line
- Line 2 (API): £80 → create 1 debit line
- Line 3 (integration calculated or top-level amount): £200 → create 1 credit line
3. One Journal Entry per Export Job (Optional)
An integration may optionally support aggregating multiple Export Items into a single journal entry per Export Job. Aggregation changes when journal entries are created, not how debit and credit lines are constructed.Detection
This behaviour is decided entirely by the integration implementation (your code) and is not a configuration setting in Pleo or dynamically signalled by the Export Job payload.Rule
When aggregation is enabled, the integration:- Fetches all Export Items for the job
- Identifies items where
bookkeeping.methodisjournal(ornone) - Creates a single journal entry instead of one per Export Item
- Sets the journal entry date to the Export Job date (
createdAton the Export Job)
- Each item’s debit lines are represented individually
- A single credit line represents the total amount across all aggregated items
Example
Create the following in the Accounting System if three Export Items exist:- Line 1: £100 (no splits) → 1 debit line
- Lines 2 & 3: £200 (2 splits) → 2 debit lines (£120 and £80)
- Line 4: £50 (no splits) → 1 debit line
- Line 5: £350 → 1 credit line
Upstream Dependencies
- Export Job has been claimed (status = in_progress)
- Fetch Export Item Data (data layer)
- Bookkeeping method resolved
Downstream Dependencies
Journal entries rely on several platform concepts to be complete and reconcilable:- Accounts Mapping – determines which GL accounts are debited and credited
- Data Mapping – ensures amounts, dates, dimensions, identifiers, and VAT/tax information are recorded correctly
- Attachment Handling – links receipts and supporting documentation
- Accounting Periods – assigns entries to the correct accounting period
- Posting Behaviour – determines whether entries are created as drafts or finalised
- Export Item status update – updates outcome of Export Item (
successfulorfailed) - Export Job status update – updates outcome of Export Job (
completed,completed_with_errorsorfailed)
What Comes Next?
Related Reading
- How to Determine the Bookkeeping Method
- Accounts Payable Handling
- Export Integration Workflow Guide
- AS/ERP Processing Workflow Guide