Infrastructure high complexity backend
0
Dependencies
0
Dependents
2
Entities
1
Integrations

Description

Phase 3 integration client providing a unified interface for exporting approved expense records to external accounting systems. Supports both Dynamics (HLF portal) and Xledger (Blindeforbundet) via REST API, with organisation-specific credential management and retry logic.

Feature: Travel & Expense Registration

accounting-integration-client

Summaries

The Accounting Integration Client closes the final mile of the expense lifecycle by automatically exporting approved claims into the organization's existing financial systems — Dynamics for HLF portal clients and Xledger for Blindeforbundet. Without this integration, finance teams would need to manually re-enter approved expense data into accounting platforms, introducing transcription errors, delays, and significant recurring labor costs. By automating this export with built-in retry logic and schema mapping, the organization reduces reconciliation effort, accelerates month-end close cycles, and ensures audit-ready financial records with minimal human intervention. This directly translates to lower cost-per-claim processing and improved compliance posture across all participating organizations.

This is the highest-complexity component in the pipeline and is scoped to Phase 3, meaning it carries the most schedule risk if credential provisioning or accounting system API access is delayed. Dependencies include finalized approved expense records, organization-specific credential management infrastructure, and confirmed API contracts from both Dynamics and Xledger — any of which can cause blockers if not secured early. Delivery planning must account for environment-specific testing against staging instances of both accounting systems, which typically require coordination with external vendors. The `batchExport` and `retryFailedExports` interfaces require load and failure-scenario testing.

Budget additional time for schema mapping validation per organization, as accounting field mappings frequently diverge from internal data models. Ensure a manual review fallback UI is ready for records flagged as failed exports.

The Accounting Integration Client is a high-complexity backend service that abstracts over two distinct external REST APIs — Microsoft Dynamics (HLF portal) and Xledger (Blindeforbundet) — behind a unified interface. The primary integration points are `exportExpense(expenseId, targetSystem)` and `batchExport(expenseIds, targetSystem)`, with `mapToAccountingSchema(expense, targetSystem)` performing the critical field translation between the internal expense and driver-honorarium data models and the target system's schema. Credential management must support per-organization configuration with token refresh handling, as both systems use different auth mechanisms. The `retryFailedExports(organizationId)` function requires idempotent export logic to prevent duplicate accounting entries on re-run.

Implement structured export result logging with enough detail to support manual review of failed records. Given the high complexity and external API variability, wrap all outbound calls with circuit breaker or exponential backoff patterns, and ensure export status is persisted locally so the system remains recoverable after partial batch failures.

Responsibilities

  • Export approved expense records to Dynamics or Xledger via REST API
  • Map internal expense data model to organisation-specific accounting schema
  • Handle authentication and credential refresh for each accounting system
  • Log export results and flag failed records for manual review

Interfaces

exportExpense(expenseId, targetSystem)
batchExport(expenseIds, targetSystem)
getExportStatus(expenseId)
mapToAccountingSchema(expense, targetSystem)
retryFailedExports(organizationId)

Related Data Entities (2)

Data entities managed by this component

Used Integrations (1)

External integrations and APIs this component relies on

API Contract

View full contract →
REST /api/v1/accounting-exports 6 endpoints
GET /api/v1/accounting-exports List export records
GET /api/v1/accounting-exports/:id Get export status and external reference
POST /api/v1/accounting-exports Export a single approved expense to accounting system
PUT /api/v1/accounting-exports/:id Update export record status (webhook callback)
DELETE /api/v1/accounting-exports/:id Cancel a pending export job
POST /api/v1/accounting-exports/batch Batch export multiple approved expenses