Xledger REST API
External Api Integration by Xledger AS
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.
Using Components (8)
Dependencies (3)
Authentication
| Type | Api Key |
| Requirements | Xledger API key for Blindeforbundet's Xledger account, Xledger company ID, Chart of accounts mapping configured |
| Scopes | voucher:createaccount:read |
Configuration
XLEDGER_API_KEY
XLEDGER_COMPANY_ID
XLEDGER_API_ENDPOINT
Error Handling
Monitoring
Performance
| Latency | < 10s for batch export of 50 expense claims |
| Availability | Synchronous export not required — scheduled batch export acceptable |
Cost Implications
| Pricing Model | Included in Xledger subscription (API access part of plan) |