> ## 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.

# Confirm Transaction

> Records a broadcast deposit or redemption after receipt verification

Reports a broadcast transaction so the vault's ledger records it. The backend fetches the receipt, checks that it succeeded, checks that it called the function the type claims on this vault's address, and reads the amount from the transaction's events rather than from the request body.

This endpoint accepts investor types only: `DEPOSIT` and `REDEEM`. Operator transactions are confirmed by the operator in the Issuer Portal.

## Path Parameters

<ParamField path="vaultId" type="string" required>Vault ID.</ParamField>

## Body Parameters

<ParamField body="txHash" type="string" required>Hash of the broadcast transaction. For a deposit, use the deposit step's hash, not the approval's.</ParamField>
<ParamField body="txType" type="string" required>`DEPOSIT` or `REDEEM`. Any other value answers `VALIDATION_ERROR`.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="txHash" type="string">The verified hash.</ResponseField>
    <ResponseField name="signedBy" type="string">The wallet that actually signed, read from the receipt.</ResponseField>
    <ResponseField name="txType" type="string">The recorded type.</ResponseField>
    <ResponseField name="amount" type="string">Settlement-asset amount from the `Deposited` or `Redeemed` event. For a partial redemption this is what was actually paid.</ResponseField>
  </Expandable>
</ResponseField>

<Note>
  A failed confirmation does not undo the transaction. It is on-chain regardless, so retry the confirmation and the record reconciles. Never re-broadcast because a confirm call errored.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/lending-external-securities/api/vaults/{vaultId}/confirm-tx" \
    -H "X-API-Key: trusset_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"txHash": "0x8f3b...89ab", "txType": "DEPOSIT"}'
  ```

  ```typescript TypeScript theme={null}
  await fetch(
    `https://api.trusset.org/lending-external-securities/api/vaults/${vaultId}/confirm-tx`,
    {
      method: 'POST',
      headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
      body: JSON.stringify({ txHash, txType: 'DEPOSIT' })
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "success": true,
      "txHash": "0x8f3b2c1d4e5f60718293a4b5c6d7e8f9012345678901234567890123456789ab",
      "signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
      "txType": "DEPOSIT",
      "amount": "1000"
    }
  }
  ```

  ```json Error - Wrong function theme={null}
  {
    "success": false,
    "error": {
      "code": "TX_NOT_VERIFIED",
      "message": "The transaction did not call deposit on this vault"
    }
  }
  ```
</ResponseExample>
