External Api Xledger AS Outbound
Rest Api
Connection
Outbound
Data Flow
8
Components
3
Dependencies

Description

Xledger is a cloud-based accounting ERP used by Norges Blindeforbund for financial management. The integration exports approved expense claims and mileage reimbursements as accounting journal entries, eliminating manual re-entry into Xledger and ensuring expense data flows directly from coordinator approval in the app to the organisation's chart of accounts.

Detailed Analysis

The Xledger integration eliminates the manual double-entry accounting process that currently requires Norges Blindeforbund's finance team to re-key approved expense claims and mileage reimbursements from the app into their Xledger ERP system. By exporting approved expenses directly as Xledger accounting journal entries (vouchers), the platform closes the financial data loop from coordinator approval to chartered accounts without human intervention — reducing accounting lag, eliminating transcription errors, and freeing finance staff for higher-value work. API access is included within Blindeforbund's existing Xledger subscription, meaning this integration adds no incremental vendor cost. The double-export guard component (315) ensures no expense claim can be submitted to Xledger more than once, providing the financial control integrity that auditors require.

Organisation credential isolation ensures Blindeforbund's Xledger API key is never accessible to the other three organisations — maintaining clean financial boundaries. The CSV/JSON fallback export guarantees that finance operations can continue even during Xledger API outages, with full export history retained for reconciliation.

Xledger integration is scoped to Norges Blindeforbund only, which simplifies credential management but requires chart of accounts mapping configuration specific to Blindeforbund's Xledger account structure — a configuration task that requires input from Blindeforbund's finance team and cannot be completed by developers alone. Eight components depend on this integration: Xledger exporter (313), accounting integration client (102), accounting exporter service (312), chart of accounts mapper (318), double export guard (315), export Edge Function (319), accounting credentials vault (321), and accounting export screen (309). The chart of accounts mapping JSON must be validated against Blindeforbund's actual Xledger account codes before testing — errors here will cause API validation failures that surface to coordinators. The double export guard (315) is a critical correctness requirement and must be tested with concurrent export attempts to verify idempotency under load.

Monitoring requires alerts for export failure spikes and Xledger API authentication failures. Scheduled batch export is acceptable (synchronous export not required), which reduces real-time reliability pressure but requires a defined batch schedule to be agreed with Blindeforbund's accounting team.

Xledger REST API v1 uses API key authentication (XLEDGER_API_KEY, XLEDGER_COMPANY_ID, XLEDGER_API_ENDPOINT environment variables) with voucher:create and account:read scopes. Integration is outbound-only — the mobile client never holds credentials; all API calls execute server-side via Edge Function (319) using the accounting credentials vault (321). Pipeline: accounting export screen (309) → accounting exporter service (312) → chart of accounts mapper (318) → double export guard (315) → Xledger exporter (313) → accounting integration client (102) → Edge Function (319). The chart of accounts mapper translates expense types and VAT codes to Xledger account codes using a configuration JSON.

Error handling: double export guard checks export run history before each submission to prevent duplicate vouchers; API validation errors from Xledger are surfaced to coordinators with field-level detail; failed voucher creation is logged for manual accountant review; all export runs are persisted in the export run history for audit trail. Latency target is under 10 seconds for batch export of 50 expense claims. Health check runs on export screen load by testing Xledger API connectivity. Standard Xledger rate limits apply per account — batch size is configurable to stay within limits.

Fallback: CSV/JSON export for manual import when API is unavailable, with full export history retained.

Dependencies (3)

Xledger account active for Norges Blindeforbund External
Chart of accounts mapping from expense types to Xledger account codes External
Approved expense claims with valid amounts and VAT codes External

Authentication

TypeApi Key
RequirementsXledger API key for Blindeforbundet's Xledger account, Xledger company ID, Chart of accounts mapping configured
Scopesvoucher:createaccount:read

Configuration

Required Settings

XLEDGER_API_KEY Required
XLEDGER_COMPANY_ID Required
Chart of accounts mapping JSON Required

Optional Settings

Default cost centre per activity type Optional
VAT code mapping Optional
Batch export size Optional

Environment Variables

XLEDGER_API_KEY
XLEDGER_COMPANY_ID
XLEDGER_API_ENDPOINT

Error Handling

Double export guard prevents re-exporting already-exported claims
Xledger API validation errors surfaced to coordinator with field-level detail
Failed voucher creation logged for manual accountant review
Export run history maintained for audit trail

Monitoring

Health Checks

Xledger API connectivity test on export screen load

Metrics

Vouchers successfully posted per export run
Export failure rate
Export processing time

Alerts

Export failure spike
Xledger API authentication failure

Performance

Latency< 10s for batch export of 50 expense claims
AvailabilitySynchronous export not required — scheduled batch export acceptable

Rate Limits

Xledger REST API: standard rate limits apply per account

Cost Implications

Pricing ModelIncluded in Xledger subscription (API access part of plan)

Cost Factors

Xledger monthly subscription cost (Blindeforbundet's existing contract)
API call volume within plan limits

Security Considerations

Xledger API key stored in accounting credentials vault on server — never in mobile client
Exported financial data transmitted over TLS only
Per-organisation credential isolation — Blindeforbundet credentials never accessible to other orgs

Fallback Mechanisms

CSV/JSON file export for manual import into Xledger when API unavailable
Export history panel retains all generated export files