> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Issue Loan Agreement

> Freeze the schedule of a requested loan agreement and create its salt

Issues a `REQUESTED` agreement. The schedule is read again from the market and frozen, and a fresh 32-byte salt is created. You may lower the requested collateral or principal and shorten the offer, never raise them. The figures must be inside the market rules. An earlier open agreement of the same kind for the same wallet becomes `SUPERSEDED`.

Then download the schedule with [Get Loan Schedule](https://docs.trusset.org/endpoints/lending/get-loan-schedule.md), attach it to your contract and sign it in your own tool.

## Who can call

The bank. Needs the Scale plan.

## Path Parameters

**marketId** `string` *required*

The market's record ID on your instance.

**ref** `string` *required*

The agreement reference: `agr_` followed by 20 characters.

## Body Parameters

**collateralAmount** `string`

A lower collateral amount than requested.

**borrowAmount** `string`

A lower principal than requested.

**validityDays** `number`

A shorter offer than the policy's.

**signerAddress** `string`

The admin wallet named as lender in the schedule.

## Response Fields

**data** `object`

**agreement** `object`

The agreement. See [Get Loan Agreement](https://docs.trusset.org/endpoints/lending/get-loan-agreement.md#response-fields) for every field.

**marketId** `string`

The market's record ID on your instance.

```json 200 Issued theme={null}
{
  "success": true,
  "data": {
    "agreement": {
      "ref": "agr_k3vx7q2mwd4h5pn6tr8a",
      "kind": "LOAN",
      "status": "ISSUED",
      "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": null,
      "certificateCommitment": null,
      "copyVerified": null,
      "nextStep": "REPORT_SIGNED",
      "expiresAt": "2026-12-21T16:02:11.000Z",
      "salt": "0x9f3c2a7d1e5b8c4a6f0d2e9b7c3a1f5e8d4b2c6a0e9f7d3b1c5a8e2f6d4b0c9a",
      "viewerRole": {
        "bank": true,
        "borrower": false
      },
      "issuedByThisInstance": true
    },
    "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 |
| `AGREEMENT_FEATURE_REQUIRED` | `402` | Your plan does not include loan agreements |
| `AGREEMENT_BANK_ONLY` | `403` | No verified wallet of your instance holds `DEFAULT_ADMIN_ROLE` on the market |
| `AGREEMENT_POLICY_OFF` | `409` | E-Signatures were switched off on this market. Switch them on first, or decline |
| `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 |
| `MARKET_PRICE_UNAVAILABLE` | `409` | The collateral could not be valued just now. Retry once the price is fresh |
| `AGREEMENT_FIGURES_OUTSIDE_MARKET` | `422` | A figure is above the request or outside a market rule. `details.problems` names each |
| `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 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.