Skip to main content

BPMCore Accounts API

The Accounts API provides comprehensive management of journal entries and accounting transactions in the BankLingo platform. This API enables manual journal postings, retrieving accounting records, and reversing transactions.

Base Endpoint

All commands are executed through:

POST /api/core/cmd

Commands & Queries

1. Retrieve Journal Entries

Retrieves a paginated and filterable list of journal entries with detailed account information.

Command Name: RetrieveJournalEntriesQuery

Request Parameters

ParameterTypeRequiredDescription
currencyCodestringNoFilter by currency code (e.g., "NGN", "USD")
startDatedatetimeNoStart date for filtering (inclusive)
endDatedatetimeNoEnd date for filtering (inclusive)
searchTextstringNoSearch by GL Code or Transaction Reference
glCodestringNoFilter by specific General Ledger code
branchIdlongNoFilter by branch ID (omit for all branches)
pageNumberintegerNoPage number for pagination (default: 1)
pageSizeintegerNoNumber of items per page (default: 20)
isExportbooleanNoExport all results without pagination (default: false)

Request Example

{
"Cmd": "RetrieveJournalEntriesQuery",
"Data": {
"currencyCode": "NGN",
"startDate": "2024-01-01",
"endDate": "2024-12-31",
"searchText": "SAL",
"pageNumber": 1,
"pageSize": 50
}
}

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "Journal entries retrieved successfully.",
"Data": {
"items": [
{
"Id": 12345,
"GLCode": "1001",
"AccountName": "Cash at Bank",
"AccountTypeId": 1,
"AccountTypeDescription": "Asset",
"JournalEntryType": 1,
"JournalEntryTypeDescription": "Debit",
"DebitAmount": "50000.00",
"CreditAmount": "",
"CurrencyCode": "NGN",
"BranchName": "Head Office",
"TransactionReference": "SAL/2024/001",
"AccountDescription": "Salary Payment January 2024",
"BookingDate": "2024-01-15 10:30:00",
"JournalTransactionId": 789,
"TransactionEncodedKey": "8a8e8e8e8e8e8e8e",
"Notes": "Monthly salary disbursement"
}
],
"totalRows": 150,
"totalPages": 3,
"pageSize": 50,
"currentPage": 1
},
"HasNext": true,
"HasPrevious": false
}

Response Fields

FieldTypeDescription
IdlongUnique journal entry ID
GLCodestringGeneral ledger account code
AccountNamestringName of the GL account
AccountTypeIdintegerAccount type enum value (1=Asset, 2=Liability, 3=Equity, 4=Income, 5=Expense)
AccountTypeDescriptionstringHuman-readable account type
JournalEntryTypeintegerEntry type (1=Debit, 2=Credit)
JournalEntryTypeDescriptionstring"Debit" or "Credit"
DebitAmountstringFormatted debit amount (empty if credit)
CreditAmountstringFormatted credit amount (empty if debit)
CurrencyCodestringThree-letter currency code
BranchNamestringName of the branch
TransactionReferencestringUnique transaction reference
AccountDescriptionstringDescription/narration of the entry
BookingDatestringFormatted booking date
JournalTransactionIdlongParent transaction ID (groups related entries)
TransactionEncodedKeystringEncoded key for the entry
NotesstringAdditional notes

2. Retrieve Journal Transactions

Retrieves a list of journal transactions (grouped journal entries). Each transaction contains multiple debit and credit entries.

Command Name: RetrieveJournalTransactionsQuery

Request Parameters

ParameterTypeRequiredDescription
startDatedatetimeNoStart date for filtering
endDatedatetimeNoEnd date for filtering
searchTextstringNoSearch by transaction ID or username
pageNumberintegerNoPage number (default: 1)
pageSizeintegerNoItems per page (default: 20)
isExportbooleanNoExport all results (default: false)

Request Example

{
"Cmd": "RetrieveJournalTransactionsQuery",
"Data": {
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"searchText": "admin",
"pageNumber": 1,
"pageSize": 20
}
}

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "Journal transactions retrieved successfully.",
"Data": {
"items": [
{
"Id": 789,
"TransactionId": "JT/2024/000789",
"TransactionDate": "2024-01-15 10:30:00",
"BookingDate": "2024-01-15T10:30:00",
"TransactionType": 1,
"TransactionTypeDesc": "Manual Journal Entry",
"Amount": 50000.00,
"Entries": 4,
"UserName": "admin@banklingo.com",
"UserEncodedKey": "8a8e8e8e8e8e8e8e",
"IsManualPosting": true,
"IsReversed": false,
"IsAReversedTransaction": false,
"Remarks": "Monthly salary entries"
}
],
"totalRows": 25,
"totalPages": 2,
"pageSize": 20,
"currentPage": 1
},
"HasNext": true,
"HasPrevious": false
}

Response Fields

FieldTypeDescription
IdlongUnique transaction ID
TransactionIdstringHuman-readable transaction reference
TransactionDatestringFormatted transaction date
BookingDatedatetimeRaw booking date
TransactionTypeintegerTransaction type enum
TransactionTypeDescstringDescription of transaction type
AmountdecimalTotal debit amount
EntriesintegerNumber of journal entries in this transaction
UserNamestringUser who created the transaction
UserEncodedKeystringEncoded key of the user
IsManualPostingbooleanTrue if manually posted
IsReversedbooleanTrue if this transaction has been reversed
IsAReversedTransactionbooleanTrue if this is a reversal of another transaction
RemarksstringTransaction remarks

3. Retrieve Journal Transaction By ID

Retrieves a single journal transaction with all its entries and detailed account information.

Command Name: RetrieveJournalTransactionByIdQuery

Request Parameters

ParameterTypeRequiredDescription
journalTransactionIdlongYesUnique transaction ID

Request Example

{
"Cmd": "RetrieveJournalTransactionByIdQuery",
"Data": {
"journalTransactionId": 789
}
}

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "Journal transaction retrieved successfully.",
"Data": {
"Id": 789,
"TransactionId": "JT/2024/000789",
"TransactionDate": "2024-01-15 10:30:00",
"TransactionType": 1,
"TransactionTypeDesc": "Manual Journal Entry",
"UserName": "admin@banklingo.com",
"IsManualPosting": true,
"IsReversed": false,
"Remarks": "Monthly salary entries",
"Entries": [
{
"Id": 12345,
"GLCode": "1001",
"GLAccountId": 50,
"AccountDescription": "Cash at Bank",
"AccountTypeId": 1,
"AccountTypeDescription": "Asset",
"JournalEntryType": 1,
"JournalEntryTypeDescription": "Debit",
"Amount": 50000.00,
"DebitAmount": 50000.00,
"CreditAmount": 0,
"BookingDate": "2024-01-15 10:30:00",
"BookingDateRaw": "2024-01-15T10:30:00",
"CurrencyCode": "NGN",
"BranchId": 1,
"BranchName": "Head Office",
"TransactionReference": "SAL/2024/001",
"Notes": "Salary payment"
},
{
"Id": 12346,
"GLCode": "5001",
"GLAccountId": 120,
"AccountDescription": "Salary Expense",
"AccountTypeId": 5,
"AccountTypeDescription": "Expense",
"JournalEntryType": 2,
"JournalEntryTypeDescription": "Credit",
"Amount": 50000.00,
"DebitAmount": 0,
"CreditAmount": 50000.00,
"BookingDate": "2024-01-15 10:30:00",
"BookingDateRaw": "2024-01-15T10:30:00",
"CurrencyCode": "NGN",
"BranchId": 1,
"BranchName": "Head Office",
"TransactionReference": "SAL/2024/001",
"Notes": "Salary expense recognition"
}
],
"TotalDebits": 50000.00,
"TotalCredits": 50000.00,
"IsBalanced": true
}
}

4. 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

Request Parameters

ParameterTypeRequiredDescription
transactionReferencestringNoCustom reference (auto-generated if omitted)
entriesarrayYesArray of journal entry items (see below)
notesstringNoAdditional notes for the transaction
bookingDatedatetimeYesBooking date for the entries
currencyCodestringYesCurrency code (e.g., "NGN")

Entry Object Structure

ParameterTypeRequiredDescription
glAccountIdlongYesGeneral ledger account ID
amountdecimalYesAmount for this entry
journalEntryTypeintegerYes1 = Debit, 2 = Credit
branchIdlongNoBranch ID (defaults to user's branch)
referencestringNoEntry-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

  1. Balanced Entry: Total debits must equal total credits
  2. Valid GL Accounts: All glAccountId values must exist and be active
  3. Currency Consistency: All entries must use the same currency
  4. Authorization: User must have permission to post journal entries
  5. 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
}

5. Reverse Journal Transaction

Reverses an existing journal transaction by creating offsetting entries.

Command Name: ReverseJournalTransactionCommand

Request Parameters

ParameterTypeRequiredDescription
transactionIdlongYesID of the transaction to reverse
reasonstringNoReason for reversal
isBackDatedbooleanNoWhether to backdate the reversal
backDateValueDatedatetimeNoValue date for backdated reversal
isBookingDatebooleanNoUse specific booking date
bookingDatedatetimeNoCustom booking date

Request Example

{
"Cmd": "ReverseJournalTransactionCommand",
"Data": {
"transactionId": 789,
"reason": "Incorrect salary amount posted",
"isBackDated": false
}
}

Business Rules

  1. Reversal Validation: Cannot reverse an already-reversed transaction
  2. Permission Check: User must have reversal authorization
  3. Period Check: Reversal must be in an open accounting period
  4. Audit Trail: System tracks reversal reason and user
  5. Reference Linking: Reversal transaction is linked to original

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "Journal transaction reversed successfully.",
"Data": {
"ReversalTransactionId": "JT/2024/000791",
"ReversalJournalTransactionId": 791,
"OriginalTransactionId": "JT/2024/000789",
"ReversalDate": "2024-01-16T14:20:00",
"Reason": "Incorrect salary amount posted",
"EntriesReversed": 4
}
}

Error Responses

Already Reversed

{
"IsSuccessful": false,
"StatusCode": "03",
"Message": "Transaction JT/2024/000789 has already been reversed",
"Data": null
}

Transaction Not Found

{
"IsSuccessful": false,
"StatusCode": "02",
"Message": "Journal transaction with ID 999 not found",
"Data": null
}

Common Use Cases

Example 1: Manual Expense Accrual

Post month-end accruals for expenses not yet invoiced:

{
"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"
}
]
}
}

Example 2: Error Correction

Query and reverse an incorrectly posted entry:

// Step 1: Find the transaction
{
"Cmd": "RetrieveJournalEntriesQuery",
"Data": {
"searchText": "SAL/2024/001",
"pageSize": 10
}
}

// Step 2: Reverse it
{
"Cmd": "ReverseJournalTransactionCommand",
"Data": {
"transactionId": 789,
"reason": "Wrong GL account used - should be 5002 not 5001"
}
}

// Step 3: Post correct entry
{
"Cmd": "PostJournalEntryCommand",
"Data": {
// ... correct entry details
}
}

Example 3: Monthly Reporting

Retrieve all journal entries for month-end reporting:

{
"Cmd": "RetrieveJournalEntriesQuery",
"Data": {
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"isExport": true,
"currencyCode": "NGN"
}
}

Integration Notes

Journal Entry Types

ValueDescriptionNormal Balance
1DebitAsset, Expense accounts increase
2CreditLiability, Equity, Income accounts increase

Account Types

IDTypeExamples
1AssetCash, Receivables, Fixed Assets
2LiabilityPayables, Loans, Accruals
3EquityCapital, Retained Earnings
4IncomeInterest Income, Fees
5ExpenseSalaries, Rent, Utilities

Transaction Types

IDDescriptionUsage
1Manual Journal EntryUser-posted adjustments
2Automated EntrySystem-generated postings
3ReversalReversal of previous entry

Best Practices

  1. Always Balance Entries: Ensure debits = credits before posting
  2. Use Meaningful References: Include dates, departments, or invoice numbers
  3. Add Detailed Notes: Explain the business reason for manual entries
  4. Review Before Posting: Double-check GL codes and amounts
  5. Document Reversals: Always provide clear reversal reasons
  6. Use Filters Wisely: Narrow date ranges and use specific GL codes for faster queries
  7. Export for Audit: Use isExport: true for comprehensive audit trails

Related APIs:


Documentation Author: Owa Oluwasegun Tunbosun, Senior Platform Engineer