Markets
Get Terms
Read the published terms of use for a market
GET
/
lending-external-securities
/
api
/
markets
/
{marketId}
/
terms
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
container.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0x8c1f42a7d905b63e0f27c4a8b13d95e6027f4a81c39b6d20e5847af13c02b96d",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2025-06-10T09:12:44.000Z",
"createdAt": "2025-05-28T14:03:07.000Z",
"updatedAt": "2025-06-10T09:12:44.000Z",
"contentBytes": 8421,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n...",
"plainText": "Terms of Use\n\n1. Parties\n..."
}
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
Returns the terms of use published by the market’s lender of record. A borrow button cannot be shipped compliantly without them. This is where an integrating application fetches them: by API key, on the market it already knows, in the form it renders.
Only published terms are returned. A draft that was never promoted reads as if no terms exist.
Path Parameters
string
required
Market ID.
Query Parameters
string
default:"markdown"
markdown or html. Any other value is rejected with VALIDATION_ERROR.Response Fields
object
Show child attributes
Show child attributes
object
Show child attributes
Show child attributes
string
Terms record ID.
string
Market the terms belong to.
string
Document title.
integer
Current version number.
string
Hash of the content, stable per version.
string
Address of the lender of record that published this version.
boolean
Always
true on this endpoint.string
ISO 8601 publication timestamp.
string
ISO 8601 creation timestamp.
string
ISO 8601 timestamp of the last save.
integer
Size of the source content in bytes.
string
Echoes the requested format.
string
Raw markdown. Present when
format is markdown.string
Rendered plain text. Present when
format is markdown.string
Rendered HTML. Present when
format is html.The markdown form travels with its plain-text rendering in the same response, so displaying terms in a surface that has no markdown renderer never costs a second request.
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
container.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0x8c1f42a7d905b63e0f27c4a8b13d95e6027f4a81c39b6d20e5847af13c02b96d",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2025-06-10T09:12:44.000Z",
"createdAt": "2025-05-28T14:03:07.000Z",
"updatedAt": "2025-06-10T09:12:44.000Z",
"contentBytes": 8421,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n...",
"plainText": "Terms of Use\n\n1. Parties\n..."
}
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
NO_MARKET_ADDRESS | 400 | The market has no on-chain address |
VALIDATION_ERROR | 400 | format is not markdown or html |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
TERMS_NOT_PUBLISHED | 404 | The lender of record has published no terms for this market |
⌘I
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
container.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0x8c1f42a7d905b63e0f27c4a8b13d95e6027f4a81c39b6d20e5847af13c02b96d",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2025-06-10T09:12:44.000Z",
"createdAt": "2025-05-28T14:03:07.000Z",
"updatedAt": "2025-06-10T09:12:44.000Z",
"contentBytes": 8421,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n...",
"plainText": "Terms of Use\n\n1. Parties\n..."
}
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
