LoanRepayment
Repays a funded loan using currency units. The loan must be funded and not already repaid.
Request
POST /nxt?requestType=loanRepayment
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Borrower's secret passphrase | Yes |
loan | long | Loan ID to repay | Yes |
currency | long | Currency ID | Yes |
unitsQNT | long | Number of units to repay | Yes |
feeRateQNTPerFXT | long | Transaction fee rate | Optional |
deadline | int | Transaction deadline in minutes | Optional |
Constraints
- The loan must be funded (not already repaid or rescued)
- The borrower must be the loan account
- The currency must match the loan's currency
- The repayment amount must cover principal plus interest
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}
Error Handling
| Error | Condition |
|---|---|
LOAN_REPAID | Loan is already repaid or rescued |
INCORRECT_LOAN | Loan is not eligible for repayment |
INCORRECT_CURRENCY | Currency does not match loan |
NOT_ENOUGH_CURRENCY | Insufficient currency balance |
Example
curl -X POST http://localhost:22024/nxt \
-d "requestType=loanRepayment" \
-d "secretPhrase=your_phrase" \
-d "loan=55555" \
-d "currency=987654321" \
-d "unitsQNT=1050000000"