Integrations

Integrations

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Integration Lifecycle

Phase 1: Configuration

  1. Provider Setup
  • Install provider integration app (extends ecommerce_core)
  • Configure provider-specific settings (API credentials, endpoints)
  • Define warehouse mappings in provider settings doctype
  1. Warehouse Mapping
 # In provider settings
 def get_erpnext_to_integration_wh_mapping(self):
     return {
         "Stores - ERPNext": "warehouse_001",
         "Default Warehouse": "warehouse_main"
     }
  1. Scheduling Configuration
  • Configure sync intervals in provider settings
  • Enable/disable specific synchronization streams
  • Set log retention policies

Phase 2: Initial Synchronization

  1. Item Mapping
 create_ecommerce_item(
     integration="Unicommerce",
     erpnext_item_code="ITEM-001",
     integration_item_code="SKU-001",
     has_variants=False,
     variant_of=None
 )
  1. Customer Synchronization
 customer = EcommerceCustomer("CUST-001", "unicommerce_customer_id", "Unicommerce")
 if not customer.is_synced():
     customer.sync_customer("John Doe", "Individual")
     customer.create_customer_address({...})
     customer.create_customer_contact({...})
  1. Geographic Mapping
 map_country_and_state("US", "NY")  # Maps to ISO codes

Phase 3: Operational Synchronization

  1. Inventory Sync
 # In scheduled job
 if need_to_run(settings, "inventory_interval", "last_inventory_sync"):
     warehouses = settings.get_erpnext_warehouses()
     inventory = get_inventory_levels(warehouses, integration)

     for item in inventory:
         update_platform_inventory(item)
         update_inventory_sync_status(item.ecom_item)
  1. Order Processing
  • Fetch orders from platform
  • Create ERPNext Sales Order
  • Apply dummy tax category and price list
  • Reserve stock if applicable
  1. Logging & Monitoring
 create_log(
     integration="Unicommerce",
     method="sync_inventory",
     status="Success",
     request_data={...},
     response_data={...}
 )

Phase 4: Error Handling & Retry

  1. Automatic Logging
  • All operations logged to Ecommerce Integration Log
  • Exception capture with full stack traces
  • Request/response payload preservation
  1. Manual Retry
  • Failed operations accessible from UI
  • Individual record retry capability
  • Bulk retry operations
Last updated 2 weeks ago
Was this helpful?
Thanks!