What is FinWatch?
FinWatch is an embedded domain-specific language (DSL) for monitoring financial transactions in real-time. It helps businesses detect fraud, enforce compliance, automate reconciliation, and manage risk by evaluating transactions against custom rules. When you send a transaction to FinWatch, it evaluates the transaction against your rules and returns a verdict — whether to approve, review, block, or alert — along with a risk score and reasoning.Base URL
http://localhost:8081/inject.
Quick Start
This quick start guide will walk you through the three most common tasks: injecting a transaction, creating a monitoring rule, and retrieving transaction details.1. Inject a Transaction
The first step is to send a transaction to FinWatch for evaluation. This is how your application integrates with FinWatch — every transaction that needs monitoring should be sent to the/inject endpoint.
Here’s an example using curl (a command-line tool for making HTTP requests):
- We’re sending a POST request to the
/injectendpoint - The
Content-Type: application/jsonheader tells the server we’re sending JSON data - The request body contains the transaction details:
amount: The monetary value of the transactioncurrency: The currency code (e.g., USD, EUR)sourceanddestination: Identifiers for the accounts involvedreference: A unique identifier for this transactionmeta_data: Additional context about the transaction (merchant category, country, etc.)
2. Create a Monitoring Rule
Before FinWatch can evaluate transactions, you need to define rules. Rules are written in Watchscript, FinWatch’s domain-specific language. A rule defines conditions to check and actions to take when those conditions are met. Here’s how to create a rule using the API:rule HighValueTransaction— The name of the ruledescription— A human-readable explanation of what the rule doeswhen amount > 10000— The condition: if the transaction amount is greater than $10,000then review— The action: mark the transaction for manual reviewscore 0.5— A risk score from 0 to 1 (higher = more risky)reason— The explanation that will be shown to analysts
3. Retrieve a Transaction
After injecting a transaction, you might want to retrieve its details later — for example, to check the evaluation result or for audit purposes. Here’s how to fetch a transaction by its ID:txn_123 with the actual transaction ID you want to retrieve. The response will include all the transaction details, including the evaluation result (verdict, score, and reason).
Authentication
Currently, the FinWatch API does not require authentication. This is convenient for development and testing environments. However, for production use, future versions will support API key-based authentication to secure access to your FinWatch instance.Core Concepts
Understanding these core concepts will help you use the API effectively:Transactions
A transaction represents a financial operation that needs to be evaluated against monitoring rules. Think of it as any money movement — a payment, a transfer, a withdrawal, etc. Each transaction includes:- Amount and currency — The monetary value (e.g., $5,000 USD)
- Source and destination — Identifiers for the accounts or balances involved (e.g., balance IDs)
- Reference — A unique identifier for the transaction (useful for tracking and reconciliation)
- Metadata — Custom key-value pairs that provide context (e.g., merchant category, country, device ID)
- Status — The current state of the transaction (e.g., pending, applied, failed)
Instructions (Rules)
Instructions are the monitoring rules that define how transactions should be evaluated. They’re written in Watchscript, FinWatch’s domain-specific language designed specifically for transaction monitoring. A rule consists of:- When clause — The conditions to evaluate (e.g., “when amount > 10,000”)
- Then clause — The action to take when conditions are met (e.g., “review”, “block”, “alert”)
- Score — A risk score from 0 to 1 (0 = low risk, 1 = high risk)
- Reason — A human-readable explanation of why the action was taken
Git Integration
FinWatch integrates with Git for version-controlled rule management. This means you can:- Store your rules in a Git repository
- Track changes to rules over time
- Collaborate with your team using pull requests and code reviews
- Roll back to previous versions if needed
- Status — Check the current status of your Git repository (modified files, uncommitted changes)
- Pull — Sync changes from a remote repository
- Push — Commit and push your local changes to a remote repository
- Clone — Initialize a local repository from a remote one
API Endpoints
The FinWatch API is organized into three main categories:Response Codes
The FinWatch API uses standard HTTP status codes to indicate the result of your request:
Always check the status code of your response to ensure your request was successful. If you receive a 4xx or 5xx error, the response body will typically include more details about what went wrong.
Next Steps
Now that you understand the basics, dive deeper into the specific API endpoints:- Transaction APIs — Learn how to inject transactions, retrieve transaction details, and handle webhook events from Blnk
- Instruction Management APIs — Create, list, retrieve, and delete monitoring rules
- Git Repository APIs — Integrate with Git for version-controlled rule management
- Data Models — Understand the detailed structure of transactions, instructions, and other data objects
- Error Handling — Learn how to handle errors gracefully in your application
.png?fit=max&auto=format&n=0JF6z69u57hmqsWm&q=85&s=531373acedba0eb783b669f6d558dfd8)