# Adjust a Transaction

`POST /lokta-lms/api/v1/loans/{loanId}/transactions/{transactionId}`

Note: there is no need to specify command={transactionType} parameter.

Mandatory Fields: transactionDate, transactionAmount

## Parameters
- `loanId` (path, integer, required): loanId
- `transactionId` (path, integer, required): transactionId
- `command` (query, string): command

## Request body (application/json)
- `dateFormat` (string)
- `externalId` (string)
- `locale` (string)
- `note` (string)
- `paymentTypeId` (integer)
- `reversalExternalId` (string)
- `transactionAmount` (number)
- `transactionDate` (string)

## Responses
- `200`: OK

## Response fields
- `changes` (PostLoansLoanIdTransactionsResponseChanges)
- `clientId` (integer)
- `loanId` (integer)
- `officeId` (integer)
- `resourceExternalId` (string)
- `resourceId` (integer)
- `subResourceExternalId` (string)
- `subResourceId` (integer)

## Example request (cURL)
```bash
curl -X POST \
  'http://localhost:8080/lokta-lms/api/v1/loans/{loanId}/transactions/{transactionId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "dateFormat": "dd MMMM yyyy",
  "externalId": "4ff9b1cb988b7",
  "locale": "en_GB",
  "note": "An optional note about why your adjusting or changing the transaction.",
  "paymentTypeId": 1,
  "reversalExternalId": "95174ff9-1a75-4d72-a413-6f9b1cb988b7",
  "transactionAmount": 0,
  "transactionDate": "28 June 2022"
}'
```

## Example response
```json
{
  "changes": {
    "dateFormat": "dd MMMM yyyy",
    "externalId": "4ff9b1cb988b7",
    "locale": "en_GB",
    "note": "An optional note about why your adjusting or changing the transaction."
  },
  "clientId": 1,
  "loanId": 1,
  "officeId": 1
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/adjustLoanTransaction
