This workflow automates ChargeBee customer creation for billing and subscription management, ensuring PCI compliance. Key nodes include Webhook for secure data input, Condition for security validation, Function for input validation, ChargeBee for API interactions, Set for data sanitization and response formatting, and Webhook Response for structured outputs. To set up, download n8n from n8n.io for self-hosting or sign up at cloud.n8n.io. Obtain a ChargeBee API key from your ChargeBee account (Settings > API Keys) and add it under Credentials > Add Credential > ChargeBee API in n8n. Import the workflow JSON via Workflows > Import. Configure the Webhook node with path /chargebee-customer-creator, set to POST, and include CORS headers (Access-Control-Allow-Origin: *). Use ngrok for local webhook testing to expose the URL. Ensure HTTPS for secure transmission. Verify the ChargeBee node uses the correct API key, and the Function node validates email format. Set the content size limit to <5MB in the Condition node. Test by sending a POST request to the webhook with JSON containing email (e.g., 'user@example.com'), firstName, and optional customerId. Include x-api-key, x-chargebee-authorization, and x-pci-compliant headers. The workflow validates inputs, sanitizes data, and creates a customer via the ChargeBee API. Validate outputs in the Set node for devHubConnectChargebeeResponse (e.g., success: true, customer.id present). Handle errors like missing x-api-key (401 response with 'CHARGEBEE_SECURITY_VALIDATION_FAILED') or invalid email (400 response with 'CHARGEBEE_VALIDATION_FAILED'). For issues, confirm HTTPS, a valid API key, and a correct JSON format (e.g., {email: 'user@example.com', firstName: 'John'}). Deploy by saving and enabling the workflow, ensuring the webhook is active. Test with sample data (e.g., email 'test@example.com') to verify customer creation and status: 'active'. Check Webhook Response for success flag, customer details, and processing time. If outputs are missing, verify ChargeBee API credentials and node connections in n8n’s editor.
$5.49
Workflow steps: 13
Integrated apps: webhook, manualTrigger, if