Publish terms
Authority is read from the chain at the moment of the save. One of your instance’s verified wallets must be the lender of record recorded on the factory, or hold the market’s admin or issuer role. Before a lender of record takes the market nobody qualifies, and every save is refused withNOT_CURATOR.
content is markdown, stored as written apart from Windows line endings, which become \n. The SDK refuses content over 262,144 bytes of UTF-8 and control characters other than tab, newline and carriage return before any request. title takes at most 200 characters.
Every save that changes something writes a new version and keeps the old ones. A save identical to the current record writes nothing and answers changed: false. authority on the result says which role the save was made under.
To bind a template from your instance’s terms library instead, send templateId. The template’s text is saved and content is ignored. Templates are managed in the issuer app, and only the instance that authored a template can bind it.
Stage a draft
published: false saves a draft. While published terms exist, the draft is staged beside them as the next version, and the published terms stay what borrowers are shown. The result then carries draft: true, the liveVersion still served, and a notice. Publish a version with a later save that sends published: true.
A draft is not private to your instance. Every instance that holds the market can list it with
versions and read it with version, because terms are stored against the market’s address.Show terms to a borrower
get returns the published terms only, as markdown (the default, with content and plainText) or html. A market without published terms answers TERMS_NOT_PUBLISHED, which is a 404 that means “no terms to show”, not a missing market.
version and contentHash identify exactly which text was shown. binding reports whether the terms follow a template from the library and whether that template has a newer version since.
Read every version
versions lists the history newest first, without the document bodies. current is the live version, or null when the terms are offline. limit runs from 1 to 100 and defaults to 25.
version returns one saved version in full, whether or not it was published and whether or not the terms are live today. Each entry in versions keeps published as the record of how it was saved, and live marks the one served now.
Take terms offline
get answers TERMS_NOT_PUBLISHED for every instance, and loan builds on the market carry the warning. A later save with published: true puts the terms back online as a new version. The same authority check as for saving applies.
Export a copy for the record
export returns the file itself: bytes, its contentType and the filename the API suggests. format is pdf (the default), text or markdown. The SDK allows the call up to two minutes.
IDENTITY_GATES_UNREADABLE, a 503 worth retrying. The text and markdown formats do not read them.
The Lender of record line prints the wallet that saved the version. That can be a wallet holding the market’s admin or issuer role rather than the lender of record’s own.
