Documents
Confirm Document
Verify a registry transaction from its receipt and record the outcome
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
legal-documents
/
confirm
Confirm Document
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"txHash": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm"
payload = { "txHash": "<string>" }
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({txHash: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm', 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}/legal-documents/confirm",
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([
'txHash' => '<string>'
]),
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}/legal-documents/confirm"
payload := strings.NewReader("{\n \"txHash\": \"<string>\"\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}/legal-documents/confirm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"txHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm")
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 \"txHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"txHash": "0x74e710c780867e261e60a45b0ef20096d2a0325bc74c63a15fff6d4808732da2",
"signer": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"blockNumber": 12107712,
"recordedAt": "2026-11-10T23:16:37.000Z",
"events": [
{
"kind": "UPDATED",
"loanId": "0",
"name": "licence-position",
"nameValid": true,
"nameBytes32": "0x6c6963656e63652d706f736974696f6e00000000000000000000000000000000",
"uri": null,
"documentHash": "0x7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"contentHash": "7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"visibility": "private",
"by": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"logIndex": 0
}
],
"stagesRecorded": 0,
"marketId": "cmwbb5kji000bjww94goqt9km"
},
"error": null
}
Confirms a mined
setDocument or removeDocument transaction. The server reads the receipt itself: the transaction must target the document registry, call setDocument or removeDocument, be signed by a verified wallet of your instance, and emit DocumentUpdated or DocumentRemoved for this market. What is recorded comes from those events, never from the request.
The confirm marks staged loan documents recorded when an event carries their loan, name, hash and locator, and writes one audit entry per event. Confirming the same transaction again changes nothing and writes no second audit entry. A transaction signed through a smart account that wraps the call is verified through the wrapped call.
Path Parameters
Body Parameters
Response Fields
Show child attributes
Show child attributes
Each
{ kind, loanId, name, nameValid, nameBytes32, uri, documentHash, contentHash, visibility, by, logIndex }. kind is UPDATED or REMOVED; by is the writing admin wallet.Present when the transaction recorded the commitment of a bound loan agreement:
{ ref, loanId, status }. A LOAN agreement turns RECORDED.{
"success": true,
"data": {
"txHash": "0x74e710c780867e261e60a45b0ef20096d2a0325bc74c63a15fff6d4808732da2",
"signer": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"blockNumber": 12107712,
"recordedAt": "2026-11-10T23:16:37.000Z",
"events": [
{
"kind": "UPDATED",
"loanId": "0",
"name": "licence-position",
"nameValid": true,
"nameBytes32": "0x6c6963656e63652d706f736974696f6e00000000000000000000000000000000",
"uri": null,
"documentHash": "0x7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"contentHash": "7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"visibility": "private",
"by": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"logIndex": 0
}
],
"stagesRecorded": 0,
"marketId": "cmwbb5kji000bjww94goqt9km"
},
"error": null
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | txHash is missing or malformed |
TX_REVERTED | 400 | The transaction reverted. Nothing was recorded |
TX_WRONG_TARGET, TX_WRONG_FUNCTION | 400 | The transaction does not call setDocument or removeDocument on the registry |
TX_NOT_VERIFIED | 400 | The transaction emits no document event for this market |
DOCUMENT_WRITE_NOT_INSTANCE_BOUND | 403 | The signer is not a verified wallet of your instance |
TX_NOT_FOUND | 404 | The transaction is not mined yet. Retry shortly |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
DOCUMENT_REGISTRY_NOT_CONFIGURED | 501 | The document registry is not deployed on this network |
CHAIN_UNAVAILABLE, SERVICE_UNAVAILABLE | 503 | The chain or this instance’s wallets could not be read. The record on chain is unaffected; send the same txHash again shortly |
⌘I
Confirm Document
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"txHash": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm"
payload = { "txHash": "<string>" }
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({txHash: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm', 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}/legal-documents/confirm",
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([
'txHash' => '<string>'
]),
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}/legal-documents/confirm"
payload := strings.NewReader("{\n \"txHash\": \"<string>\"\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}/legal-documents/confirm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"txHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/confirm")
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 \"txHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"txHash": "0x74e710c780867e261e60a45b0ef20096d2a0325bc74c63a15fff6d4808732da2",
"signer": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"blockNumber": 12107712,
"recordedAt": "2026-11-10T23:16:37.000Z",
"events": [
{
"kind": "UPDATED",
"loanId": "0",
"name": "licence-position",
"nameValid": true,
"nameBytes32": "0x6c6963656e63652d706f736974696f6e00000000000000000000000000000000",
"uri": null,
"documentHash": "0x7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"contentHash": "7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
"visibility": "private",
"by": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
"logIndex": 0
}
],
"stagesRecorded": 0,
"marketId": "cmwbb5kji000bjww94goqt9km"
},
"error": null
}
