E-Signatures
Accept Loan Agreement
Accept a signed loan agreement with the borrower wallet
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
loan-agreements
/
{ref}
/
accept
Accept Loan Agreement
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signature": "<string>",
"copyVerified": true
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept"
payload = {
"signature": "<string>",
"copyVerified": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signature: '<string>', copyVerified: true})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept', 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}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signature' => '<string>',
'copyVerified' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept"
payload := strings.NewReader("{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "ACCEPTED",
"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": true,
"nextStep": "OPEN_LOAN",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"acceptance": "0x8f1caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1b"
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Accepts a
SIGNED agreement. Read Get Loan Agreement with the copyVerified you state, have the borrower wallet sign its acceptTypedData (EIP-712, for example eth_signTypedData_v4), and send the signature here with the same copyVerified. The signature must recover the borrower wallet in canonical low-s form; a contract wallet is checked with EIP-1271 over the typed-data hash.
The acceptance covers the commitments as they stand: if the bank reported again after you read the typed data, the signature no longer matches and you sign the new one. An acceptance sent twice returns the agreement unchanged (changed: false). A LOAN agreement must be used before expiresAt; a FRAMEWORK agreement stays ACCEPTED until its end date.
Who can call
The borrower side, with a signature from the borrower wallet.Path Parameters
Body Parameters
Whether the borrower’s copy matched the reported commitment. It is part of the signed data and the bank sees it.
Response Fields
Show child attributes
Show child attributes
The agreement. See Get Loan Agreement for every field.
{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "ACCEPTED",
"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": true,
"nextStep": "OPEN_LOAN",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"acceptance": "0x8f1caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1b"
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
DOCUMENT_CONTENT_REFUSED | 400 | The body carries file content. Keep the file with you and send only the salted commitment |
PLAIN_HASH_REFUSED | 400 | The body carries the plain hash of a file (contentHash, sha256 and similar). Send the salted commitment instead |
PERSONAL_DATA_REFUSED | 400 | The body carries a personal data field such as name or email. Use wallet addresses and externalReference only |
VALIDATION_ERROR | 400 | A field is missing, has the wrong type, or is not part of this route |
INVALID_ACCEPTANCE | 400 | copyVerified is not a boolean |
AGREEMENT_SIGNATURE_INVALID | 400 | The signature does not come from the borrower wallet for the agreement as it stands, or is not low-s. Read the agreement again and sign what it shows |
AGREEMENT_BORROWER_ONLY | 403 | Your instance did not request the agreement and does not hold the borrower wallet |
AGREEMENT_STATE | 409 | The agreement is in a status that does not allow this. details.status names it; read the agreement for its next step |
AGREEMENT_STALE | 409 | The terms of use changed after the issue. Request a new agreement |
TERMS_UNAVAILABLE | 503 | The terms of use could not be read just now. Retry shortly |
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
Accept Loan Agreement
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signature": "<string>",
"copyVerified": true
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept"
payload = {
"signature": "<string>",
"copyVerified": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signature: '<string>', copyVerified: true})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept', 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}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signature' => '<string>',
'copyVerified' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept"
payload := strings.NewReader("{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-agreements/{ref}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"<string>\",\n \"copyVerified\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agreement": {
"ref": "agr_k3vx7q2mwd4h5pn6tr8a",
"kind": "LOAN",
"status": "ACCEPTED",
"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": true,
"nextStep": "OPEN_LOAN",
"expiresAt": "2026-12-21T16:02:11.000Z",
"salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
"viewerRole": {
"bank": false,
"borrower": true
},
"acceptance": "0x8f1caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1b"
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
