Rule Engine
Apply transaction policy decisions in your backend or manage policy configuration.
The Rule Engine evaluates published incoming or outgoing policies and returns a decision with the transaction. Your backend applies that decision to its withdrawal, deposit, or review process.
Choose your task
| Task | Start here |
|---|---|
| Use an existing policy in a transaction flow. | Follow the decision-handling steps below. |
| Configure policies without building an editor. | Use the Client Dashboard to edit, simulate, and publish rules. |
| Build programmatic policy management. | Follow Manage Rule Engine policies for drafts, simulation, publication, and version history. |
Read the outcome in a transaction
Read ruleEngine from the transaction create response, a later detail read, or a transaction notification. If evaluation is unavailable, the field can be null. If there are no published rules, the decision is null; follow your own fallback policy rather than treating absence as approval.
This example transaction matches a published outgoing rule for amounts of at least USD 10,000. The returned WAIT decision includes the matched rule, policy version, a 120-second waiting period, and the REVIEW timeout action. Converted amounts are illustrative; the API calculates them from available pricing.
curl --location 'https://api-dev.cryptoswift.eu/transactions/233e3fd4-2ef0-477c-a398-8f993d131a19' \ --header "X-Api-Key: $API_KEY"
{
"id": "233e3fd4-2ef0-477c-a398-8f993d131a19",
"status": "DELIVERED",
"statusReasoning": null,
"direction": "OUTGOING",
"createdAt": "2026-11-11T09:00:00.000Z",
"asset": "BTC",
"amount": 0.5,
"amountUsd": 35000,
"amountEur": 32500,
"metadata": null,
"blockchainInfo": {
"transactionHash": null,
"origin": "17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ",
"destination": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY",
"destinationType": "CUSTODIAL",
"blockchain": "Bitcoin",
"isDestinationConfirmed": true,
"destinationWalletId": 7069
},
"vaspInfo": {
"originatorVaspName": "Example Originator VASP",
"originatorVaspEmail": "support@originator.example",
"beneficiaryVaspName": "SwiftExchange",
"beneficiaryVaspEmail": "support@beneficiary.example",
"beneficiaryVaspExtraInfo": null
},
"originator": {
"type": "NATURAL",
"name": "Marwin Hillar",
"accountNumber": "04143282398",
"address": "Alexanderplatz 25, Berlin",
"country": "DE"
},
"beneficiary": {
"type": "NATURAL",
"name": "Hanne Nikol",
"accountNumber": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY"
},
"travelRuleMessageSource": "CryptoSwift",
"riskScore": {
"originatorRiskScore": 18,
"originatorRiskSeverity": "low",
"beneficiaryRiskScore": 12,
"beneficiaryRiskSeverity": "low",
"sanctions": {
"originatorWallet": {
"isSanctioned": false,
"details": []
},
"beneficiaryWallet": {
"isSanctioned": false,
"details": []
}
}
},
"ruleEngine": {
"decision": "WAIT",
"ruleEngineId": "6292e827-ce05-4cae-a3c8-43e1fb073e1e",
"ruleId": "high-amount-wait",
"ruleName": "Wait for large transfers",
"conditions": {
"all": [
{
"field": "amount",
"operator": "GTE",
"value": 10000,
"currency": "USD"
}
],
"any": []
},
"ruleEngineVersion": 3,
"scope": "OUTGOING",
"waitForSeconds": 120,
"onTimeoutDecision": "REVIEW"
},
"warnings": []
}
decision | Your application's action |
|---|---|
PROCEED | Continue when all other checks required by your policy are satisfied. |
WAIT | Persist the waiting state and enforce the policy deadline in your backend. |
REVIEW | Route the case to your reviewer workflow. |
BLOCK | Stop the transfer or hold the deposit according to your policy. For an outgoing payment abandoned before broadcast, explicitly cancel the Travel Rule message. |
A Rule Engine decision is separate from the message status. PROCEED does not itself broadcast a payment, and CONFIRMED does not itself credit a customer's ledger. Your backend performs those actions.
The Travel Rule data model defines the decision fields, matched rule, scope, and policy version. Keep relevant IDs and the version with your decision record for audit.
Handle WAIT and timeouts
- When your application enters
WAIT, store its start time,waitForSeconds, andonTimeoutDecisiondurably. - Continue receiving webhooks or polling the latest transaction. Re-evaluate relevant updates before acting.
- At the deadline, reconcile the current transaction and apply the stored timeout action if the case is still waiting.
- Make transitions idempotent; duplicate notifications must not restart the timer or broadcast another payment.
CryptoSwift returns the waiting duration and timeout policy. It does not run your application's timer, execute a transfer, or automatically PATCH a transaction when your deadline passes. Apply one deliberate decision path when a notification and timeout arrive together.
Publish and test before using a policy
Draft edits do not change the active policy. Simulate the draft and publish it before expecting it to affect transaction responses. See policy management.
For operational ownership, review procedures, and example policies, see the Rule Engine compliance workflow.
Next steps
- Implement the pre-transaction flow
- Handle incoming reviews
- Manage policies through the API
- Inspect transaction audit events