{
  "name": "Screen new signups with Factline KYC (sanctions, PEP, email, phone, VAT)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "factline-kyc",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "a1f0c2d4-1111-4a2b-9c01-000000000001",
      "name": "New signup (webhook)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "webhookId": "factline-kyc"
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://factline.dev/v1/kyc/check",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "name", "value": "={{ $json.body.name }}" },
            { "name": "email", "value": "={{ $json.body.email }}" },
            { "name": "phone", "value": "={{ $json.body.phone }}" },
            { "name": "vat", "value": "={{ $json.body.vat }}" }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "x-api-key", "value": "fl_live_REPLACE_WITH_YOUR_KEY" }
          ]
        },
        "options": {}
      },
      "id": "a1f0c2d4-1111-4a2b-9c01-000000000002",
      "name": "Factline KYC check",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [260, 0]
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" },
          "conditions": [
            {
              "id": "c0ffee00-0000-4000-8000-000000000001",
              "leftValue": "={{ $json.verdict }}",
              "rightValue": "pass",
              "operator": { "type": "string", "operation": "equals" }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a1f0c2d4-1111-4a2b-9c01-000000000003",
      "name": "Passed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [520, 0]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { decision: 'approve', verdict: $json.verdict } }}",
        "options": {}
      },
      "id": "a1f0c2d4-1111-4a2b-9c01-000000000004",
      "name": "Approve",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [780, -100]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { decision: 'review', verdict: $json.verdict, flags: $json.flags, checks: $json.checks } }}",
        "options": {}
      },
      "id": "a1f0c2d4-1111-4a2b-9c01-000000000005",
      "name": "Send to manual review",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [780, 100]
    }
  ],
  "connections": {
    "New signup (webhook)": { "main": [[{ "node": "Factline KYC check", "type": "main", "index": 0 }]] },
    "Factline KYC check": { "main": [[{ "node": "Passed?", "type": "main", "index": 0 }]] },
    "Passed?": {
      "main": [
        [{ "node": "Approve", "type": "main", "index": 0 }],
        [{ "node": "Send to manual review", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": { "executionOrder": "v1" },
  "meta": { "templateCredsSetupCompleted": false }
}
