E-Signatures
Get Loan Agreement
Read one loan agreement with its schedule, salt and acceptance typed data
GET
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
loan-agreements
/
{ref}
Get Loan Agreement
curl --request GET \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "SIGNED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"chainRef": {
"network": "ETHEREUM",
"instanceType": "DEVELOPMENT"
},
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"scheduleVersion": "1.0.0",
"scheduleFrozen": true,
"hashScheme": "SALTED_V1",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": null,
"copyVerified": null,
"nextStep": "VERIFY_AND_ACCEPT",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"links": [],
"acceptTypedData": {
"domain": {
"name": "Trusset Loan Agreement",
"version": "1",
"chainId": 11155111
},
"types": {
"LoanAgreementAcceptance": [
{
"name": "ref",
"type": "string"
},
{
"name": "market",
"type": "address"
},
{
"name": "borrower",
"type": "address"
},
{
"name": "kind",
"type": "string"
},
{
"name": "scheduleHash",
"type": "bytes32"
},
{
"name": "documentCommitment",
"type": "bytes32"
},
{
"name": "certificateCommitment",
"type": "bytes32"
},
{
"name": "copyVerified",
"type": "bool"
}
]
},
"primaryType": "LoanAgreementAcceptance",
"message": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"market": "0x41B9C4d5DEe70A5e3682094462E5065275E728a9",
"borrower": "0x7c1E3A5F2b9d4e6A8C0f1b3D5e7A9c2B4D6f8E1a",
"kind": "LOAN",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"copyVerified": true
}
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Returns one agreement to a party: the bank, or the borrower side. Anyone else gets
AGREEMENT_NOT_FOUND. The answer carries the schedule, the salt once the agreement is issued, the loans it is bound to, and, while it waits for acceptance, the typed data the borrower signs.
Path Parameters
Query Parameters
true or false (default). The value written into acceptTypedData: whether the borrower’s copy matched the reported commitment. The borrower signs exactly the typed data it reads.Response Fields
Show child attributes
Show child attributes
The loan schedule:
ref, kind, chainId, network, marketAddress, lender.adminWallet, borrower.{wallet, payTo}, collateral.{token, symbol, decimals, amount, amountRaw}, principal.{asset, symbol, decimals} with amount (LOAN) or limit (FRAMEWORK), rate, term, risk, realization, fees, termsOfUse, issuedAt, expiresAt, validUntil. The field names double as merge fields for an e-signature template.The published terms version and hash the agreement was issued against. A change before acceptance makes it
STALE.The loans it is bound to:
{ loanId, openTxHash, matched, differences, recordedTxHash, recordedAt }. differences lists { field, expected, actual } where the opened loan differs from the schedule.While
SIGNED: the EIP-712 typed data the borrower signs. See Acceptance.{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "SIGNED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"chainRef": {
"network": "ETHEREUM",
"instanceType": "DEVELOPMENT"
},
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"scheduleVersion": "1.0.0",
"scheduleFrozen": true,
"hashScheme": "SALTED_V1",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": null,
"copyVerified": null,
"nextStep": "VERIFY_AND_ACCEPT",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"links": [],
"acceptTypedData": {
"domain": {
"name": "Trusset Loan Agreement",
"version": "1",
"chainId": 11155111
},
"types": {
"LoanAgreementAcceptance": [
{
"name": "ref",
"type": "string"
},
{
"name": "market",
"type": "address"
},
{
"name": "borrower",
"type": "address"
},
{
"name": "kind",
"type": "string"
},
{
"name": "scheduleHash",
"type": "bytes32"
},
{
"name": "documentCommitment",
"type": "bytes32"
},
{
"name": "certificateCommitment",
"type": "bytes32"
},
{
"name": "copyVerified",
"type": "bool"
}
]
},
"primaryType": "LoanAgreementAcceptance",
"message": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"market": "0x41B9C4d5DEe70A5e3682094462E5065275E728a9",
"borrower": "0x7c1E3A5F2b9d4e6A8C0f1b3D5e7A9c2B4D6f8E1a",
"kind": "LOAN",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"copyVerified": true
}
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_AGREEMENT_FILTER | 400 | copyVerified is neither true nor false |
AGREEMENT_NOT_FOUND | 404 | No agreement with this reference on this market, or your instance is not a party to it. List the agreements to find it |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
CHAIN_UNAVAILABLE, SERVICE_UNAVAILABLE | 503 | The market or your instance’s wallets could not be read just now. Nothing was decided. Retry shortly |
⌘I
Get Loan Agreement
curl --request GET \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "SIGNED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"chainRef": {
"network": "ETHEREUM",
"instanceType": "DEVELOPMENT"
},
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"scheduleVersion": "1.0.0",
"scheduleFrozen": true,
"hashScheme": "SALTED_V1",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": null,
"copyVerified": null,
"nextStep": "VERIFY_AND_ACCEPT",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"links": [],
"acceptTypedData": {
"domain": {
"name": "Trusset Loan Agreement",
"version": "1",
"chainId": 11155111
},
"types": {
"LoanAgreementAcceptance": [
{
"name": "ref",
"type": "string"
},
{
"name": "market",
"type": "address"
},
{
"name": "borrower",
"type": "address"
},
{
"name": "kind",
"type": "string"
},
{
"name": "scheduleHash",
"type": "bytes32"
},
{
"name": "documentCommitment",
"type": "bytes32"
},
{
"name": "certificateCommitment",
"type": "bytes32"
},
{
"name": "copyVerified",
"type": "bool"
}
]
},
"primaryType": "LoanAgreementAcceptance",
"message": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"market": "0x41B9C4d5DEe70A5e3682094462E5065275E728a9",
"borrower": "0x7c1E3A5F2b9d4e6A8C0f1b3D5e7A9c2B4D6f8E1a",
"kind": "LOAN",
"scheduleHash": "0x8e2c4a6f1b3d5e7a9c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d1e3a5c7f9b0d2e4a",
"documentCommitment": "0x3a7f9c2e5b1d8a4f6c0e2b9d7a3f1c5e8b4d2a6f0c9e7b3d1a5f8c2e6b4d0a9f",
"certificateCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"copyVerified": true
}
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
