ERPNext provides extensive integration capabilities to connect with banking services, payment gateways, e-commerce platforms, and custom applications.
Banking Integrations
Plaid Integration
Connect your bank accounts directly to ERPNext for automatic transaction synchronization.
Configuration
Sync Transactions
# erpnext_integrations/doctype/plaid_settings/plaid_settings.py
class PlaidSettings ( Document ):
def get_link_token ( self ):
plaid = PlaidConnector()
return plaid.get_link_token()
@frappe.whitelist ()
def get_plaid_configuration ():
if frappe.db.get_single_value( "Plaid Settings" , "enabled" ):
plaid_settings = frappe.get_single( "Plaid Settings" )
return {
"plaid_env" : plaid_settings.plaid_env,
"link_token" : plaid_settings.get_link_token(),
"client_name" : frappe.local.site,
}
Features:
Automatic bank statement import
Multi-bank account support
Transaction categorization with tags
Real-time balance updates
Automatic reconciliation
Support for checking, savings, and credit accounts
Plaid supports 11,000+ financial institutions across North America and Europe. Configure your environment (sandbox, development, production) in Plaid Settings.
Setting Up Plaid
Get Plaid Credentials
Sign up at plaid.com/dashboard
Get Client ID and Secret Key
Choose environment (sandbox for testing)
Configure ERPNext
# Setup > Integrations > Plaid Settings
plaid_settings = frappe.get_doc( "Plaid Settings" )
plaid_settings.enabled = 1
plaid_settings.plaid_client_id = "your_client_id"
plaid_settings.plaid_secret = "your_secret"
plaid_settings.plaid_env = "production"
plaid_settings.automatic_sync = 1 # Enable automatic sync
plaid_settings.save()
Link Bank Accounts
Go to Accounts > Bank > Bank Account
Click “Link with Plaid”
Authenticate with your bank
Select accounts to sync
Schedule Automatic Sync
# Runs daily via scheduler
def automatic_synchronization ():
settings = frappe.get_doc( "Plaid Settings" , "Plaid Settings" )
if settings.enabled == 1 and settings.automatic_sync == 1 :
enqueue_synchronization()
Payment Gateway Integrations
Accept online payments through multiple gateways:
Stripe Credit cards, ACH, and international payments
PayPal PayPal checkout and Express Checkout
Razorpay Indian payment gateway with UPI support
Braintree PayPal-owned gateway with vault support
Payment Request Flow
# Create payment request for Sales Invoice
def make_payment_request ( ** args ):
pr = frappe.new_doc( "Payment Request" )
pr.payment_gateway_account = args.get( "payment_gateway_account" )
pr.reference_doctype = "Sales Invoice"
pr.reference_name = args.get( "sales_invoice" )
pr.grand_total = args.get( "grand_total" )
pr.insert( ignore_permissions = True )
pr.submit()
# Send payment link via email
pr.send_email()
return pr
E-commerce Integrations
Shopify Integration
Sync products, orders, and customers between ERPNext and Shopify:
# Shopify webhook handler
@frappe.whitelist ( allow_guest = True )
def shopify_webhook_handler ():
data = frappe.request.get_data( as_text = True )
webhook_type = frappe.request.headers.get( "X-Shopify-Topic" )
if webhook_type == "orders/create" :
create_sales_order_from_shopify(json.loads(data))
elif webhook_type == "products/update" :
update_item_from_shopify(json.loads(data))
WooCommerce Integration
Connect your WooCommerce store:
Product sync (items, variants, pricing)
Order management
Inventory updates
Customer data sync
API Integration Framework
Build custom integrations using ERPNext’s REST API:
REST API
Webhooks
JavaScript Client
# Create Sales Invoice via API
import requests
url = "https://your-site.erpnext.com/api/resource/Sales Invoice"
headers = {
"Authorization" : "token api_key:api_secret" ,
"Content-Type" : "application/json"
}
data = {
"customer" : "Customer Name" ,
"items" : [
{
"item_code" : "ITEM-001" ,
"qty" : 5 ,
"rate" : 100
}
]
}
response = requests.post(url, json = data, headers = headers)
print (response.json())
Email & Communication
Email Campaign Automation
# erpnext/crm/doctype/email_campaign/email_campaign.py
class EmailCampaign ( Document ):
def send_campaign_emails ( self ):
for recipient in self .get_recipients():
if not recipient.unsubscribed:
self .send_email_to_recipient(recipient)
recipient.email_sent = 1
recipient.save()
Campaign Features:
Lead nurturing sequences
Customer segmentation
Email templates with variables
Tracking (opens, clicks, unsubscribes)
A/B testing support
Email Digest
Automated summary reports delivered to your inbox:
# Configure digest settings
email_digest = frappe.get_doc({
"doctype" : "Email Digest" ,
"frequency" : "Weekly" ,
"recipients" : [ "[email protected] " ],
"income_year_to_date" : 1 ,
"bank_balance" : 1 ,
"pending_sales_orders" : 1 ,
"pending_purchase_orders" : 1
})
email_digest.insert()
Third-Party Service Integrations
Supported Carriers:
FedEx
UPS
USPS
DHL
Custom carrier APIs
Features:
Real-time shipping rates
Label generation
Tracking number updates
Delivery notifications
Send SMS notifications for:
Order confirmations
Delivery updates
Payment reminders
OTP verification
Supported providers: Twilio, AWS SNS, custom SMS APIs
Call Center Integration: # Create call log from telephony system
call_log = frappe.get_doc({
"doctype" : "Call Log" ,
"from" : "+1234567890" ,
"to" : "+0987654321" ,
"type" : "Incoming" ,
"status" : "Completed" ,
"duration" : 120
})
call_log.insert()
Data Import/Export
CSV Import
Bulk import data from spreadsheets:
from frappe.core.doctype.data_import.data_import import import_file
# Import items from CSV
import_file(
doctype = "Item" ,
file_path = "/path/to/items.csv" ,
import_type = "Insert"
)
Excel Export
Export reports and data:
@frappe.whitelist ()
def export_report_to_excel ( report_name , filters ):
from frappe.desk.query_report import run
result = run(report_name, filters = filters)
return result
Custom Integration Development
Creating Custom Connectors
# Example: Custom ERP Integration
class CustomERPConnector :
def __init__ ( self , api_key , base_url ):
self .api_key = api_key
self .base_url = base_url
def sync_customers ( self ):
customers = self .fetch_customers_from_api()
for customer_data in customers:
self .create_or_update_customer(customer_data)
def fetch_customers_from_api ( self ):
response = requests.get(
f " { self .base_url } /customers" ,
headers = { "Authorization" : f "Bearer { self .api_key } " }
)
return response.json()
def create_or_update_customer ( self , data ):
if frappe.db.exists( "Customer" , { "external_id" : data[ "id" ]}):
customer = frappe.get_doc( "Customer" , { "external_id" : data[ "id" ]})
customer.customer_name = data[ "name" ]
customer.save()
else :
customer = frappe.get_doc({
"doctype" : "Customer" ,
"customer_name" : data[ "name" ],
"external_id" : data[ "id" ]
})
customer.insert()
Integration Hooks
Use hooks.py to register integrations:
# hooks.py
scheduler_events = {
"hourly" : [
"your_app.integrations.sync_with_external_system"
],
"daily" : [
"your_app.integrations.sync_products" ,
"your_app.integrations.sync_inventory"
]
}
doc_events = {
"Sales Order" : {
"on_submit" : "your_app.integrations.send_to_external_system"
}
}
Integration Best Practices
Security
Store API keys in encrypted fields
Use OAuth 2.0 when available
Implement rate limiting
Validate webhook signatures
Log all integration activities
Error Handling
Implement retry logic with exponential backoff
Log errors in Integration Request
Send failure notifications
Use queues for async processing
Monitor integration health
Performance Tips
Use background jobs for bulk operations
Implement pagination for large datasets
Cache frequently accessed data
Use database indexes on lookup fields
Monitor API rate limits
Next Steps
Automation Automate workflows and processes
Regional Features Country-specific compliance and localization