Skip to main content
POST
Approve Loan Request
Builds the approve transaction on the market’s approvals contract, and confirms it on a second call with txHash. Trusset never signs: the market admin or a wallet holding LOAN_APPROVER_ROLE signs the calldata. One approval admits one draw of at most the approved amount until validUntil. The draw consumes it.

Who can call

The lender of record.

Path Parameters

string
required
The market’s record ID on your instance.
string
required
The loan request reference: lrq_ followed by 20 characters.

Body Parameters

string | number
The amount to approve. Defaults to the requested amount and may only be lower.
number
default:"72"
How long the approval stays valid, from 1 to 696 hours.
string
The wallet that will sign.
string
Hash of the transaction you broadcast. Send it to confirm the transaction and record the result. Omit it to receive the calldata.

An approval in force is never replaced

While a usable approval is on chain for the request’s borrower and loan, the build answers 409 APPROVAL_IN_FORCE, and error.details.approved carries { amount, amountRaw, validUntil } of that approval. Revoke it first with Revoke Loan Approval, then approve again. The revoke fails once the borrower drew, so an approval is never changed under a loan that is being opened. A lapsed approval, one past its validUntil, can be replaced directly. When the request reads APPROVED but its approval is no longer on chain, it was used or revoked. The build answers 409 APPROVAL_NOT_ON_CHAIN, and a further loan needs a new request.

Confirming

An approval is recorded only on the request it was signed for. The confirm answers 400 TX_NOT_VERIFIED when the transaction is older than the approval already recorded on the request, or was signed before the request existed. A mined approval can still be confirmed on a request that was withdrawn, declined or closed in the meantime, as long as that approval is still in force on chain. Otherwise the confirm answers 409 APPROVAL_NOT_ON_CHAIN. A USED or REVOKED request takes no approval and answers 409 LOAN_REQUEST_STATE.

Response Fields

object

Error Codes