# Create/Define a Accounting rule

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

Defines an accounting rule: a preset debit and credit pair that lets a user post a manual entry without choosing the accounts.

Define a new Accounting rule.

Mandatory Fields
name, officeId,
accountToDebit OR debitTags,
accountToCredit OR creditTags.

Optional Fields
description

## Request body (application/json)
- `accountToCredit` (integer)
- `accountToDebit` (integer)
- `description` (string)
- `name` (string)
- `officeId` (integer)

## Responses
- `200`: OK

## Response fields
- `officeId` (integer)
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/accountingrules' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "accountToCredit": 1,
  "accountToDebit": 1,
  "description": "string",
  "name": "string",
  "officeId": 1
}'
```

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

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