Skip to main content
POST
Stage Loan Document
A borrower that is not the market admin cannot write to the document registry. Stage its loan document here instead: the server stores the name, the SHA-256, the loan and the borrower wallet. A loan document names the borrower and the parties, so it is always private: the file never reaches Trusset and nothing but its hash goes to the registry. The market admin sees the staged document in Get Documents and records it with one signature through Record Staged Document, or dismisses it. Stage after the loan has opened and been confirmed. A document never blocks, delays or undoes the loan: a failed stage leaves the loan exactly as it is, and the same request can be sent again. When the borrower is the market admin itself, skip the stage and record the document directly with Record Document. Staging is idempotent per loan and name. Repeating the same document while it waits returns the existing entry with created: false and HTTP 200. A different hash under the same name replaces the entry. Staging the same document again after the admin dismissed it, or after a recorded version was removed from the registry, opens it again for the admin (reopened: true). A document already on the registry under the same name and hash is returned as RECORDED. An instance can keep at most 20 documents waiting per loan.

Who can stage

An API key of an instance that holds the market. submittedBy must be the wallet that opened the loan, as the market records it; any other wallet is refused with NOT_LOAN_BORROWER. The check ties the entry to the borrower’s loan; it does not prove who sent it. The admin compares the file the parties hand over with its SHA-256 before recording it.

Path Parameters

string
required
The market’s record ID on your instance.

Body Parameters

string
required
The loan, 1 or higher. Market documents are recorded by the market admin, never staged.
string
required
1 to 31 lowercase letters, digits or hyphens. Usually loan-agreement or pledge-agreement.
string
required
The SHA-256 of the exact file bytes, 64 hex characters, with or without 0x.
string
required
private. public is refused with LOAN_DOCUMENT_MUST_BE_PRIVATE: a loan document names the borrower and the parties.
string
required
The wallet that opened the loan.

Response Fields

object

Error Codes