> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction monitoring quickstart: rules and webhooks

> Submit your first transaction, see rules fire, hook up webhooks — end-to-end in under 10 minutes. Pay-per-call $0.02 per transaction, no contracts.

Stand up Transaction Monitoring in under 10 minutes. You'll submit a test transaction, inspect its score, enable a preset rule, resubmit to see it fire, and confirm the webhook arrives.

## Prerequisites

* A Didit application with Transaction Monitoring enabled (*Settings → Transaction Monitoring → Enable*).
* An API key.
* A webhook endpoint reachable from the internet.

## Steps

<Steps>
  <Step title="Submit a baseline transaction">
    ```bash theme={null}
    curl -X POST https://verification.didit.me/v3/transactions/ \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "transaction_id": "baseline-0001",
        "transaction_category": "finance",
        "transaction_details": {
          "direction": "outbound",
          "amount": "500.00",
          "currency": "EUR"
        },
        "subject": { "entity_type": "person", "vendor_data": "user-42", "full_name": "Jane Doe" },
        "counterparty": { "entity_type": "company", "full_name": "Acme Supplier" }
      }'
    ```

    Response includes:

    * `status` — `APPROVED` if no rules fired, `IN_REVIEW` / `DECLINED` if any did.
    * `score` — integer 0–100+.
    * `rule_runs` — array of every rule that evaluated this transaction.
  </Step>

  <Step title="Enable a preset rule">
    Navigate to *Transactions → Rules → Library* in the Business Console. Pick a preset, for example **Structuring (outbound)**: triggers when the same user sends 20+ outbound transfers under €10,000 within 30 days. Enable it and save.
  </Step>

  <Step title="Submit transactions that trigger the rule">
    Submit 20 transactions quickly for the same user, each under €10,000:

    ```bash theme={null}
    for i in $(seq 1 20); do
      curl -X POST https://verification.didit.me/v3/transactions/ \
        -H "x-api-key: YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -d "{
          \"transaction_id\": \"struct-$i\",
          \"transaction_category\": \"finance\",
          \"transaction_details\": {
            \"direction\": \"outbound\",
            \"amount\": \"9500.00\",
            \"currency\": \"EUR\"
          },
          \"subject\": { \"entity_type\": \"person\", \"vendor_data\": \"user-42\", \"full_name\": \"Jane Doe\" },
          \"counterparty\": { \"entity_type\": \"company\", \"full_name\": \"Shell Co $i\" }
        }"
    done
    ```

    By the 20th submission, the Structuring rule fires. The transaction returns `status: IN_REVIEW` and `score` reflects the rule's `score_delta`.
  </Step>

  <Step title="Subscribe to transaction webhooks">
    ```bash theme={null}
    curl -X POST https://verification.didit.me/v3/webhook/destinations/ \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "label": "TM events",
        "url": "https://yourapp.com/webhooks/didit-tm",
        "subscribed_events": ["transaction.created", "transaction.status.updated"]
      }'
    ```

    The response includes `secret_shared_key` — save it immediately as `DIDIT_WEBHOOK_SECRET` in your `.env`:

    ```bash theme={null}
    DIDIT_WEBHOOK_SECRET=whsec_...   # signing secret returned from webhook registration
    ```

    Then verify the `X-Signature-V2` HMAC on every incoming webhook before trusting it (recompute HMAC-SHA256 over the canonicalised body, constant-time compare, reject stale timestamps). See [TM webhooks](/transaction-monitoring/webhooks) for the payloads and the full verification code.

    Every subsequent transaction posts to your endpoint in real time.
  </Step>

  <Step title="Inspect in the console">
    Navigate to *Transactions* in the console:

    * List view: recent transactions, filters, bulk actions.
    * Transaction detail: rule runs, IP enrichment, party details, network graph (for crypto), linked alerts and cases.
  </Step>

  <Step title="Retrieve a transaction via API">
    ```bash theme={null}
    curl https://verification.didit.me/v3/transactions/{transaction_id}/ \
      -H "x-api-key: YOUR_API_KEY"
    ```

    Returns the full [response schema](/transaction-monitoring/response-schema) — score, matched rules, party enrichment, AML screening, and more.
  </Step>
</Steps>

## What you just set up

* **Real-time scoring** — every transaction runs through every active rule.
* **AML screening** — counterparties are screened against sanctions / PEP / adverse media automatically.
* **IP enrichment** — every transaction is enriched with IP country, ASN, VPN/Tor flags.
* **Webhooks** — real-time notification on every transaction.
* **Audit trail** — rule runs, alerts, and status transitions are all queryable in the console.

## Common next moves

<CardGroup cols={3}>
  <Card title="Integration guide" icon="book" href="/transaction-monitoring/integration-guide">
    Full architecture and patterns.
  </Card>

  <Card title="Rules deep dive" icon="scale-balanced" href="/transaction-monitoring/rules">
    How rules work, conditions, aggregations, actions.
  </Card>

  <Card title="Risk scoring" icon="gauge" href="/transaction-monitoring/risk-scoring">
    How scores combine into statuses.
  </Card>

  <Card title="Transactions payload" icon="arrow-right-to-bracket" href="/transaction-monitoring/transactions">
    The full transaction submission schema.
  </Card>

  <Card title="Statuses" icon="list-check" href="/transaction-monitoring/statuses">
    Transaction, alert, and case states.
  </Card>

  <Card title="Cases" icon="folder-open" href="/transaction-monitoring/cases">
    Investigate and resolve.
  </Card>
</CardGroup>
