Post Journal Entry
Posts a manual journal entry with multiple debit and credit entries. The system validates that debits equal credits before posting.
Command Name
PostJournalEntryCommand
Endpoint
POST /api/core/cmd
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transactionReference | string | No | Custom reference (auto-generated if omitted) |
entries | array | Yes | Array of journal entry items (see below) |
notes | string | No | Additional notes for the transaction |
bookingDate | datetime | Yes | Booking date for the entries |
currencyCode | string | Yes | Currency code (e.g., "NGN") |
Entry Object Structure
| Parameter | Type | Required | Description |
|---|---|---|---|
glAccountId | long | Yes | General ledger account ID |
amount | decimal | Yes | Amount for this entry |
journalEntryType | integer | Yes | 1 = Debit, 2 = Credit |
branchId | long | No | Branch ID (defaults to user's branch) |
reference | string | No | Entry-specific reference |
Request Example
{
"Cmd": "PostJournalEntryCommand",
"Data": {
"transactionReference": "ACCRUAL/2024/001",
"bookingDate": "2024-01-31",
"currencyCode": "NGN",
"notes": "Month-end interest accrual",
"entries": [
{
"glAccountId": 150,
"amount": 25000.00,
"journalEntryType": 1,
"branchId": 1,
"reference": "Interest receivable"
},
{
"glAccountId": 420,
"amount": 25000.00,
"journalEntryType": 2,
"reference": "Interest income"
}
]
}
}
Validation Rules
- Balanced Entry: Total debits must equal total credits
- Valid GL Accounts: All
glAccountIdvalues must exist and be active - Currency Consistency: All entries must use the same currency
- Authorization: User must have permission to post journal entries
- Date Validation: Booking date cannot be in a closed accounting period
Response Structure
{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "Journal entry posted successfully.",
"Data": {
"TransactionId": "JT/2024/000790",
"JournalTransactionId": 790,
"BookingDate": "2024-01-31T00:00:00",
"TotalDebits": 25000.00,
"TotalCredits": 25000.00,
"EntriesPosted": 2
}
}
Error Responses
Unbalanced Entry
{
"IsSuccessful": false,
"StatusCode": "01",
"Message": "Total debits (30000.00) must equal total credits (25000.00)",
"Data": null
}
Invalid GL Account
{
"IsSuccessful": false,
"StatusCode": "02",
"Message": "GL Account with ID 999 not found or inactive",
"Data": null
}
Use Case Example
Manual expense accrual:
{
"Cmd": "PostJournalEntryCommand",
"Data": {
"transactionReference": "ACCR-UTIL-202401",
"bookingDate": "2024-01-31",
"currencyCode": "NGN",
"notes": "Utilities expense accrual for January",
"entries": [
{
"glAccountId": 510,
"amount": 150000.00,
"journalEntryType": 1,
"reference": "Utilities expense"
},
{
"glAccountId": 220,
"amount": 150000.00,
"journalEntryType": 2,
"reference": "Accrued liabilities"
}
]
}
}