# Create "Balanced" Journal Entries

`POST /lokta-lms/api/v1/journalentries`

Note: A Balanced (simple) Journal entry would have atleast one "Debit" and one "Credit" entry whose amounts are equal 
Compound Journal entries may have "n" debits and "m" credits where both "m" and "n" are greater than 0 and the net sum or all debits and credits are equal 


Mandatory Fields
officeId, transactionDate


credits- glAccountId, amount, comments

 
debits-  glAccountId, amount, comments

 
Optional Fields
paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber

## Parameters
- `command` (query, string): command

## Request body (application/json)
- `accountNumber` (string)
- `accountingRuleId` (integer)
- `amount` (number)
- `bankNumber` (string)
- `checkNumber` (string)
- `comments` (string)
- `credits` (array of SingleDebitOrCreditEntryCommand)
- `currencyCode` (string)
- `dateFormat` (string)
- `debits` (array of SingleDebitOrCreditEntryCommand)
- `externalAssetOwner` (string)
- `locale` (string)
- `officeId` (integer)
- `paymentTypeId` (integer)
- `receiptNumber` (string)
- `referenceNumber` (string)
- `routingCode` (string)
- `transactionDate` (string)

## Responses
- `200`: OK

## Response fields
- `officeId` (integer): 1
- `transactionId` (string): RS9MCISID4WK1ZM

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/journalentries' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "accountNumber": "string",
  "accountingRuleId": 1,
  "amount": 0,
  "bankNumber": "string",
  "checkNumber": "string",
  "comments": "string",
  "credits": [
    {
      "amount": 0,
      "comments": "string",
      "commentsChanged": true,
      "glAccountId": 1
    }
  ],
  "currencyCode": "string",
  "dateFormat": "dd MMMM yyyy",
  "debits": [
    {
      "amount": 0,
      "comments": "string",
      "commentsChanged": true,
      "glAccountId": 1
    }
  ]
}'
```

## Example response
```json
{
  "officeId": 1,
  "transactionId": "string"
}
```

Interactive: https://developer.lokta.ai/reference#operation/createGLJournalEntry
