Skip to main content
POST
/
v1
/
policy-engine
/
check-transaction
Check Transaction Policy
curl --request POST \
  --url https://api.example.com/v1/policy-engine/check-transaction \
  --header 'Content-Type: application/json' \
  --data '
{
  "tenantId": "<string>",
  "projectId": "<string>",
  "userId": "<string>",
  "fromAddress": "<string>",
  "toAddress": "<string>",
  "amount": "<string>",
  "chainReference": "<string>",
  "txType": "<string>"
}
'
{
  "allowed": true,
  "result": 123,
  "reason": "<string>",
  "requiresApproval": true,
  "approvalRequestId": "<string>"
}

Check Transaction Policy

Evaluate a transaction against all applicable policies before signing. Returns whether the transaction is allowed and if approval is required.

Request

tenantId
string
required
Tenant identifier
projectId
string
required
Project identifier
userId
string
User initiating the transaction
fromAddress
string
required
Sender address
toAddress
string
required
Recipient address
amount
string
required
Transaction amount
chainReference
string
required
Chain identifier
txType
string
Transaction type (e.g., transfer, swap)

Response

allowed
boolean
Whether transaction is allowed
result
integer
Policy result code
reason
string
Explanation of the decision
requiresApproval
boolean
Whether approval is required
approvalRequestId
string
Approval request ID (if approval required)

Example

curl -X POST https://api.axonvault.io/v1/policy-engine/check-transaction \
  -H "X-Access-Key: ak_live_abc123" \
  -H "X-Signature: 5d41402abc4b2a76b9719d911017c592" \
  -H "X-Timestamp: 2024-01-15T10:30:00Z" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "ten_abc123",
    "projectId": "proj_abc123",
    "fromAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE8d",
    "toAddress": "0x1234567890123456789012345678901234567890",
    "amount": "50000000000000000000000",
    "chainReference": "eip155:1",
    "txType": "transfer"
  }'

Response Examples

Approved

{
  "allowed": true,
  "result": 1,
  "reason": "Transaction within policy limits",
  "requiresApproval": false,
  "approvalRequestId": ""
}

Requires Approval

{
  "allowed": true,
  "result": 2,
  "reason": "Amount exceeds threshold, approval required",
  "requiresApproval": true,
  "approvalRequestId": "apr_abc123"
}

Denied

{
  "allowed": false,
  "result": 0,
  "reason": "Recipient address not in whitelist",
  "requiresApproval": false,
  "approvalRequestId": ""
}

Result Codes

CodeMeaning
0Denied
1Approved
2Pending Approval

Integration Flow