# Update a Accounting Rule

`PUT /lokta-lms/api/v1/accountingrules/{accountingRuleId}`

Updates the details of a Accounting rule.

## Parameters
- `accountingRuleId` (path, integer, required): accountingRuleId

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

## Responses
- `200`: OK

## Response fields
- `changes` (PutAccountingRulesResponsechangesSwagger)
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X PUT \
  'https://default.lokta.tech/lokta-lms/api/v1/accountingrules/{accountingRuleId}' \
  -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
{
  "changes": {
    "name": "Employee Salary posting rule"
  },
  "resourceId": 1
}
```

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