API Search endpoints…⌘K Get API credentialsGet access

Set up your ledger and post a journal entry

Loans post to a ledger. Before they do, the ledger needs accounts, and the organisation-level financial activities need to know which account they post to. You create the accounts, map the activities, then post a manual journal entry.

Before you start

Set your environment

Every request authenticates with HTTP Basic and names its tenant in a header. Set these once and the commands below work as written.

export LOKTA_API="https://default.lokta.tech"
export LOKTA_USER="your-username"
export LOKTA_PASS="your-password"

1. Read the account template

The template returns the allowed values for the fields a ledger account needs. The type and usage of an account are integer codes, and this is where you find which code means what on your tenant.

curl -X GET "$LOKTA_API/lokta-lms/api/v1/glaccounts/template" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default"

2. Create a ledger account

These fields are mandatory. To build a hierarchical chart of accounts, send a parentId that points at another account.

name

The account name.

glCode

The account code, as a string.

type

The account type, as the integer code from the template.

usage

How the account is used, as the integer code from the template.

manualEntriesAllowed

True if people may post to the account by hand.

parentId

Optional. The account this one sits under.

The type and usage codes above are examples. Use the codes the template returns.

curl -X POST "$LOKTA_API/lokta-lms/api/v1/glaccounts" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Loan portfolio",
    "glCode": "10100",
    "type": 1,
    "usage": 1,
    "manualEntriesAllowed": true
  }'

Repeat for each account you need, and keep the ids. The mapping and the journal entry below take them as `glAccountId`.

3. Map financial activities to accounts

Organisation-level financial activities, such as an asset or liability transfer, post to the account you map them to. Read the template for the activity ids and the accounts on offer.

curl -X GET "$LOKTA_API/lokta-lms/api/v1/financialactivityaccounts/template" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default"

4. Create the mapping

Send the financial activity and the ledger account it should post to.

curl -X POST "$LOKTA_API/lokta-lms/api/v1/financialactivityaccounts" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default" \
  -H "Content-Type: application/json" \
  -d '{
    "financialActivityId": 100,
    "glAccountId": 1
  }'

The ids above are examples. Use the ones from the template and from your own accounts.

5. Post a journal entry

A simple entry has at least one debit and one credit, and the two sides must add up to the same amount. A compound entry can have several of each.

The office and the transaction date are mandatory. Each debit and credit line carries a glAccountId, an amount and a comment.

curl -X POST "$LOKTA_API/lokta-lms/api/v1/journalentries" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default" \
  -H "Content-Type: application/json" \
  -d '{
    "officeId": 1,
    "transactionDate": "01 September 2026",
    "comments": "Opening funding",
    "debits": [
      {
        "glAccountId": 1,
        "amount": 100000,
        "comments": "Funds in"
      }
    ],
    "credits": [
      {
        "glAccountId": 2,
        "amount": 100000,
        "comments": "Funds source"
      }
    ],
    "dateFormat": "dd MMMM yyyy",
    "locale": "en"
  }'

6. Read the entries back

List entries for an office or an account, narrowed by date, then open one to see its lines.

curl -X GET "$LOKTA_API/lokta-lms/api/v1/journalentries" \
  -u "$LOKTA_USER:$LOKTA_PASS" \
  -H "Tenant-Identifier: default"

Where to go next

Every request authenticates with HTTP Basic and carries a Tenant-Identifier header. See the conventions. Read this guide as Markdown.

This is the API reference for Lokta, the agentic loan servicing platform. Go to lokta.ai