LendEasy/Docs
Get API keys
GuidesLoansAccounting

Accounting

Trace every financial state change to balanced, value-dated journal entries; reproduce Harbor's first payment; and reconcile immutable ledger detail to external books.

Loan balances are projections over posted transactions and balanced journal entries. They do not change because a provider accepted a request, an operator wrote a note, or a workflow reached approval.

Posting invariant

For every posted transaction, in one currency:

sum(debit lines) = sum(credit lines)

Journal entries are read entry-per-line: each row is a single DEBIT or CREDIT line against one ledger account, and the lines of a balanced transaction share a transactionId. Every line carries an effective transaction date, a submission date, the source entity type and id, and its currency, so the accounting is explainable from a payment, funding, charge, accrual, refund, or servicing command.

Harbor’s disbursement

Harbor has $8,400.00 principal and a $252.00 prepaid finance charge withheld from proceeds. Maya receives $8,148.00.

Account role Debit Credit Explanation
Loan principal receivable $8,400.00 Amount contractually advanced.
Funding clearing / cash $8,148.00 Net funds released to Maya.
Origination-fee clearing/income $252.00 Product-configured treatment of withheld charge.
Total $8,400.00 $8,400.00 Balanced.

The exact account codes depend on the configured chart of accounts; the economic invariant does not.

Harbor’s first payment

The $517.14 payment allocates $92.75 to interest and $424.39 to principal.

Account role Debit Credit
Cash / payment clearing $517.14
Loan principal receivable $424.39
Interest receivable or income, per accrual policy $92.75
Total $517.14 $517.14

Query the entries by their source transaction—the postedTransactionRef from the payment read, prefixed as a loan transaction:

curl "$BASE/v1/journalentries?transactionId=L30411&loanId=7204" \
  -H "Authorization: Bearer $TOKEN" \
  -H "LendEasy-Tenant: demo-lender"
{
  "totalFilteredRecords": 3,
  "pageItems": [
    {
      "id": 90211,
      "officeId": 1,
      "glAccountId": 14,
      "glAccountName": "Interest income",
      "glAccountCode": "4100",
      "glAccountType": { "id": 4, "value": "INCOME" },
      "transactionDate": [2026, 9, 12],
      "entryType": { "id": 2, "value": "CREDIT" },
      "amount": 92.75,
      "transactionId": "L30411",
      "entityType": { "id": 1, "value": "LOAN" },
      "entityId": 7204,
      "currency": { "code": "USD" },
      "submittedOnDate": [2026, 9, 15]
    }
  ]
}

The list uses the native envelope—totalFilteredRecords plus pageItems—with glAccountId, loanId, transactionId, entityType, manualEntriesOnly, and fromDate/toDate filters, and response dates serialize as [year, month, day] arrays.

Effective date versus posting time

transactionDate answers when the financial event belongs in loan calculations. submittedOnDate answers when it was recorded. Harbor’s ACH payment settles and posts on September 15 but is effective September 12, so allocation and delinquency are recomputed from September 12.

Backdating is controlled, not arbitrary:

  1. validate the business date and open accounting period;
  2. prevent conflict with completed statements or terminal states unless correction policy allows it;
  3. reprocess dependent allocation and accrual deterministically;
  4. create explicit adjustment or reversal entries—never edit posted lines;
  5. regenerate affected read models and reconciliation state.

Common event families

Event Accounting behavior
Funding posted Establishes receivable and cash/clearing movement.
Interest accrual Recognizes receivable and income under product policy.
Payment posted Clears cash and reduces components in allocation order.
Payment returned Reverses the original economic effect with explicit linkage.
Charge assessed Establishes charge receivable and configured income/liability.
Charge waived Reduces eligible receivable and income/contra account.
Refund posted Creates outbound money movement and one linked balance effect.
Charge-off Reclassifies or recognizes loss under configured accounting policy.
Recovery payment Records post-charge-off recovery without pretending it is a normal installment.

Chart of accounts

GET /v1/glaccounts returns the chart of accounts—each account’s glCode, type (ASSET, LIABILITY, EQUITY, INCOME, EXPENSE), usage, whether manual entries are allowed, and activation. GET /v1/glaccounts/{id} returns one account. Product accounting rules map loan events onto these accounts, which is why the tables above speak in account roles rather than fixed codes.

Manual journal entries

POST /v1/journalentries posts a balanced manual entry—matching debits and credits arrays, an office, a transaction date with dateFormat and locale, and a comment. The route is restricted to accounting administrators: loan-servicing money movement never posts manual entries, so a manual entry can always be read as a deliberate accounting adjustment rather than a side effect of servicing.

External books

There is no trial-balance resource. A point-in-time trial balance is derived operator-side from the immutable journal detail: export entries by transaction-date range, aggregate by account, and reconcile totals and source counts to your ERP. Do not write SQL against production or calculate a second “finance balance” from API snapshots—the journal-entry list with its date and account filters is the authoritative export surface.

Repair model

If a provider settlement has no ledger entry, reconciliation opens a typed exception. Repair posts the missing authorized entry or records why the external state is wrong; it never edits journal lines or resubmits money blindly. See Reconciliation & drift.

Representative entries illustrate the economics, not a mandated chart of accounts or accounting conclusion. Configure account mappings, recognition timing, and legal-entity policy with your accounting advisors.
Unified search across guides, recipes & the API referenceEsc