Documents
Record Staged Document
Build the registry transaction that records a staged loan document
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
legal-documents
/
staged
/
{stageId}
/
record
Record Staged Document
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signerAddress": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record"
payload = { "signerAddress": "<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({signerAddress: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record', 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/staged/{stageId}/record",
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([
'signerAddress' => '<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/staged/{stageId}/record"
payload := strings.NewReader("{\n \"signerAddress\": \"<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/staged/{stageId}/record")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signerAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record")
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 \"signerAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyReturns the unsigned
Every other code of Record Document applies.
setDocument transaction that records a staged loan document exactly as it was staged: the loan, the name and the SHA-256, private. The market admin signs it, then confirms it with Confirm Document, which marks the staged entry RECORDED.
Only an instance one of whose verified wallets holds DEFAULT_ADMIN_ROLE on the market can record a document another instance staged. The checks and the response are those of Record Document, with the staged entry added as stage.
Path Parameters
The
id of the staged document, from Get Documents.Body Parameters
Error Codes
| Code | HTTP | Cause |
|---|---|---|
STAGE_NOT_FOUND | 404 | No staged document with that id for this market that your instance may see |
STAGE_NOT_PENDING | 409 | The document is already recorded or was dismissed. details.status says which |
NOT_MARKET_ADMIN | 403 | No verified wallet of your instance holds DEFAULT_ADMIN_ROLE on the market |
DOCUMENT_CURRENT | 409 | The registry already holds this document. Confirm nothing; read the documents again |
LOAN_DOCUMENT_MUST_BE_PRIVATE | 422 | The entry was staged public before loan documents became private only. Dismiss it; the borrower stages it again as private |
⌘I
Record Staged Document
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signerAddress": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record"
payload = { "signerAddress": "<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({signerAddress: '<string>'})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record', 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/staged/{stageId}/record",
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([
'signerAddress' => '<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/staged/{stageId}/record"
payload := strings.NewReader("{\n \"signerAddress\": \"<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/staged/{stageId}/record")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signerAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/legal-documents/staged/{stageId}/record")
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 \"signerAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body