bizappay

Package Information

Released: 7/5/2025
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.9
Author: nmhafiz

Documentation

n8n-nodes-bizappay

npm version
License: MIT
Node.js CI
Coverage Status

Professional n8n community node for integrating with Bizappay API - Malaysia's leading digital payment platform. This node provides comprehensive support for bill management, payment processing, and webhook handling with enterprise-grade features.

🚀 Get Started with Bizappay

Ready to start using Bizappay? Sign up here and support the development of this n8n node!

By using this affiliate link, you're supporting the continued development of this n8n node.

Features

Core Features

  • Authentication: Secure API key authentication with environment support
  • Environment Support: Switch between Sandbox and Production environments
  • Category Operations: Create and retrieve categories for bill organization
  • Payment Banks: Retrieve available payment bank information
  • Payment Status: Check payment status for bills
  • Webhook Support: Enhanced webhook signature verification and payload processing

Advanced Features

  • Bulk Operations: Create multiple bills simultaneously with batch processing
  • Advanced Search: Search bills with multiple filters (status, amount range, date range, etc.)
  • Template System: Create bills from predefined templates (Invoice, Subscription, Service, etc.)
  • API Monitoring: Track API performance metrics and success rates
  • Enhanced Rate Limiting: Sliding window rate limiting with burst protection
  • Smart Token Management: Automatic token caching, refresh, and cleanup
  • Retry Logic: Intelligent retry with exponential backoff
  • Comprehensive Validation: Input validation for all data types including Malaysian phone numbers
  • Error Handling: Detailed error messages with proper error categorization
  • TypeScript Support: Full TypeScript support with comprehensive type definitions

Performance & Reliability

  • Caching: Token and configuration caching for improved performance
  • Rate Limiting: Sliding window algorithm with configurable limits
  • Monitoring: Built-in API metrics and performance tracking
  • Resilience: Automatic retry logic with intelligent backoff strategies

Installation

Follow the installation guide in the n8n community nodes documentation.

Available Operations

Authentication

  • Test Connection: Verify API credentials and connection

Category

  • Create: Create a new category
  • Get All: Retrieve all categories

Payment Bank

  • Get All: Retrieve all available payment banks

Bill Operations

  • Create: Create a new bill with comprehensive validation
  • Get: Retrieve a specific bill by ID
  • Get All: Retrieve all bills with optional filters
  • Search: Advanced search with multiple filters (status, amount range, date range, payer email, text search)
  • Update: Update an existing bill with field validation
  • Delete: Delete a bill with ID validation
  • Bulk Create: Create multiple bills simultaneously with batch processing
  • Create from Template: Create bills using predefined templates

Webhook Operations

  • Verify Signature: Enhanced webhook signature verification with timing-safe comparison
  • Process Payload: Process incoming webhook data with detailed parsing

Monitoring

  • Get Metrics: Retrieve API performance metrics and statistics
  • Reset Metrics: Reset API performance counters

Templates Available

  • Invoice Template: Professional invoice with payment terms
  • Subscription Template: Monthly subscription billing
  • Service Fee Template: Professional service consultation
  • Product Sale Template: Product purchase with delivery
  • Event Ticket Template: Event registration and ticketing

Credentials

To use this node, you need to configure the Bizappay API credentials:

  1. API Key: Your Bizappay API key (get it from Settings > Profile page in your Bizappay dashboard)
  2. Environment: Choose between Production and Sandbox
    • Production: https://bizappay.my
    • Sandbox: https://stg.bizappay.my (for testing)

API Reference

This node is based on the Bizappay API v3 documentation.

Available Endpoints

Authentication

  • POST /api/v3/token - Generate authentication token

Category Management

  • POST /api/v3/category/create - Create new category
  • POST /api/v3/category - List all categories

Payment Banks

  • POST /api/v3/payment-bank-list - Get all available banks

Bill Management

  • POST /api/v3/bill/create - Create new bill
  • POST /api/v3/bill/{id} - Get bill details
  • POST /api/v3/bill/list - List all bills
  • POST /api/v3/bill/update/{id} - Update bill
  • POST /api/v3/bill/delete/{id} - Delete bill

Usage Examples

Authentication

Generate Authentication Token

{
  "resource": "authentication",
  "operation": "generateToken"
}

Category Management

Create a Bill Category

{
  "resource": "category",
  "operation": "create",
  "name": "Utilities",
  "description": "Utility bills and services"
}

Payment Banks

Get All Payment Banks

{
  "resource": "paymentBank",
  "operation": "getAll"
}

Get Bank by Code

{
  "resource": "paymentBank",
  "operation": "getByCode",
  "bankCode": "BCBB0235"
}

Bill Management

Create a Bill

{
  "name": "Monthly Subscription",
  "amount": 99.99,
  "category": "SUBSCRIPTION",
  "payer_name": "John Doe",
  "payer_email": "[email protected]",
  "payer_phone": "0123456789",
  "description": "Monthly subscription fee",
  "due_date": "2024-01-31 23:59:59"
}

Bulk Creating Bills

{
  "billsData": [
    {
      "name": "Invoice #001",
      "amount": 150.00,
      "category": "INVOICE",
      "payer_name": "Alice Smith",
      "payer_email": "[email protected]",
      "description": "Consulting services"
    },
    {
      "name": "Invoice #002",
      "amount": 200.00,
      "category": "INVOICE",
      "payer_name": "Bob Johnson",
      "payer_email": "[email protected]",
      "description": "Design services"
    }
  ],
  "batchSize": 5
}

Creating from Template

{
  "template": "invoice",
  "templateVariables": {
    "customerName": "John Doe",
    "customerEmail": "[email protected]",
    "customerPhone": "0123456789",
    "amount": 299.99,
    "reference": "INV-2024-001",
    "dueDate": "2024-02-15T00:00:00Z",
    "customDescription": "Additional project requirements included"
  }
}

Advanced Search

{
  "searchFilters": {
    "status": "pending",
    "amountRange": {
      "range": {
        "min": 100,
        "max": 500
      }
    },
    "dateRange": {
      "range": {
        "start": "2024-01-01T00:00:00Z",
        "end": "2024-01-31T23:59:59Z"
      }
    },
    "searchText": "invoice"
  }
}

Get Bill by ID

{
  "resource": "bill",
  "operation": "get",
  "billId": "BILL123456"
}

Get All Bills with Filtering

{
  "resource": "bill",
  "operation": "getAll",
  "page": 1,
  "limit": 10,
  "status": "pending",
  "category": "UTIL001"
}

Update Bill

{
  "resource": "bill",
  "operation": "update",
  "billId": "BILL123456",
  "billName": "Updated Monthly Subscription",
  "amount": 109.90,
  "description": "Updated monthly subscription fee"
}

Delete Bill

{
  "resource": "bill",
  "operation": "delete",
  "billId": "BILL123456"
}

Payment Status

Check Payment Status

{
  "resource": "paymentStatus",
  "operation": "getStatus",
  "billId": "BILL123456"
}

Webhook Operations

Verify Webhook Signature

{
  "resource": "webhook",
  "operation": "verifySignature",
  "webhookPayload": "{\"event_type\":\"payment.completed\",\"bill_id\":\"BILL123456\"}",
  "webhookSignature": "sha256=abc123...",
  "webhookSecret": "your-webhook-secret"
}

Process Webhook Payload

{
  "resource": "webhook",
  "operation": "processPayload",
  "webhookPayload": "{\"event_type\":\"payment.completed\",\"bill_id\":\"BILL123456\",\"status\":\"paid\"}"
}

Monitoring

Get API Metrics

{
  "resource": "monitoring",
  "operation": "getMetrics"
}

Response Example:

{
  "totalRequests": 150,
  "successfulRequests": 145,
  "failedRequests": 5,
  "successRate": "96.7%",
  "averageResponseTime": "245ms",
  "endpoints": {
    "bill_create": {
      "count": 50,
      "success": 48,
      "avgResponseTime": "320ms"
    },
    "bill_list": {
      "count": 75,
      "success": 75,
      "avgResponseTime": "180ms"
    }
  },
  "lastReset": "2024-01-15T10:30:00Z"
}

Advanced Features

Rate Limiting

The node implements intelligent rate limiting to respect Bizappay API limits:

  • Sliding Window Algorithm: More accurate rate limiting than simple counters
  • Configurable Limits: Customize requests per minute and burst limits
  • Automatic Throttling: Requests are automatically delayed when limits are approached
  • Burst Protection: Prevents sudden spikes from overwhelming the API
  • Request Queuing: Queues requests during high-traffic periods

Token Management

  • Automatic Generation: Tokens are generated automatically when needed
  • Intelligent Caching: Tokens are cached with proper TTL management
  • Automatic Refresh: Expired tokens are refreshed transparently
  • Memory Efficient: Optimized token storage with cleanup routines
  • Thread Safe: Concurrent request handling with proper synchronization

Error Handling & Resilience

  • Comprehensive Categorization: Errors are properly categorized by type
  • Intelligent Retry Logic: Exponential backoff with jitter for failed requests
  • Circuit Breaker Pattern: Prevents cascading failures
  • Detailed Error Messages: Clear, actionable error descriptions
  • HTTP Status Mapping: Proper handling of all HTTP response codes
  • Timeout Management: Configurable timeouts for different operations

Data Validation & Security

  • Input Sanitization: All inputs are sanitized to prevent injection attacks
  • Email Validation: RFC-compliant email format validation
  • Phone Number Validation: Malaysian phone number format validation
  • Bank Code Validation: Validates against known Malaysian bank codes
  • Amount Validation: Ensures positive numbers with proper decimal precision
  • Required Field Validation: Comprehensive validation of mandatory fields
  • Webhook Security: Timing-safe signature verification to prevent timing attacks

Performance Optimization

  • Connection Pooling: Reuses HTTP connections for better performance
  • Response Caching: Caches frequently accessed data
  • Batch Processing: Efficient bulk operations with configurable batch sizes
  • Memory Management: Automatic cleanup of cached data and metrics
  • Compression: Supports response compression for faster data transfer

Configuration

Environment Variables

You can configure the node behavior using these optional environment variables:

# Rate Limiting
BIZAPPAY_RATE_LIMIT_RPM=60          # Requests per minute (default: 60)
BIZAPPAY_RATE_LIMIT_BURST=10        # Burst limit (default: 10)

# Timeouts
BIZAPPAY_TIMEOUT_MS=30000           # Request timeout in milliseconds (default: 30000)
BIZAPPAY_RETRY_MAX=3                # Maximum retry attempts (default: 3)

# Caching
BIZAPPAY_TOKEN_TTL=3600             # Token cache TTL in seconds (default: 3600)
BIZAPPAY_CACHE_MAX_SIZE=1000        # Maximum cache entries (default: 1000)

Best Practices

For Production Use

  1. Use Production Environment: Always set environment to "Production" for live transactions
  2. Implement Webhook Verification: Always verify webhook signatures for security
  3. Monitor API Metrics: Regularly check API performance using the monitoring operations
  4. Handle Rate Limits: Implement proper error handling for rate limit responses
  5. Secure Credentials: Store API keys securely and rotate them regularly

For Development

  1. Use Sandbox Environment: Test all operations in sandbox before production
  2. Test Webhook Endpoints: Verify webhook handling with test payloads
  3. Validate Templates: Test all template variations before deployment
  4. Monitor Performance: Use metrics to optimize batch sizes and timing

Bulk Operations

  1. Optimal Batch Size: Use batch sizes between 5-10 for best performance
  2. Error Handling: Always check individual results in bulk operations
  3. Rate Limiting: Allow extra time for bulk operations to complete
  4. Data Validation: Validate all data before starting bulk operations

Template Usage

  1. Customize Templates: Modify templates to match your business needs
  2. Validate Variables: Ensure all required template variables are provided
  3. Test Templates: Test template generation with various input combinations
  4. Version Control: Keep track of template changes for consistency

Error Handling

The node provides comprehensive error handling with detailed error messages:

Error Categories

  • API Errors: Detailed error messages from Bizappay API with proper HTTP status codes
  • Validation Errors: Clear validation error descriptions with field-specific messages
  • Network Errors: Proper handling of network timeouts, connection issues, and DNS failures
  • Authentication Errors: Clear messages for invalid credentials, expired tokens, and permission issues
  • Rate Limit Errors: Informative messages when rate limits are exceeded with retry suggestions
  • Template Errors: Specific errors for template validation and variable substitution
  • Bulk Operation Errors: Individual error tracking for batch operations

Error Response Format

{
  "error": {
    "type": "ValidationError",
    "message": "Invalid email format",
    "field": "payer_email",
    "code": "INVALID_EMAIL",
    "details": {
      "provided": "invalid-email",
      "expected": "Valid email format (e.g., [email protected])"
    }
  },
  "timestamp": "2024-01-15T10:30:00Z",
  "requestId": "req_123456789"
}

API Rate Limits

Bizappay API has rate limits. The node handles these automatically:

  • Rate Limit: 100 requests per minute per API key
  • Retry Logic: Automatic retry with exponential backoff
  • Error Messages: Clear indication when rate limits are exceeded
  • Reset Time: Provides exact time when limits reset
  • Proactive Checking: Prevents requests when limits are reached

Errors are returned in a structured format with descriptive messages.

Testing

Sandbox Environment

Use the sandbox environment for testing:

  1. Set environment to sandbox in credentials
  2. Use test API key from Bizappay dashboard
  3. Test all operations without real transactions
  4. Sandbox data is reset periodically

Testing Checklist

  • Authentication token generation
  • Category operations (Create, Get All)
  • Bill CRUD operations with all fields
  • Payment bank retrieval
  • Payment status checking
  • Webhook signature verification
  • Error handling scenarios
  • Rate limiting behavior

Sample Test Data

{
  "testCategory": {
    "name": "Test Category",
    "description": "Test category for development"
  },
  "testBill": {
    "billName": "Test Bill",
    "amount": 10.00,
    "categoryCode": "TEST001",
    "payerName": "Test User",
    "payerEmail": "[email protected]",
    "payerPhone": "0123456789"
  }
}

Troubleshooting

Common Issues

Authentication Issues

Problem: "Invalid API key" or "Authentication failed"
Solution:

  1. Verify your API key is correct
  2. Ensure you're using the right environment (Sandbox vs Production)
  3. Check if your API key has the required permissions
  4. Try regenerating your API key from Bizappay dashboard

Rate Limiting

Problem: "Rate limit exceeded" errors
Solution:

  1. Reduce the frequency of API calls
  2. Implement proper delays between requests
  3. Use bulk operations for multiple items
  4. Monitor your API usage with the metrics endpoint

Webhook Verification Failures

Problem: Webhook signature verification fails
Solution:

  1. Ensure webhook secret matches exactly
  2. Check that payload is not modified in transit
  3. Verify timestamp is within acceptable range
  4. Use raw payload for signature verification

Template Issues

Problem: Template creation fails or produces unexpected results
Solution:

  1. Validate all required template variables are provided
  2. Check variable formats (email, phone, dates)
  3. Ensure template type exists
  4. Test with minimal variable set first

Bulk Operation Failures

Problem: Some items in bulk operations fail
Solution:

  1. Check individual error messages in the response
  2. Validate all data before starting bulk operation
  3. Reduce batch size if experiencing timeouts
  4. Implement retry logic for failed items

Performance Optimization

Slow Response Times

  1. Use Bulk Operations: For multiple items, use bulk create instead of individual calls
  2. Optimize Batch Sizes: Test different batch sizes (5-10 typically optimal)
  3. Cache Results: Cache frequently accessed data like categories and bank lists
  4. Monitor Metrics: Use the monitoring endpoint to identify bottlenecks

Memory Usage

  1. Clear Metrics Regularly: Reset metrics periodically to prevent memory buildup
  2. Limit Cache Size: Configure appropriate cache limits for your environment
  3. Monitor Token Cache: Ensure token cleanup is working properly

Debug Mode

Enable debug logging in n8n:

# Set environment variable
N8N_LOG_LEVEL=debug

# Or in n8n settings
Settings > Log Level > Debug

API Response Times

  • Authentication: ~200ms
  • Category Operations: ~150ms
  • Bill Operations: ~300ms
  • Payment Status: ~100ms
  • Webhook Processing: ~50ms

Migration Guide

From v1.x to v2.x

  1. Update Credentials: Add environment field
  2. Update Operations: Some operation names have changed
  3. Check Webhooks: Webhook handling is now more secure
  4. Review Validation: Input validation is now stricter

Breaking Changes

  • uri parameter renamed to url in requests
  • IRequestOptions replaced with IHttpRequestOptions
  • Enhanced error response format
  • Stricter input validation

Development

Prerequisites

  • Node.js 16.x or higher
  • npm or yarn
  • n8n installed

Setup

# Clone the repository
git clone <repository-url>
cd n8n-nodes-bizappay

# Install dependencies
npm install

# Build the node
npm run build

# Link for local development
npm link

Building

# Build TypeScript and copy icons
npm run build

# Watch for changes during development
npm run dev

Linting

# Check for linting errors
npm run lint

# Fix linting errors automatically
npm run lintfix

API Authentication Flow

The Bizappay API uses a two-step authentication process:

  1. Token Generation: First, generate a token using your API key
  2. Authenticated Requests: Use the token in the Authentication header for subsequent requests

This node handles this flow automatically:

  • For each API call (except token generation), it first obtains a fresh token
  • The token is then used for the actual API request
  • All requests use application/x-www-form-urlencoded content type

Supported Banks

The Payment Bank endpoint returns information about Malaysian banks including:

  • Affin Bank
  • Alliance Bank
  • AmBank
  • Bank Islam
  • Bank Muamalat
  • Bank Rakyat
  • BSN
  • CIMB Clicks
  • Hong Leong Bank
  • HSBC
  • KFH
  • Maybank2U
  • OCBC Bank
  • Public Bank
  • RHB Bank
  • Standard Chartered
  • UOB

Each bank entry includes:

  • Bank code
  • Bank name
  • Status (online/offline)

API Reference

For detailed API documentation, refer to:

Contributing

We welcome contributions! Please follow these guidelines:

Development Setup

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/nmhafiz/n8n-nodes-bizappay.git
  3. Install dependencies: npm install
  4. Create a feature branch: git checkout -b feature/your-feature-name
  5. Make your changes and add tests
  6. Run tests: npm test
  7. Build the project: npm run build
  8. Submit a pull request

Code Standards

  • Follow TypeScript best practices
  • Add comprehensive error handling
  • Include input validation
  • Write unit tests for new features
  • Update documentation for API changes
  • Follow existing code style and patterns

Testing

  • Test all operations in both sandbox and production environments
  • Verify webhook handling with real payloads
  • Test bulk operations with various data sets
  • Validate template generation with different variables
  • Check error handling for edge cases

License

MIT License - see LICENSE file for details.

Developer & Support

About the Developer

Developer: nmhafiz
GitHub: @nmhafiz
Website: Sahabat Xpert

Affiliate Program

Support the development of this node by signing up for Bizappay through our affiliate link:
Get Bizappay

By using this affiliate link, you're supporting the continued development and maintenance of this n8n node.

For more details, see AFFILIATE.md

Support

Getting Help

  • GitHub Issues: For bug reports and feature requests
  • Documentation: Check this README and inline code comments
  • API Documentation: Refer to Bizappay's official API docs
  • Community: Join n8n community discussions
  • Developer Website: Sahabat Xpert

Reporting Issues

When reporting issues, please include:

  1. Node version and n8n version
  2. Environment (Sandbox/Production)
  3. Complete error message
  4. Steps to reproduce
  5. Expected vs actual behavior
  6. Sample data (with sensitive information removed)

License

MIT License - see LICENSE file for details.

Changelog

v0.2.0 (Latest)

  • New Features:
    • Bulk bill creation with batch processing
    • Advanced search with multiple filters
    • Template system with 5 predefined templates
    • API monitoring and metrics tracking
    • Enhanced webhook signature verification
  • Improvements:
    • Sliding window rate limiting
    • Better error handling and validation
    • Performance optimizations
    • Comprehensive TypeScript support
    • Enhanced security measures
  • Bug Fixes:
    • Fixed token refresh issues
    • Improved memory management
    • Better handling of edge cases

v0.1.0

  • Initial release
  • Basic operations for categories and bills
  • Payment bank information retrieval
  • Webhook support
  • Rate limiting and token caching
  • Comprehensive error handling and validation

Discussion