Loan Approvals
Create Loan Request
Ask the lender of record to approve a new loan or an additional draw
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
loan-requests
Create Loan Request
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"borrowerWallet": "<string>",
"borrowAmount": {},
"collateralAmount": {},
"loanId": {},
"externalReference": {}
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests"
payload = {
"borrowerWallet": "<string>",
"borrowAmount": {},
"collateralAmount": {},
"loanId": {},
"externalReference": {}
}
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({
borrowerWallet: '<string>',
borrowAmount: {},
collateralAmount: {},
loanId: {},
externalReference: {}
})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests', 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-requests",
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([
'borrowerWallet' => '<string>',
'borrowAmount' => [
],
'collateralAmount' => [
],
'loanId' => [
],
'externalReference' => [
]
]),
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-requests"
payload := strings.NewReader("{\n \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\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-requests")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests")
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 \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"request": {
"ref": "lrq_k3vx7q2mwd4h5pn6tr2a",
"kind": "OPEN",
"loanId": null,
"status": "REQUESTED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"amount": "25000",
"amountRaw": "25000000000",
"collateralAmount": "40",
"symbol": "USDC",
"decimals": 6,
"approvedAmount": null,
"approvedAmountRaw": null,
"validUntil": null,
"approver": null,
"approveTxHash": null,
"decidedAt": null,
"usedTxHash": null,
"usedAt": null,
"createdAt": "2026-11-21T16:02:11.000Z",
"updatedAt": "2026-11-21T16:02:11.000Z",
"requestedByThisInstance": true,
"viewerRole": {
"bank": false,
"borrower": true
},
"nextStep": "WAIT_FOR_BANK"
},
"created": true,
"replaced": null,
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Creates a loan request on a market that runs approve-only loans. Leave
loanId out to ask for a new loan. Name an open loan of the borrower in loanId to ask for an additional draw.
Limits and replacement are per instance:
- A new request for the same wallet and loan replaces your instance’s own waiting request. The answer names the replaced request in
replaced. - Your instance keeps at most 3 waiting requests per wallet and 25 per market. Beyond that the route answers
429 LOAN_REQUEST_LIMIT. OnlyREQUESTEDrequests count, and the one being replaced does not. - Requests by different instances for the same wallet do not block each other.
externalReference only.
Path Parameters
Body Parameters
Leave out for a new loan. Name an open loan of that borrower to request an additional draw.
Your own case or file number: 1 to 64 letters, digits, dots, underscores or hyphens. No personal data.
Response Fields
Answers201.
Show child attributes
Show child attributes
The loan request. See Get Loan Request for every field.
{
"success": true,
"data": {
"request": {
"ref": "lrq_k3vx7q2mwd4h5pn6tr2a",
"kind": "OPEN",
"loanId": null,
"status": "REQUESTED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"amount": "25000",
"amountRaw": "25000000000",
"collateralAmount": "40",
"symbol": "USDC",
"decimals": 6,
"approvedAmount": null,
"approvedAmountRaw": null,
"validUntil": null,
"approver": null,
"approveTxHash": null,
"decidedAt": null,
"usedTxHash": null,
"usedAt": null,
"createdAt": "2026-11-21T16:02:11.000Z",
"updatedAt": "2026-11-21T16:02:11.000Z",
"requestedByThisInstance": true,
"viewerRole": {
"bank": false,
"borrower": true
},
"nextStep": "WAIT_FOR_BANK"
},
"created": true,
"replaced": null,
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_WALLET | 400 | borrowerWallet is not an address |
INVALID_LOAN_ID | 400 | loanId is not a loan ID |
INVALID_AMOUNT | 400 | An amount is not valid |
INVALID_EXTERNAL_REFERENCE | 400 | externalReference is not 1 to 64 letters, digits, dots, underscores or hyphens |
PERSONAL_DATA_REFUSED | 400 | The body carries a personal data field. The routes carry none |
LOAN_NOT_FOUND | 404 | loanId names no open loan of that borrower |
LOAN_APPROVAL_NOT_REQUIRED | 409 | The market does not require approvals. Open the loan directly |
LOAN_APPROVALS_CUSTOM | 409 | The market names an approvals contract that the Trusset approvals factory did not build, which the API cannot read or write |
LOAN_REQUEST_OPEN | 409 | Your instance made the same request a moment ago, and that request stands. This is a concurrent duplicate. Read the loan requests to find it |
LOAN_REQUEST_LIMIT | 429 | Your instance already keeps 3 waiting requests for this wallet, or 25 waiting requests on this market. Withdraw one or wait for the lender of record to decide |
⌘I
Create Loan Request
curl --request POST \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"borrowerWallet": "<string>",
"borrowAmount": {},
"collateralAmount": {},
"loanId": {},
"externalReference": {}
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests"
payload = {
"borrowerWallet": "<string>",
"borrowAmount": {},
"collateralAmount": {},
"loanId": {},
"externalReference": {}
}
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({
borrowerWallet: '<string>',
borrowAmount: {},
collateralAmount: {},
loanId: {},
externalReference: {}
})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests', 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-requests",
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([
'borrowerWallet' => '<string>',
'borrowAmount' => [
],
'collateralAmount' => [
],
'loanId' => [
],
'externalReference' => [
]
]),
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-requests"
payload := strings.NewReader("{\n \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\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-requests")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/loan-requests")
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 \"borrowerWallet\": \"<string>\",\n \"borrowAmount\": {},\n \"collateralAmount\": {},\n \"loanId\": {},\n \"externalReference\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"request": {
"ref": "lrq_k3vx7q2mwd4h5pn6tr2a",
"kind": "OPEN",
"loanId": null,
"status": "REQUESTED",
"marketAddress": "0x41b9c4d5dee70a5e3682094462e5065275e728a9",
"borrowerWallet": "0x7c1e3a5f2b9d4e6a8c0f1b3d5e7a9c2b4d6f8e1a",
"externalReference": "CASE-2026.11_042",
"amount": "25000",
"amountRaw": "25000000000",
"collateralAmount": "40",
"symbol": "USDC",
"decimals": 6,
"approvedAmount": null,
"approvedAmountRaw": null,
"validUntil": null,
"approver": null,
"approveTxHash": null,
"decidedAt": null,
"usedTxHash": null,
"usedAt": null,
"createdAt": "2026-11-21T16:02:11.000Z",
"updatedAt": "2026-11-21T16:02:11.000Z",
"requestedByThisInstance": true,
"viewerRole": {
"bank": false,
"borrower": true
},
"nextStep": "WAIT_FOR_BANK"
},
"created": true,
"replaced": null,
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
