Accounting and reports
Chart of accounts, fiscal years, journal entries and year-end closing; general ledger, balance sheet, income statement, aging, cash flow, VAT settlements and fixed assets; VAT books, tax forms and dashboard indicators.
Billora keeps the books (Spanish PGC PYMES) automatically: issuing an invoice, confirming an expense, recording a payment or confirming a payslip generates and posts its journal entry. With the API you can read the books, add manual entries, reconcile and settle VAT, manage fixed assets, close the fiscal year and get the reports.
Scopes: accounting:read (reads) / accounting:write (everything else) and reports:read / reports:write. Accounting is a plan feature: if it is not included, the API returns 403 feature_not_available. Writes (entries, closing, settlements, configuration…) require the OWNER or ADMIN role (403 role_forbidden).
Every amount, including those of the reports (/accounting/reports/*), is a decimal string with two decimals ("1234.56"), never a floating-point number. Almost every report accepts fiscal_year=<id> or date_from/date_to and format=csv|xlsx (pdf for the balance sheet and income statement). By default they show "live" balances (no regularisation, closing or opening entries; the opening is already in the opening balance); include_regularisation=true adds only the 6/7 → 129 regularisation (groups 6 and 7 go to zero and 129 holds the result) and include_closing=true adds regularisation and closing (after the close, every balance of the year is zero). The journal (reports/journal/) always lists everything.
Chart of accounts, fiscal years and configuration
| Operation | Endpoint |
|---|---|
| Complete the PGC PYMES chart (idempotent: adds missing accounts) | POST /accounting/initialize/ |
Accounts (?compact=true for pickers; filters group, account_type, is_party, code__startswith, search) | /accounting/accounts/ · GET /accounting/accounts/tree/ |
Fiscal years (name, start_date, end_date; status is read-only) | /accounting/fiscal-years/ |
| Pre-closing checks (drafts, unposted documents, expected result) | GET /accounting/fiscal-years/{id}/closing-preflight/ |
Close a fiscal year (depreciation, accruals, regularisation, closing and opening of the next one; sets lock_date) | POST /accounting/fiscal-years/{id}/close/ |
| Reopen (reverses opening, closing, regularisation and result application; the next year may already have activity) | POST …/{id}/reopen/ |
| Result application proposal (art. 274 LSC: 10 % to 112 up to 20 % of the share capital, the rest to 113; losses to 121) | GET …/{id}/result-proposal/ |
Apply the result: {allocations: [{account_code: "112", amount: "70.00"}, …]} (112/113/114/118/120/121/129/550, must add up to the result; without allocations the proposal is applied) | POST …/{id}/apply-result/ |
Corporate income tax ({amount, date?, description?}: debit 630 / credit 4752, or 4709 when refundable; included in the regularisation) | POST …/{id}/corporate-tax/ |
Book legalisation (ZIP with journal, trial balance, balance sheet and P&L; manifest.json with each file's SHA-256 and the chained fingerprint chain) | GET /accounting/fiscal-years/{id}/legalization/ |
Configuration: default accounts, lock_date, payment_method_accounts, auto_generate_entries, prior_year_error_threshold | GET /accounting/config/ · PATCH /accounting/config/current/ |
Post the historical documents (dry_run, resync, since) | POST /accounting/backfill/ |
Set or remove the accounting start (start_date, dry_run) | POST /accounting/config/accounting-start/ |
| Opening entry from your accountant's trial balance (see treasury) | POST /accounting/opening-balances/preview/ · POST …/import/ |
Party sub-accounts are created automatically: customers 4300+id, suppliers 4000+id, creditors 4100+id, employees 4650+id, customer advances 4380+id, supplier advances 4070+id and fixed-asset suppliers 5230+id (party_type, party_id); renaming the party renames them. Deactivating or deleting an account used as a default account of the configuration (or as the treasury account of a payment method) returns 409 with the usage name in detail.
Nothing dated on or before lock_date (or in a closed fiscal year) can be created or edited: the API returns 409 period_locked, also for invoices, expenses and payments. A confirmed document dated in a locked period or a closed year is posted on the first open day (metadata.document_date keeps the real date); if its amount reaches prior_year_error_threshold, an expense or income of a closed year goes to 113 Voluntary reserves (prior-year error, NRV 22ª; metadata.prior_year_adjustment) instead of 6xx/7xx. Changing the date of a confirmed document or payment creates a contra entry (metadata.role: "reversal", reason: "date_change") and a new entry on the new date (role: "redated").
Accounting start
By default Billora posts everything there is in the organization. If you were already invoicing with Billora but your accountant kept the previous year's books in another program, those automatic entries are redundant: the official balances are the accountant's. The accounting start (accounting_start_date, visible in GET /accounting/config/) is the date from which Billora keeps the books. It is normally the first day of a fiscal year, for instance 2026-01-01.
When to use it:
- Companies that used Billora for invoicing or expenses and kept their books elsewhere the previous year.
- Organizations that start keeping their books in Billora midway through their history, from the accountant's balance.
If you start from scratch in Billora you do not need it: there is nothing earlier to exclude.
/api/v1/accounting/config/accounting-start/accounting:write{ "start_date": "2026-01-01", "dry_run": true }dry_run is true by default: the request only simulates and returns what would happen. Review the response and repeat with "dry_run": false to apply it.
{
"start_date": "2026-01-01",
"previous_start_date": null,
"dry_run": true,
"entries_deleted": 412,
"entries_by_kind": { "expense": 96, "expense_payment": 88, "invoice": 121, "manual": 3, "payment": 97, "payroll": 6, "vat_settlement": 1 },
"fiscal_years_removed": [{ "id": 2, "name": "2025", "start_date": "2025-01-01", "end_date": "2025-12-31" }],
"fiscal_years_renumbered": [],
"vat_settlements_removed": 1,
"documents_before_start": { "invoices": 121, "credit_notes": 0, "expenses": 96, "payments": 97, "expense_payments": 88, "payrolls": 6 },
"resync": null
}What is deleted when applied:
- Every journal entry dated before the start, automatic and manual (
entries_deleted, broken down by type inentries_by_kind), and later entries that only existed because of an earlier document (their reversals, for instance). - Fiscal years ending before the start (
fiscal_years_removed). Fiscal years that lose part of their entries are renumbered (fiscal_years_renumbered). - The posted VAT settlements of those periods (
vat_settlements_removed).
What is not deleted:
- No document: earlier invoices, credit notes, expenses, payments and payslips stay intact (
documents_before_startcounts them). They simply no longer have a journal entry. - VAT books and tax forms: they are computed from documents, not from entries, so earlier invoices and expenses remain in the VAT books (
/reports/vat-sales,/reports/vat-purchases) and in the forms (303, 347, 390…). - Everything dated from the start on, which is synced again (
resyncsummarises the result when applied).
From then on nothing is posted with an earlier date: an earlier document you confirm or edit generates no entry, and a manual entry with an earlier date returns 400. Later payments of earlier documents are posted, against the customer's or supplier's sub-account, whose balance must come from the opening entry. Hence the recommended order:
POST /accounting/config/accounting-start/withdry_runand, after reviewing it, without.- Import the accountant's trial balance as the opening entry, mapping each 430/400 sub-account to its customer or supplier.
- Import the statements (or connect Revolut Business) from that date and reconcile.
The only operation that deletes posted entries
It is recorded in the audit log with the detail of what was deleted. It fails with 409 accounting_error, changing nothing, when there are closed fiscal years before the start, affected entries in a locked period (lock_date) or in a closed fiscal year, or an opening generated by the close of a fiscal year that would be removed: reopen the fiscal year or lift the lock first.
How to undo it. Send start_date: null:
{ "start_date": null, "dry_run": false }It removes the start and posts the historical documents again (with dry_run: true, resync tells how many). The entries of invoices, expenses, payments and payslips are rebuilt; manual entries, VAT settlements, tax payments, bank transactions without a document and earlier depreciation that were deleted are not recovered. To change the date, just send another start_date.
Journal entries
/api/v1/accounting/journal-entries/accounting:write{
"fiscal_year": 3,
"date": "2026-11-30",
"description": "November depreciation of IT equipment",
"reference": "AM-2026-11",
"lines": [
{ "account": 412, "debit": "125.00", "credit": "0.00", "description": "Depreciation of tangible fixed assets" },
{ "account": 389, "debit": "0.00", "credit": "125.00", "description": "Accumulated depreciation of IT equipment" }
]
}account is the account id, not its PGC code (look it up with /accounting/accounts/?search=681); only accounts with 3 or more digits are accepted. The entry is created as a draft (status: draft, kind: manual) and the response includes is_balanced, total_debit and total_credit.
/api/v1/accounting/journal-entries/{id}/post-entry/accounting:writePosts a balanced entry and assigns its entry_number. A posted entry, one generated from a document (is_sourced), one in a closed fiscal year or in a locked period can no longer be edited or deleted: 409 accounting_error / period_locked. To correct it, POST …/{id}/reverse/ creates the contra entry (reversal_of) and POST …/{id}/resync/ regenerates an automatic entry from its document (also POST /accounting/resync/ with {model, id}).
Every entry states its origin: kind (invoice, expense, payment, payroll, vat_settlement, depreciation, closing…), source_type + source_object_id and unposted_reason when an automatic entry stays as a draft (unbalanced, inactive account, locked period). List filters: fiscal_year, status, kind, is_sourced, source_type, source_id, date_from/date_to, account, account_code, search. GET /accounting/reports/unposted-documents/ returns the documents pending posting with the reason.
Reports
| Report | Endpoint |
|---|---|
Exportable journal (page, page_size, kind, search) | GET /accounting/reports/journal/ |
General ledger (account=<id> or account_code=; opening balance, counterpart, paginated). An account with sub-accounts (430, 472…) returns the aggregated ledger of all of them (aggregated: true, account_code on each line and in the CSV/XLSX); the regularisation is always shown and include_closing=true adds the closing entry | GET /accounting/reports/ledger/ |
Trial balance (rows with subtotals, lines accounts only) | GET /accounting/reports/trial-balance/ |
PGC PYMES balance sheet (sections A/B/PN/PNC/PC, comparative column compare_to, format=pdf) | GET /accounting/reports/balance-sheet/ |
PGC PYMES income statement (items 1–18, compare_fiscal_year, format=pdf) | GET /accounting/reports/income-statement/ |
| Receivables / payables aging by party (`kind=receivable | payable, as_of; payables include 5230xxxx and subtract outstanding supplier credit notes, document_type` on each document) |
| Cash flow (57x) by month and category | GET /accounting/reports/cash-flow/ |
VAT reconciliation against form 303 (year, period=1T…4T or 01…12 under the monthly regime / REDEME; period in the response: "2026-01") | GET /accounting/reports/vat-reconciliation/ |
VAT settlements and fixed assets
| Operation | Endpoint |
|---|---|
Posted form 303 settlements (year, period) | GET /accounting/vat-settlements/ |
Post a quarter's or a month's settlement ({year, period, force?} with period 1T…4T or 01…12; period_key 2026-01, entry dated at month end; 409 if already posted) | POST /accounting/vat-settlements/ · POST …/{id}/reverse/ |
Tax payment or refund ({model, period, amount, date, bank_account?}; negative amount = refund) | GET · POST /accounting/tax-payments/ |
Fixed asset records (created automatically from expenses flagged is_investment_good; the creditor is 5230xxxx). Land (210/220) and assets under construction (23x) take useful_life_months: 0 (never depreciated; any other value → 400). monthly_depreciation is prospective: (base − depreciated) / remaining months; changing useful_life_months or residual_value recalculates the pending instalments (NRV 2ª) and a useful life ≤ months already depreciated → 400 | /accounting/fixed-assets/ |
Depreciation schedule (monthly_depreciation, remaining_months), depreciate up to a date, dispose, entries of the asset. Selling an asset is recorded with an invoice using a 2xx account and fixed_asset (see invoicing) | GET …/{id}/schedule/ · POST …/{id}/depreciate/ · POST …/{id}/dispose/ · GET …/{id}/entries/ |
| Doubtful debts (436 + 694/490) | POST /accounting/doubtful-debts/mark/ · …/recover/ · …/write-off/ |
VAT books and tax forms
| Operation | Endpoint |
|---|---|
Issued / received invoice books with AEAT columns (date_from, date_to, `format=csv | xlsx`) |
| Tax report and available quarters | GET /reports/fiscal · GET /reports/fiscal/quarters |
| Available forms (303, 130, 111, 115, 347, 349, 390…) | GET /reports/tax-models/available/ |
| Compute a form for a period | GET /reports/tax-models/{code}/?period=2026-3T |
| Documents feeding a box | GET /reports/tax-models/{code}/casillas/{casilla_code}/sources/ |
| Export (BOE file for the AEAT or PDF) | GET /reports/tax-models/{code}/export/ |
Manual box adjustments
/api/v1/reports/tax-models/{code}/overrides/?period=2026-3Treports:write{ "overrides": [{ "casilla_code": "78", "value": "350.00", "note": "Amounts to offset from Q2" }] }Only the editable boxes of the form can be adjusted. Sending a value equal to the computed one removes the adjustment.
Dashboard
With reports:read: GET /dashboard/stats/?period=30d (revenue, invoices, customers, expenses, payments… indicators for 7d, 30d, 90d or 12m), GET /dashboard/charts/ and GET /dashboard/activity/.
