ERPNext Integration

Welcome to theย ERPNext Integration for WooCommerce!ย This powerful tool connects your WooCommerce store with ERPNext, enabling seamless synchronization of products, customers, and orders. This page guides you through the initial setup and installation process.

Overview

Integrating WooCommerce with ERPNext streamlines your e-commerce operations by:

  • Syncing inventory to prevent overselling.
  • Centralizing customer data for consistent management.
  • Automating order processing to reduce manual work.

Prerequisites

โ†‘ Back to top

Before installing, ensure your environment meets these requirements:

  • WordPress: Version 5.0 or higher.
  • WooCommerce: Version 5.0 or higher (compatible with High-Performance Order Storage, HPOS).
  • PHP: Version 7.4 or higher (tested up to PHP 8.3).
  • ERPNext: An active instance with API access enabled (refer to ERPNext documentation for setup).
  • SSL Certificate: Recommended for secure API communication.
  • Server Resources: Adequate memory (at least 256MB PHP memory limit) and database connectivity.

Note: Ensure your ERPNext instance is accessible via a public or private URL and that API keys are generated.

Installation

โ†‘ Back to top

To start using a product from WooCommerce.com, you can use the โ€œAdd to storeโ€ functionality on the order confirmation page or the My subscriptions section in your account.

  1. Navigate to My subscriptions.
  2. Find the Add to store button next to the product youโ€™re planning to install.
  3. Follow the instructions on the screen, and the product will be automatically added to your store.

Alternative options and more information at:
Managing WooCommerce.com subscriptions.

Adding a WooCommerce.com subscription to your store

Post-Installation Checklist

  • Confirm Activation: Check that the plugin appears in the WordPress Admin menu.
  • WooCommerce Compatibility: Verify no compatibility warnings appear in the plugin dashboard.
  • Permissions: Ensure the WordPress user has administrative privileges for plugin configuration.
  • Backup: Create a full backup of your WordPress site and ERPNext instance before proceeding.

Connecting to ERPNext

โ†‘ Back to top

Establish a secure connection between your WooCommerce store and ERPNext instance to enable data synchronization. This section explains how to configure and validate the API connection.

API Configuration

  1. Navigate to API Settings:
    • In WordPress Admin, go toย ERPNext Integrationย โ†’ย API Settings.
  2. Enter ERPNext Details:
    • Host URL: Enter the full URL of your ERPNext instance (e.g., https://erp.example.com).
    • API Key: Obtain from ERPNext under User Settings โ†’ API Access.
      • Steps in ERPNext:
        1. Log in to ERPNext as an admin.
        2. Go to User โ†’ [Your User] โ†’ API Access.
        3. Generate and copy the API Key.
    • API Secret: Copy the API Secret from the same ERPNext API Access page.
    • SSL Verification: Enable for secure connections (recommended). Disable only for testing if SSL issues occur.
    • Debug Mode: Enable to log detailed API interactions for troubleshooting.
    • Log Level: Select from Error, Warning, Info, or Debug to control log verbosity.
  3. Test Connection:
    • Clickย Test Connectionย to verify credentials.
    • A green checkmark indicates success; a red error message indicates issues.

Connection Validation

  • Automatic Validation: The plugin checks credentials upon saving settings.
  • Dashboard Indicator: View connection status on the ERPNext Integration dashboard.
    • Green: Connected.
    • Red: Connection failedโ€”check logs for details.
  • Log Review: Access logs in ERPNext Integration โ†’ Logs to diagnose issues.
    • Example Error: Invalid API Key suggests incorrect credentials.

Best Practices

  • Secure Credentials: Store API Key and Secret securely; avoid sharing them publicly.
  • SSL: Use HTTPS for the ERPNext URL to ensure data security.
  • Firewall: Whitelist your WordPress serverโ€™s IP in ERPNext if restricted.
  • Test Regularly: Periodically test the connection after ERPNext updates.

General Configuration

โ†‘ Back to top

Set up foundational settings to ensure smooth synchronization between WooCommerce and ERPNext. This page covers configuring company, account, order, tax, and shipping settings.

Company and Account Settings

  1. Navigate to Configurations:
    • Go to WordPressย Adminย โ†’ย ERPNext Integrationย โ†’ย Configurations.
  2. Configure Settings:
SettingDescriptionExample
CompanyDefault ERPNext company.MyStore Inc.
Default WarehousePrimary warehouse for inventory.Main Warehouse
Price ListPrice list for product pricing.Retail Price List
CurrencyCurrency for transactions.USD
Debtors AccountAccount for customer receivables.Accounts Receivable
Income AccountAccount for sales revenue.Sales Income
Cost CenterCost center for financial tracking.Main Cost Center
Tax TemplateDefault tax template for orders.Standard Tax

Tip: Ensure the selected company exists in ERPNext and has associated warehouses.

Order Settings

Configure how orders are created and processed in ERPNext:

  • Order Naming Series: Select a naming series (e.g., SO-YYYY-####).
    • Example: SO-2025-0001 for sequential order IDs.
  • Default Customer: Set a fallback customer for guest orders (e.g., Guest Customer).
  • Add Shipping as Item: Enable to include shipping as a line item in ERPNext.
  • Item Code Prefix: Add a prefix to item codes (e.g., WC- for WooCommerce products).
  • Item Group: Select a default group (e.g., E-commerce Products).
  • Default UOM: Set unit of measure (e.g., Unit or Piece).
  • Default HSN Code: Specify tax code for compliance (e.g., 12345678).

Tax and Shipping Settings

  • Sales Tax Account: Choose the account for tax liabilities (e.g., Sales Tax Payable).
  • Tax Template: Select a default tax template (e.g., GST 5%).
  • Shipping Account: Set the account for shipping charges (e.g., Shipping Income).
  • Shipping Rule: Define a default rule (e.g., Flat Rate Shipping).

Product Synchronization

โ†‘ Back to top

Synchronize product data betweenย WooCommerceย andย ERPNextย to maintain accurate inventory and product details. This page details the setup process.

Product Sync Settings

  1. Navigate to Products:
    • Go to WordPressย Adminย โ†’ย ERPNext Integrationย โ†’ย Products.
  2. Enable Product Sync:
    • Toggle theย Product Syncย switch to ON.
  3. Configure Sync Settings:
    • Sync Interval: Set frequency (e.g., every 15 minutes, 30 minutes, or hourly).
    • Sync Direction:
      • ERPNext to WooCommerce: Import products to WooCommerce.
      • Bidirectional: Sync changes both ways.
    • Auto Create Products: Automatically create WooCommerce products from ERPNext.
  4. Update Existing Products: Update WooCommerce products with ERPNext changes.

Inventory Settings

  • Enable Inventory Sync: Toggle to ON.
  • Inventory Sync Interval: Set frequency (e.g., every 30 minutes).
  • Low Stock Threshold: Set a threshold for notifications (e.g., 10 units).
  • Warehouse Mapping: Map WooCommerce locations to ERPNext warehouses.
    • Example: Map Online Store to Main Warehouse.
  • Stock Status Mapping:
    • Map WooCommerce statuses (e.g., In Stock, Out of Stock) to ERPNext.

Attributes and Categories

  • Sync Attributes:
    • Enable to sync ERPNext item attributes to WooCommerce.
    • Map attributes (e.g., ERPNext Color to WooCommerce Color).
  • Sync Categories:
    • Enable to sync ERPNext item groups to WooCommerce categories.
    • Map groups (e.g., ERPNext Electronics to WooCommerce Gadgets).

Manual Sync

  • Monitor Progress: View sync progress and logs inย ERPNext Integrationย โ†’ย Logs
  • Sync All Products: Click to import all ERPNext products to WooCommerce.
  • Sync Inventory Now: Trigger immediate inventory updates.

Customer Synchronization

โ†‘ Back to top

Keep customer data consistent acrossย WooCommerceย andย ERPNext. This page explains how to configure customer synchronization.

Customer Sync Settings

  1. Navigate to Order Sync:
    • Go to WordPressย Adminย โ†’ย ERPNext Integrationย โ†’ย Order Sync.
  2. Enable Customer Sync:
    • Toggle theย Customer Syncย switch to ON.
  3. Configure Settings:
    • Customer Group: Select a default group (e.g., Online Customers).
    • Territory: Set a default territory (e.g., United States).
    • Auto Create Customers: Create ERPNext customers from WooCommerce orders.

Data Mapping

  • Field Mapping:
    • Map WooCommerce fields (e.g., First Name) to ERPNext fields (e.g., first_name).
    • Example: Map billing_email to email_id.
  • Address Mapping:
    • Map billing and shipping fields (e.g., billing_address_1 to address_line1).
  • Customer Metadata: Map custom fields if used (e.g., WooCommerce loyalty_points to ERPNext custom field).

Manual Sync

  • Sync Previous Customers: Batch sync existing WooCommerce customers to ERPNext.
  • Monitor Sync: Check ERPNext Integration โ†’ Logs for status and errors.

Order Synchronization

โ†‘ Back to top

Automate order processing by syncingย WooCommerceย orders toย ERPNext. This page covers order sync setup and options.

Order Sync Settings

  1. Navigate to Order Sync:
    • Go to WordPressย Adminย โ†’ย ERPNext Integrationย โ†’ย Order Sync.
  2. Enable Order Sync:
    • Toggle theย Order Syncย switch to ON.
  3. Configure Settings:
    • Order Status Mapping: Map WooCommerce statuses (e.g., Processing) to ERPNext (e.g., Draft).
    • Auto Submit Orders: Submit orders in ERPNext automatically.
    • Create Sales Invoices: Generate invoices for completed orders.
    • Create Delivery Notes: Create delivery notes in ERPNext.
    • Payment Integration: Map payment methods (e.g., WooCommerce PayPal to ERPNext PayPal).

Order Processing Options

  • Sync Previous Orders: Batch sync existing WooCommerce orders.
  • Individual Order Sync: Sync specific orders manually.
  • Monitor Sync: View sync history and logs in ERPNext Integration โ†’ Logs.

Monitoring and Management

โ†‘ Back to top

Track and manage synchronization activities to ensure smooth operations. This page covers the tools available for monitoring and maintenance.

Dashboard Overview

  • Access Dashboard: View sync activities in WordPressย Adminย โ†’ย ERPNext Integration.
  • Key Metrics:
    • Total orders synced
    • Total customers synced
    • Last inventory update
    • Connection status
    • Recent sync activities

Sync History

  • View History: Access detailed order sync history.
  • Filter and Search: Find specific orders or sync events.
  • Resync Orders: Manually resync failed orders.
  • Status Tracking: Monitor order statuses in ERPNext.

Logs and Troubleshooting

  • Access Logs: View logs inย ERPNext Integrationย โ†’ย Logs.
  • Log Levels: Set to Error, Warning, Info, or Debug.
  • Error Tracking: Identify and resolve sync errors.
  • Performance Monitoring: Track sync timing and performance.

Cache Management

  • Cache Status: Monitor cached ERPNext data.
  • Refresh Cache: Update cached data manually.
  • Clear Cache: Reset cache to resolve data issues.

Advanced Features

โ†‘ Back to top

Enhance the WooCommerce ERPNext Integration Plugin with advanced functionality for greater control and customization.

Cron Job Management

  • Automatic Sync: Uses WordPress cron jobs for scheduled synchronization.
  • Custom Intervals: Set specific intervals for products, customers, and orders.
  • Manual Triggers: Trigger sync jobs manually if needed.
  • Cron Monitoring: Check cron job status inย ERPNext Integrationย โ†’ย Logs.

Batch Processing

  • Bulk Operations: Sync large datasets efficiently.
  • Progress Tracking: Monitor batch sync progress.
  • Error Handling: Robust handling for batch errors.
  • Resume Capability: Resume interrupted batch operations.

Field Mapping and Customization

  • Custom Field Mapping: Map custom fields between platforms.
    Example: Map WooCommerce gift_wrap to ERPNext custom field.
  • Data Transformation: Transform data during sync (e.g., format phone numbers).
  • Conditional Logic: Apply rules for specific sync scenarios.
  • Custom Hooks: Use WordPress hooks for custom functionality.
    Example Hook: add_action(โ€˜wc_erpnext_sync_orderโ€™, โ€˜custom_order_logicโ€˜);

Troubleshooting and Support

โ†‘ Back to top

Resolve common issues and access support resources for the WooCommerce ERPNext Integration Plugin.

Troubleshooting Common Issues

Issue TypeSteps to Resolve
ERPNext ConnectionVerify Host URL, API credentials, and SSL settings. Ensure ERPNext API is enabled.
WordPress/WooCommerceCheck plugin/theme compatibility, increase PHP memory limit (e.g., 512MB), verify database connectivity.
Sync IssuesConfirm cron jobs are running, validate field mappings, check permissions, ensure data formats match.
PerformanceAdjust sync intervals, use batch processing, enable caching, optimize server resources.
LogsEnable debug mode, review error logs, adjust log levels, implement log rotation.

Example: Connection Failure

  • Error:ย Failed to connect to ERPNext.
  • Steps:
    1. Verify Host URL includesย https://.
    2. Regenerate API Key/Secret in ERPNext.
    3. Disable SSL verification temporarily to test.
    4. Check ERPNext server logs for blocked requests.

Support Resources

  • Plugin Documentation: Access help sections inย ERPNext Integrationย โ†’ย Help.
  • WordPress Codex: General WordPress troubleshooting.
  • WooCommerce Docs: Store-specific issues.
  • ERPNext Docs: API and configuration details.
  • Community Support:
    • WordPress Forums
    • WooCommerce Community
    • ERPNext Community
  • Plugin Support: Contact the developer via the pluginโ€™s support channel.

Getting Help

For unresolved issues, provide the following to support:

  • Description of the issue and steps to reproduce
  • Plugin version
  • WordPress/WooCommerce versions
  • ERPNext version
  • Error logs (from ERPNext Integration โ†’ Logs)

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Offer personalized product bundles, bulk discount packages, and assembledย products.