[
 {
  "code": "SBM_BANK",
  "name": "SBM Bank Kenya",
  "api_endpoint": "https://python.helahub.co/extract",
  "extraction_config": {
    "document_type": "bank_statement",
    "identifier": "Account Statement|Printing Date",
    "customer_fields": {
      "account_name": "Account Name:\\s*([A-Z\\s]+)",
      "account_number": "Account Number:\\s*(\\d+)",
      "currency": "Currency:\\s*([A-Z]{3})",
      "telephone": "Telephone\\s+(\\d+)",
      "email": "Email Address:\\s*([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})",
      "opening_balance": "Opening Balance:\\s*([\\d,]+(?:\\.\\d{2})?)",
      "total_credits": "Total Credits:\\s*([\\d,]+(?:\\.\\d{2})?)",
      "total_debits": "Total Debits:\\s*([\\d,]+(?:\\.\\d{2})?)",
      "available_balance": "Available Balance:\\s*([\\d,]+(?:\\.\\d{2})?)",
      "statement_period": "(\\d{1,2}[A-Za-z]{3}\\d{4})\\s+to\\s+(\\d{1,2}[A-Za-z]{3}\\d{4})"
    },
    "table_extraction_settings": {
      "vertical_strategy": "text",
      "horizontal_strategy": "text",
      "explicit_vertical_lines": [],
      "explicit_horizontal_lines": [],
      "snap_tolerance": 3,
      "join_tolerance": 3,
      "edge_min_length": 3,
      "min_words_vertical": 3,
      "min_words_horizontal": 1,
      "intersection_tolerance": 3
    },
    "transaction_config": {
      "table_identifier": "Transaction Date",
      "identifier_type": "contains",
      "column_mapping": {
        "transaction_date": {
          "search_terms": ["transaction date", "date"],
          "type": "date"
        },
        "description": {
          "search_terms": ["transaction details", "details", "transaction"],
          "type": "string"
        },
        "reference": {
          "search_terms": ["ref number", "reference", "ref"],
          "type": "string"
        },
        "instrument_code": {
          "search_terms": ["instrument code", "instrument", "code"],
          "type": "string"
        },
        "value_date": {
          "search_terms": ["value date", "value"],
          "type": "date"
        },
        "debit": {
          "search_terms": ["debit"],
          "type": "numeric"
        },
        "credit": {
          "search_terms": ["credit"],
          "type": "numeric"
        },
        "balance": {
          "search_terms": ["balance"],
          "type": "numeric"
        }
      }
    }
  }
},
{
  "code": "EQUITY_BANK",
  "name": "Equity Bank Kenya",
  "api_endpoint": "https://python.helahub.co/extract",
  "extraction_config": {
    "document_type": "bank_statement",
    "identifier": "Account\\s+Statement|EQUITY",
    "customer_fields": {
      "customer_name": "^([A-Z][A-Z\\s]+?)(?=\\n254)",
      "phone_number": "(254\\d{9})",
      "email": "([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})",
      "account_number": "Account Number\\s+([0-9]+)",
      "currency": "Currency\\s+([A-Z]{3})",
      "account_branch": "Account Branch\\s+([0-9]+)",
      "statement_date": "Statement Date\\s+([0-9]{2}/[0-9]{2}/[0-9]{4})",
      "statement_period": "Statement\\s+Period\\s+([0-9]{2}/[0-9]{2}/[0-9]{4}\\s+-\\s+[0-9]{2}/[0-9]{2}/[0-9]{4})",
      "account_created": "Account Created\\s+([0-9]{2}/[0-9]{2}/[0-9]{4})"
    },
    "transaction_config": {
      "table_identifier": "S\\d{7,9}",
      "identifier_type": "regex",
      "column_mapping": {
        "transaction_details": {
          "search_terms": ["transaction", "details"],
          "type": "string"
        },
        "payment_reference": {
          "search_terms": ["payment", "reference"],
          "type": "string"
        },
        "value_date": {
          "search_terms": ["value", "date"],
          "type": "date"
        },
        "credit": {
          "search_terms": ["credit", "money in"],
          "type": "numeric"
        },
        "debit": {
          "search_terms": ["debit", "money out"],
          "type": "numeric"
        },
        "balance": {
          "search_terms": ["balance"],
          "type": "numeric"
        }
      },
      "filters": []
    },
    "summary_config": {
      "table_identifier": "Total",
      "identifier_type": "contains",
      "column_mapping": {
        "transaction_type": {
          "search_terms": ["transaction", "details", "total"],
          "type": "string"
        },
        "paid_in": {
          "search_terms": ["credit", "money in"],
          "type": "numeric"
        },
        "paid_out": {
          "search_terms": ["debit", "money out"],
          "type": "numeric"
        },
        "balance": {
          "search_terms": ["balance"],
          "type": "numeric"
        }
      },
      "fallback_enabled": true
    }
  }
},
  {
    "code": "KCB_BANK",
    "name": "Kenya Commercial Bank",
    "api_endpoint": "https://python.helahub.co/extract",
    "extraction_config": {
      "document_type": "bank_statement",
      "identifier": "KCB",
      "customer_fields": {
        "account_name": "Account Name:\\s*([A-Z\\s]+)",
        "account_number": "Account(?:\\s+No|\\s+Number)[.:]?\\s*(\\d+)",
        "currency": "Currency:\\s*([A-Z]{3})"
      },
      "transaction_config": {
        "table_identifier": "Date",
        "identifier_type": "contains",
        "column_mapping": {
          "transaction_date": {
            "search_terms": ["Trans Date", "Date", "Transaction Date"],
            "type": "date"
          },
          "description": {
            "search_terms": ["Description", "Particulars", "Details"],
            "type": "string"
          },
          "reference": {
            "search_terms": ["Reference", "Ref"],
            "type": "string"
          },
          "debit": {
            "search_terms": ["Debit", "Withdrawal", "Dr"],
            "type": "numeric"
          },
          "credit": {
            "search_terms": ["Credit", "Deposit", "Cr"],
            "type": "numeric"
          },
          "balance": {
            "search_terms": ["Balance", "Running Balance"],
            "type": "numeric"
          }
        }
      }
    }
  },
  {
    "code": "COOP_BANK",
    "name": "Co-operative Bank of Kenya",
    "api_endpoint": "https://python.helahub.co/extract",
    "extraction_config": {
      "document_type": "bank_statement",
      "identifier": "CO-OPERATIVE BANK",
      "customer_fields": {
        "account_name": "(?:Account Name|Name):\\s*([A-Z\\s]+)",
        "account_number": "Account(?:\\s+No|\\s+Number)[.:]?\\s*(\\d+)",
        "currency": "Currency:\\s*([A-Z]{3})"
      },
      "transaction_config": {
        "table_identifier": "Date",
        "identifier_type": "contains",
        "column_mapping": {
          "transaction_date": {
            "search_terms": ["Trans Date", "Date"],
            "type": "date"
          },
          "description": {
            "search_terms": ["Description", "Narration", "Details"],
            "type": "string"
          },
          "reference": {
            "search_terms": ["Reference", "Ref No"],
            "type": "string"
          },
          "debit": {
            "search_terms": ["Debit", "Withdrawals"],
            "type": "numeric"
          },
          "credit": {
            "search_terms": ["Credit", "Deposits"],
            "type": "numeric"
          },
          "balance": {
            "search_terms": ["Balance"],
            "type": "numeric"
          }
        }
      }
    }
  },
  {
  "code": "MPESA",
  "name": "M-Pesa Statement",
  "api_endpoint": "https://python.helahub.co/extract",
  "extraction_config": {
    "document_type": "mpesa_statement",
    "identifier": "MPESA FULL STATEMENT",
    "customer_fields": {
      "customer_name": "Customer Name:\\s*([A-Z\\s]+)",
      "phone_number": "Mobile Number:\\s*(\\d+)",
      "statement_date": "Date of Statement:\\s*([\\d\\w\\s]+)",
      "statement_period": "Statement Period:\\s*(\\d{1,2}(?:st|nd|rd|th)?\\s+\\w+\\s+\\d{4}\\s*-\\s*\\d{1,2}(?:st|nd|rd|th)?\\s+\\w+\\s+\\d{4})"
    },
    "summary_config": {
      "table_identifier": "TRANSACTION TYPE",
      "identifier_type": "contains",
      "column_mapping": {
        "transaction_type": {
          "search_terms": ["TRANSACTION TYPE"],
          "type": "string"
        },
        "paid_in": {
          "search_terms": ["PAID IN"],
          "type": "numeric"
        },
        "paid_out": {
          "search_terms": ["PAID OUT"],
          "type": "numeric"
        }
      },
      "fallback_enabled": true,
      "header_aliases": {
        "transaction_type": ["TRANSACTION TYPE"],
        "paid_in": ["PAID IN"],
        "paid_out": ["PAID OUT"],
        "total": ["TOTAL:", "TOTAL"]
      }
    },
    "transaction_config": {
      "table_identifier": "Receipt No",
      "identifier_type": "contains",
      "column_mapping": {
        "receipt_no": {
          "search_terms": ["Receipt No"],
          "type": "string"
        },
        "completion_time": {
          "search_terms": ["Completion Time"],
          "type": "date"
        },
        "details": {
          "search_terms": ["Details"],
          "type": "string"
        },
        "transaction_status": {
          "search_terms": ["Transaction Status"],
          "type": "string"
        },
        "paid_in": {
          "search_terms": ["Paid in"],
          "type": "numeric"
        },
        "withdraw": {
          "search_terms": ["Withdraw", "Withdrawn"],
          "type": "numeric"
        },
        "balance": {
          "search_terms": ["Balance"],
          "type": "numeric"
        }
      }
    }
  }
}
]