Invoiceninja
Invoice Ninja v5 (/api/v1) model — read-side snapshots (invoices, payments,
expenses, vendors, expense categories) plus an idempotent, gated write path
that syncs bank transactions into Invoice Ninja as expense records.
Status: live in production, promoted to stable, driving the
mercury-expense-sync / ar-nightly workflows.
Methods
- Read —
listInvoices,getInvoice,listPayments,listExpenses,expenseCategories,vendors. All paginate to completion. - Write (gated behind
dryRun, defaulttrue) —upsertExpenses(check-then-create per BankTxn, dedup oncustom_value1),upsertVendors/upsertExpenseCategories(auto-create reference data for candidate transactions),buildMapping(pure derive of the frozen vendor/categoryMapping; underdryRunit also projects would-create vendor/category names onto a sentinel id so an all-dry-run preview resolves them instead of reporting a phantom unmatched vendor/category).
Dedup contract
Bank txn id → Invoice Ninja custom_value1 — the only field both writable
and ?filter=-searchable. Check-then-create; no upsert; single-writer
fan-out.
Curated overlays
vendorOverlay / categoryOverlay translate raw vendor/category names;
vendorCategoryOverlay hard-overrides a vendor's category assignment,
winning over the bank's raw category.
Header token auth (vaulted), X-Requested-With mandatory on every request.
| Argument | Type | Description |
|---|---|---|
| clientId? | string | |
| clientStatus? | string | e.g. "1,2,3,4" |
| Argument | Type | Description |
|---|---|---|
| id | string |
| Argument | Type | Description |
|---|---|---|
| clientId? | string |
| Argument | Type | Description |
|---|---|---|
| clientId? | string | |
| vendorId? | string | |
| categoryId? | string | |
| filter? | string | ?filter= (searches custom_value1) |
| Argument | Type | Description |
|---|---|---|
| txns | array | BankTxn[] (§6) |
| mapping | record | vendor/category/currency mapping tables (§7.3) |
| dryRun? | boolean | Overrides cfg.dryRun; default cfg.dryRun (true). |
| Argument | Type | Description |
|---|---|---|
| txns | array | BankTxn[] (§6) |
| dryRun? | boolean | Overrides cfg.dryRun; default cfg.dryRun (true). |
| Argument | Type | Description |
|---|---|---|
| txns | array | BankTxn[] (§6) |
| dryRun? | boolean | Overrides cfg.dryRun; default cfg.dryRun (true). |
| fallbackName? | string | Fallback category name always ensured; default 'Uncategorized'. |
| Argument | Type | Description |
|---|---|---|
| currencyId | string | IN currency hashid (USD-only v1, §12.4). |
| fallbackCategoryName? | string | Category whose id becomes fallbackCategoryId; default 'Uncategorized'. |
| dryRun? | boolean | Overrides cfg.dryRun; default cfg.dryRun (true). Gates the §7.6 |
Resources
Outstanding invoice balance bucketed by age past due (current/1-30/31-60/61-90/90+), per client and total
Expenses grouped by category and vendor over a period, plus billable-but-uninvoiced backlog
Gap / mismatch / duplicate report: source posted debits vs expenses recorded in Invoice Ninja — the 'am I caught up?' answer
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned