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

# Check Transfer Compliance

> Verify whether a token transfer between two addresses is compliant

Checks the on-chain compliance module to determine whether a transfer between two addresses would be allowed. The check evaluates both sender and receiver identity status, investor type restrictions, country rules, and balance limits configured in the instance's compliance contracts.

Use this as a pre-flight check before submitting transfer transactions to avoid on-chain reverts.

## Request Body

<ParamField body="from" type="string" required>
  Sender wallet address.
</ParamField>

<ParamField body="to" type="string" required>
  Receiver wallet address.
</ParamField>

<ParamField body="amount" type="string" default="0">
  Transfer amount as a human-readable string (e.g., `"1000.5"`).
</ParamField>

<ParamField body="fromBalance" type="string" default="0">
  Current balance of the sender. Used for balance-based compliance rules.
</ParamField>

<ParamField body="toBalance" type="string" default="0">
  Current balance of the receiver. Used for balance-based compliance rules.
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">Request status</ResponseField>

<ResponseField name="data" type="object">
  Compliance check result. Structure depends on the compliance module configuration. Typically includes an `allowed` boolean and, when the transfer is blocked, a `reason` or `violations` array describing which rules failed.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/customers/api/identity/can-transfer" \
    -H "Content-Type: application/json" \
    -H "X-API-Key: trusset_abc123xy_secret..." \
    -d '{
      "from": "0xAbC123dEf456789012345678901234567890AbCd",
      "to": "0x1234567890abcdef1234567890abcdef12345678",
      "amount": "1000.0",
      "fromBalance": "5000.0",
      "toBalance": "200.0"
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch(
    'https://api.trusset.org/customers/api/identity/can-transfer',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': 'trusset_abc123xy_secret...'
      },
      body: JSON.stringify({
        from: '0xAbC123dEf456789012345678901234567890AbCd',
        to: '0x1234567890abcdef1234567890abcdef12345678',
        amount: '1000.0',
        fromBalance: '5000.0',
        toBalance: '200.0'
      })
    }
  );
  const { data } = await response.json();

  if (!data.allowed) {
    console.error('Transfer blocked:', data.violations);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response - Allowed theme={null}
  {
    "success": true,
    "data": {
      "allowed": true,
      "from": "0xAbC123dEf456789012345678901234567890AbCd",
      "to": "0x1234567890abcdef1234567890abcdef12345678"
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-06-15T12:00:00.000Z"
    }
  }
  ```

  ```json Response - Blocked theme={null}
  {
    "success": true,
    "data": {
      "allowed": false,
      "from": "0xAbC123dEf456789012345678901234567890AbCd",
      "to": "0x1234567890abcdef1234567890abcdef12345678",
      "violations": [
        "Receiver identity not verified",
        "Receiver country restricted"
      ]
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-06-15T12:00:00.000Z"
    }
  }
  ```
</ResponseExample>
