Skip to content

Custom Adapter Development

Build a custom ERP adapter for TaprNext when native integration isn’t available.

The system uses a layered design where your custom adapter implements the ERPAdapter base class interface, sitting between TaprNext and your ERP system to handle all integration communication.

Your implementation must extend ERPAdapter and provide these core methods:

  • test_connection() - Verify ERP connectivity
  • get_vendors() - Retrieve supplier list from ERP
  • get_purchase_orders() - Fetch open POs
  • post_invoice() - Submit approved invoices to ERP
  • get_posting_status() - Check invoice posting results

The constructor accepts a settings dictionary containing connection parameters like API endpoints and authentication credentials.

Invoices include vendor information, line items, tax details, dates, amounts, and optional PO references. Each line item contains description, quantity, unit pricing, tax rates, and accounting codes.

Vendor objects store ERP IDs, names, tax identifiers, addresses, preferred currencies, and payment terms.

Use standardized exceptions:

  • ERPConnectionError - Network/connectivity failures
  • ERPAuthenticationError - Invalid credentials
  • ERPPostingError - Invoice submission failures
  • ERPValidationError - Data format problems

Define a FIELD_MAP dictionary to translate TaprNext field names to your ERP’s naming conventions, handling differences in terminology and structure.

Unit tests verify individual methods with mock data. Integration tests validate full cycles using actual ERP test environments with real vendors and purchase orders.

Place your adapter file in taprnext/adapters/, register it in the adapters module, add configuration fields if needed, then deploy and validate.

Ensure all interface methods are implemented, error modes are handled, tests pass, field mappings are documented, settings are configured, and the adapter is properly registered.

  • Implement idempotent operations for duplicate handling
  • Log all API interactions comprehensively
  • Configure appropriate request timeouts
  • Add retry logic for transient failures
  • Validate data before posting