# LoanManage [[Source]](https://github.com/XRPLF/rippled/blob/develop/src/xrpld/app/tx/detail/LoanManage.cpp) Attention Lending Protocol and Single Asset Vaults are disabled on Devnet. You have two options for testing these features: 1. Run `rippled` in [stand-alone mode](https://xrpl.org/docs/concepts/networks-and-servers/rippled-server-modes#stand-alone-mode) and enable `LendingProtocol` and `SingleAssetVault` in the [rippled.cfg file](https://xrpl.org/docs/infrastructure/testing-and-auditing/test-amendments). 2. Connect to the Lending Protocol-specific Devnet at `https://lend.devnet.rippletest.net:51234/`. Manages the state of a `Loan` ledger entry, including defaulting, impairing, or unimpairing a loan. Only the `LoanBroker` ledger entry owner can initiate this transaction. *(Requires the [Lending Protocol amendment](https://github.com/Tapanito/XRPL-Standards/tree/xls-66-lending-protocol/XLS-0066d-lending-protocol) )* ## Example JSON ```json { "TransactionType": "LoanManage", "Account": "rEXAMPLE9AbCdEfGhIjKlMnOpQrStUvWxYz", "Fee": "12", "Flags": 65536, "LastLedgerSequence": 7108682, "Sequence": 8, "LoanID": "E123F4567890ABCDE123F4567890ABCDEF1234567890ABCDEF1234567890ABCD" } ``` ## Fields In addition to the [common fields](https://xrpl.org/docs/references/protocol/transactions/common-fields/), transactions use the following fields: | Field Name | JSON Type | Internal Type | Required? | Description | | --- | --- | --- | --- | --- | | `LoanID` | String | Hash256 | Yes | The ID of the `Loan` ledger entry to manage. | | `Flags` | String | UInt32 | No | The flag to modify the loan. | ## Flags Transactions of the type support additional values in the [`flags` field](https://xrpl.org/docs/references/protocol/transactions/common-fields#flags-field), as follows: | Field Name | Hex Value | Decimal Value | Description | | --- | --- | --- | --- | | `tfLoanDefault` | `0x00010000` | `65536` | Indicates the loan should be defaulted. | | `tfLoanImpair` | `0x00020000` | `131072` | Indicates the the loan should be impaired. | | `tfLoanUnimpair` | `0x00040000` | `262144` | Indicates the the loan should be unimpaired. | ## Error Cases Besides errors that can occur for all transactions, transactions can result in the following [transaction result codes](https://xrpl.org/docs/references/protocol/transactions/transaction-results): | Error Code | Description | | --- | --- | | `temINVALID` | the `LoanID` field is missing or set to zero. | | `temINVALID_FLAG` | Multiple management flags have been set. Only one can be set at a time. | | `tecNO_ENTRY` | The loan specified by `LoanID` doesn't exist. | | `tecNO_PERMISSION` | - The transaction is attempting to modify a defaulted loan, or a fully paid loan.- The transaction is attempting to change the loan's impairment status to the one it already has. | | `tecTOO_SOON` | The loan can't be marked as defaulted before its payment due date and grace period have passed. | | `tecLIMIT_EXCEEDED` | Marking the loan as impaired creates a loss greater than the vault's oustanding assets, which would put the vault in an invalid state. |