How to Integrate E-Invoicing into Your Existing ERP System
A technical guide for CTOs and developers on integrating NRS-compliant e-invoicing into ERP systems using APIs, webhooks, and modern integration patterns.
Integrating e-invoicing capabilities into your existing ERP system doesn’t have to be disruptive. With the right approach and tools, you can add NRS-compliant invoicing without overhauling your entire financial infrastructure.
Why ERP Integration Matters
Most Nigerian businesses already have established workflows in their ERP systems—SAP, Oracle, Odoo, Microsoft Dynamics, or custom solutions. The goal of e-invoicing integration should be to enhance these existing systems, not replace them.
Benefits of Native Integration
- Single Source of Truth: Invoice data stays in your ERP
- Existing Workflows: Staff continue using familiar interfaces
- Automated Compliance: E-invoicing happens behind the scenes
- Real-time Sync: No manual data entry or reconciliation
Integration Architecture Options
Option 1: API-First Integration
The most flexible approach uses RESTful APIs to connect your ERP directly to the e-invoicing platform.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐│ Your ERP │────▶│ ZUTAX API │────▶│ NRS/Peppol │└─────────────┘ └─────────────┘ └─────────────┘How it works:
- Your ERP creates an invoice in its normal workflow
- A trigger calls the ZUTAX API with invoice data
- ZUTAX validates, generates IRN, and transmits
- Status updates flow back to your ERP
Best for: Custom ERPs, modern cloud systems, businesses with development resources.
Option 2: Webhook-Driven Integration
For systems that support outbound webhooks, this approach requires minimal custom code.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐│ Your ERP │────▶│ Webhook │────▶│ ZUTAX API ││ │◀────│ Endpoint │◀────│ │└─────────────┘ └─────────────┘ └─────────────┘How it works:
- Configure your ERP to send invoice events to a webhook URL
- ZUTAX processes the webhook payload
- Confirmation webhooks update your ERP
Best for: SaaS ERPs with webhook support, businesses wanting low-code solutions.
Option 3: Batch File Integration
For legacy systems or high-volume scenarios, batch processing offers reliability.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐│ Your ERP │────▶│ CSV/XML │────▶│ ZUTAX Batch ││ │ │ Export │ │ Processor │└─────────────┘ └─────────────┘ └─────────────┘How it works:
- Export invoices from ERP as CSV or XML files
- Upload to ZUTAX via SFTP or web interface
- Batch validation and processing
- Import results back into ERP
Best for: Legacy systems, very high volumes, scheduled processing requirements.
Technical Implementation Guide
Step 1: Map Your Invoice Data
First, map your ERP’s invoice fields to the NRS-required format:
| Your ERP Field | NRS Requirement | ZUTAX API Field |
|---|---|---|
| Customer Name | Party Legal Name | customer.legal_name |
| Customer TIN | Tax Identification | customer.tax_id |
| Invoice Number | Document Reference | invoice_number |
| Line Items | Invoice Lines | lines[] |
| VAT Amount | Tax Total | tax_total |
Step 2: Implement the API Connection
Here’s a basic example using the ZUTAX API:
import requests
def submit_invoice_to_zutax(erp_invoice): """ Transform ERP invoice and submit to ZUTAX """ # Transform to ZUTAX format zutax_invoice = { "invoice_number": erp_invoice["doc_number"], "issue_date": erp_invoice["date"], "due_date": erp_invoice["payment_due"], "customer": { "legal_name": erp_invoice["customer_name"], "tax_id": erp_invoice["customer_tin"], "address": erp_invoice["customer_address"] }, "lines": transform_line_items(erp_invoice["items"]), "currency_code": "NGN" }
# Submit to ZUTAX API response = requests.post( "https://api.getzutax.com/v1/invoices", json=zutax_invoice, headers={"Authorization": f"Bearer {API_KEY}"} )
return response.json()Step 3: Handle Responses and Status Updates
Your integration should handle these key responses:
Successful Submission:
{ "id": "inv_abc123", "irn": "NRS-2024-ABC123XYZ", "status": "validated", "qr_code_url": "https://api.getzutax.com/qr/inv_abc123"}Validation Errors:
{ "error": "validation_failed", "details": [ {"field": "customer.tax_id", "message": "Invalid TIN format"} ]}Step 4: Implement Webhook Listeners
Set up webhook endpoints to receive status updates:
@app.post("/webhooks/zutax")async def handle_zutax_webhook(payload: dict): """ Handle invoice status updates from ZUTAX """ event_type = payload["event"] invoice_id = payload["invoice_id"]
if event_type == "invoice.transmitted": # Update ERP: Invoice successfully sent to NRS update_erp_invoice_status(invoice_id, "TRANSMITTED")
elif event_type == "invoice.rejected": # Handle rejection - notify finance team handle_rejection(invoice_id, payload["reason"])
return {"received": True}Common Integration Patterns
SAP Integration
For SAP systems, consider these approaches:
- SAP PI/PO: Use integration middleware to call ZUTAX APIs
- ABAP RFC: Custom function module calling REST APIs
- SAP Cloud Connector: For SAP S/4HANA Cloud integration
Odoo Integration
Odoo’s modular architecture makes integration straightforward:
- Custom Module: Create an Odoo module that hooks into invoice creation
- Scheduled Actions: Batch sync invoices on a schedule
- Server Actions: Trigger API calls on invoice validation
Microsoft Dynamics Integration
For Dynamics 365 or Business Central:
- Power Automate: Low-code flows connecting to ZUTAX API
- Custom Extensions: AL code extensions for Business Central
- Azure Logic Apps: Enterprise integration for Dynamics 365
Security Considerations
API Authentication
ZUTAX uses secure API key authentication with these best practices:
- Environment Variables: Never hardcode API keys
- Key Rotation: Rotate keys periodically
- IP Whitelisting: Restrict API access to known IPs
- Scoped Permissions: Use keys with minimal required permissions
Data Protection
Ensure your integration protects sensitive data:
- TLS Encryption: All API calls use HTTPS
- Data Minimization: Only send required fields
- Audit Logging: Log all API interactions
- Error Handling: Don’t expose sensitive data in error messages
Testing Your Integration
Sandbox Environment
ZUTAX provides a sandbox environment for testing:
Sandbox API: https://sandbox.api.getzutax.comUse sandbox credentials to:
- Test invoice submission without real NRS transmission
- Validate data transformations
- Test error handling scenarios
Test Scenarios
Before going live, test these scenarios:
- Happy Path: Standard invoice submission and confirmation
- Validation Errors: Invalid TIN, missing fields, calculation errors
- Network Failures: Timeout handling, retry logic
- High Volume: Batch submission performance
- Edge Cases: Credit notes, foreign currency, zero-value lines
Monitoring and Maintenance
Health Checks
Implement monitoring for your integration:
def check_zutax_connection(): """ Health check for ZUTAX API connectivity """ try: response = requests.get( "https://api.getzutax.com/health", timeout=5 ) return response.status_code == 200 except requests.RequestException: return FalseLogging Best Practices
Log these events for troubleshooting:
- Invoice submission attempts
- API response codes and times
- Validation errors and reasons
- Webhook events received
- Retry attempts
Migration Strategy
Phase 1: Parallel Running
Run both systems simultaneously:
- Continue existing invoicing process
- Mirror invoices to ZUTAX
- Compare results and fix discrepancies
Phase 2: Gradual Rollout
Start with low-risk invoices:
- Begin with internal or test customers
- Expand to friendly customers
- Roll out to all customers
Phase 3: Full Migration
Switch to e-invoicing as primary:
- Make ZUTAX the source of truth for compliance
- Archive legacy processes
- Monitor and optimize
Getting Started with ZUTAX
ZUTAX provides comprehensive developer resources:
- API Documentation: Complete endpoint reference
- SDKs: Python and JavaScript libraries
- Postman Collection: Ready-to-use API examples
- Webhook Tester: Validate your webhook endpoints
- Developer Support: Technical assistance for integration
Conclusion
Integrating e-invoicing into your ERP doesn’t require starting from scratch. With ZUTAX’s flexible API, webhook support, and batch processing options, you can add NRS compliance to your existing systems while maintaining the workflows your team knows.
Ready to start your integration? Contact our developer team or explore our API documentation.
Ready to simplify your e-invoicing?
Join hundreds of Nigerian businesses using ZUTAX for compliant invoicing.