The Close app (close-ui) drives the month-end through 57 whitelisted methods in konsol/close/*_api.py (42 for the close screens and 15 for the Konsol home cards and charts), plus two in konsol/consolidation/doctype/assertion_run/assertion_run.py. This page summarises every one of them, read from the Python on 2026-11-08 (konsol 0cca0242). It is a summary: each function's docstring is the full contract.
Conventions
Every close method follows three rules. konsol/tests/test_close_api_contract.py parses the source and fails if any method breaks one.
- One verb. The decorator is exactly
@frappe.whitelist(methods=["GET"]) or @frappe.whitelist(methods=["POST"]). Reads are GET; anything that inserts, saves, submits, cancels, enqueues or commits is POST (Frappe rolls a GET back). A GET-only method answers 403 to a POST.
- Role gate first. The first statement is
frappe.only_for((...roles...)), written as a literal tuple so the test can read it. A caller outside the tuple gets PermissionError (HTTP 403) before anything else is read.
- Entity scope after the gate. What the caller then sees is cut to their entity allow-list (
konsol.entity_permissions.allowed_entity_codes): rows for other entities are dropped and counted in a hidden field, or the request is refused by name.
Role tuples used below:
| Short name | Roles |
|---|
| All close roles | EPM Admin, EPM Analyst, Entity Accountant, EPM User, System Manager |
| Group roles | EPM Admin, EPM Analyst, EPM User, System Manager |
| Analyst or Close Lead | EPM Analyst, EPM Admin, System Manager |
| Close Lead | EPM Admin, System Manager |
In the product's words, EPM Admin is the Close Lead, EPM Analyst the Group Accountant, Entity Accountant the entity's preparer, EPM User a viewer.
Periods. fiscal_year and fiscal_period name a period declared in EPM Fiscal Year. An undeclared pair is refused with PeriodNotDeclared (a ValidationError, HTTP 417) naming the period. Most methods also need the period to be of type Regular, and writes need it Open.
Errors. Refusals are frappe.throw sentences written for the user (HTTP 417, exc_type: ValidationError). Every write method checks every refusal before it writes anything.
Calling. Arguments map to the function parameters, as Frappe form fields or a JSON body. Paths are /api/method/konsol.close.<module>.<function>.
Period and work
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
period_api.get_context | GET | All close roles | The signed-in user, every Regular period's state, the landing period and the selected one | fiscal_year, fiscal_period (optional; must be a declared Regular period) | {me, periods, landing, selected} |
mywork_api.get_my_work | GET | All close roles | The caller's work items ranked blocking, todo, waiting; a viewer gets none | — | {items, counts: {blocking, todo, waiting, by_screen}, entities_assigned} |
freshness_api.get_freshness | GET | All close roles | Whether the consolidated numbers are current (for the header) | — | freshness object with as_of |
grid_api.get_period_grid | GET | Group roles | The period grid for a Regular period | fiscal_year, fiscal_period | {period, rows, counts, rates_error, deadlines, signoff_overdue, ic_overdue, ic_overdue_error, journals_overdue, journals_overdue_error} |
grid_api.get_readiness | GET | Group roles | The readiness checklist; reads the same gate the sign-off uses, so the two cannot disagree | fiscal_year, fiscal_period | readiness object |
Trial balances
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
tb_api.check_tb | POST | EPM Admin, Entity Accountant, System Manager | Check a trial-balance CSV for one entity-period; writes nothing. Entity must be in the caller's scope and a non-group Entity. | entity, fiscal_year, fiscal_period, amount_basis, content (CSV text or bytes) | {ok, rows, file_problems, totals, period_problem, replaces} |
tb_api.submit_tb | POST | same | Re-check, then submit the CSV as a Trial Balance Submission, cancelling the one it replaces in the same step | as check_tb plus replaces (the name check_tb returned) | {name, replaced, on_behalf} |
tb_read_api.my_tbs | GET | All close roles | The period's entities (cut to scope) with TB status, exception, reminders, deadline | fiscal_year, fiscal_period | {period_open, can_upload, can_remind, deadline, entities: [...]} |
tb_read_api.tb_compare | GET | All close roles | This period's TB against the previous Regular period's, by account | entity, fiscal_year, fiscal_period | {rows, basis_note, previous_note, previous_code, entity, current, previous} |
signoff_api.declare_tb_exception | POST | Close Lead | Declare that an entity has no trial balance for the period, with a reason | entity, fiscal_year, fiscal_period, reason | the new TB Exception's name |
Bulk upload of many entity-periods from one file is a separate module, konsol/tb_bulk.py (see the inventory).
Checks and sign-off
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
checks_api.get_checks | GET | All close roles | The period's checks: latest run, staleness, failures, warnings, whether the caller may run them | fiscal_year, fiscal_period | {latest, staleness, staleness_note, as_of, results_run, domains, failures, warnings, can_run, period_status} |
checks_api.run_checks | POST | Analyst or Close Lead | Start the close checks: creates an Assertion Run and queues the suite (calls trigger_close_run). Refuses a period that is not Open and a run already Queued or Running. | fiscal_year, fiscal_period | the new Assertion Run's name |
signoff_api.get_signoff | GET | All close roles | The period's sign-off summary plus can_sign, can_override, period_status, closed_by, closed_on, and the data-change fields | fiscal_year, fiscal_period | summary object |
signoff_api.sign | POST | Close Lead | Sign off the period's latest finished run. run must be that run's name, else refused. Green signs; amber needs acknowledgement; red needs override_reason (recorded as Overridden). | fiscal_year, fiscal_period, run, acknowledgement, override_reason | result of sign_off_close |
signoff_api.reject | POST | Close Lead | Reject the period's signature with a reason; the run goes back to Not signed and the preparer gets a "sent back" work item | fiscal_year, fiscal_period, run, reason | result of reject_signoff |
signoff_api.close_period | POST | Close Lead (also check_epm_admin) | Close the period through its EPM Fiscal Year; the group-rate and sign-off gates are the Fiscal Year's | fiscal_year, fiscal_period, note | {status, closed_by, closed_on} |
signoff_api.reopen_period | POST | Close Lead (also check_epm_admin) | Reopen the period for a stated reason; later signed periods become Re-sign Needed | fiscal_year, fiscal_period, reason | {status, closed_by, closed_on} |
The two Assertion Run methods the close methods wrap:
| Method | Verb | Roles | Purpose |
|---|
konsol.consolidation.doctype.assertion_run.assertion_run.trigger_close_run | POST | frappe.only_for(("EPM Admin", "EPM Analyst", "System Manager")) | Create the Assertion Run and enqueue run_close_assertions; refuses a period that is not Open and a run in progress |
konsol.consolidation.doctype.assertion_run.assertion_run.sign_off_close | POST | write permission on Assertion Run; override needs EPM Admin or System Manager | The sign-off itself: gates (konsol.close.signoff_gate.assert_can_sign), the amber acknowledgement, the red override, and the refusal of a run that started before the period's last data change (Re-run the checks before signing) |
Intercompany
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
ic_api.get_ic | GET | Group roles | Intercompany pairs, differences and unmatched rows from the last build, cut to scope | fiscal_year, fiscal_period | {period, state, message, help, published, declared_none, groups, unmatched, counts, hidden, can_send_back, can_remind} |
ic_api.send_back | POST | Analyst or Close Lead | Send an over-tolerance pair back to both entities as an ic_sent_back Close Event; Open period only | fiscal_year, fiscal_period, entity_a, account_a, entity_b, account_b, reason | {event, fix_items_for} |
ic_balance_api.get_ic_balances | GET | Group roles | The period's IC Balances and the gap against the IC Elimination Rules | fiscal_year, fiscal_period | {period, balances, gap, ambiguous_gap, pending_gap, hidden, entities, can_draft, rules_desk} |
ic_balance_api.save_ic_balance | POST | Analyst or Close Lead | Draft a new IC Balance, or edit the named draft's amounts; Open period only | fiscal_year, fiscal_period, selling_entity, buying_entity, ic_sales_amount, ending_inventory_from_ic, name (edit) | {name, docstatus} |
Journals
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
journal_api.get_journals | GET | Group roles | The period's Consolidation Journals (draft, approved, cancelled) and what the caller may do | fiscal_year, fiscal_period | journals payload |
journal_api.save_journal | POST | EPM Analyst, System Manager | Draft a Consolidation Journal, or edit the named draft; Open period only; adjustment_type must be a journal type | fiscal_year, fiscal_period, consolidation_group, adjustment_type, description, lines (list or its JSON), reverse_fiscal_year, reverse_fiscal_period, name (edit) | the journal summary: {name, ..., total_debit, total_credit} |
journal_api.send_for_approval | POST | EPM Analyst, System Manager | Move a draft journal to Pending Approval through the installed workflow; refuses an approved, reversed or already-sent journal | name | the journal's name and status |
Rates and ownership
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
rates_api.get_rates | GET | Group roles | The period's group exchange rate grid: required pairs, drafts, approved rates, corrections, move warnings | fiscal_year, fiscal_period | grid payload |
rates_api.save_rate | POST | Analyst or Close Lead | Draft a Group Exchange Rate, or a correction of an approved one (supersedes, needs change_reason); Open period only | fiscal_year, fiscal_period, from_currency, to_currency, rate_type (Closing / Average), quote, quoted_per, change_reason, name, supersedes | {name, docstatus, quote_label, source} |
rates_api.delete_rate | POST | Analyst or Close Lead | Delete one draft correction; a plain first draft is edited, not deleted | name | {name, deleted: true} |
rates_api.get_pending | GET | Group roles | Pending Historical Equity Rate and Ownership Period drafts, cut to scope | — | pending lists |
rates_api.get_ownership | GET | Group roles | Ownership as of the Regular period's first day, per entity | fiscal_year, fiscal_period | ownership payload with can_record, can_change |
rates_api.preview_ownership_change | GET | Group roles | Refusals and structural effect of an ownership change starting on the period's first day; writes nothing | fiscal_year, fiscal_period, consolidation_group, entity, ownership_pct, consolidation_method, name (edit) | {problems, effect, current, pending} |
rates_api.save_ownership_change | POST | Analyst or Close Lead | Save the change as a draft Ownership Period superseding the current one; name edits that draft | same as the preview | {name, docstatus: 0} |
konsol.group_rates.prefill_from_erp (POST, Analyst or Close Lead) drafts Closing and Average rates for a period from the ERP quotes; it lives outside close/.
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
statement_api.get_statement | GET | Group roles | The consolidated statement for a root group and period | fiscal_year, fiscal_period, consolidation_group | statement payload; non-ok states choose_group, no_chart, not_built, error, setup_gap |
statement_api.get_drill | GET | Group roles | One heading's drill-down | fiscal_year, fiscal_period, consolidation_group, heading | drill rows |
statement_api.export_statement | GET | Group roles | The statement and every heading's drill as an .xlsx download; a non-ok statement is refused with its sentence, never an empty file | fiscal_year, fiscal_period, consolidation_group | file download |
commentary_api.save_commentary | POST | Analyst or Close Lead | Save a Statement Commentary for one heading; modified is the value last read, and a stale one is refused | fiscal_year, fiscal_period, consolidation_group, heading, text, modified | {name, heading, ...} with the new modified and the editor's full name |
Approvals
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
approvals_api.get_queue | GET | Group roles | The caller's approval queue over the approval doctypes (Consolidation Journal, Business Combination, Business Disposal, Group Exchange Rate, Ownership Period, Historical Equity Rate, IC Balance), plus sent-back items | — | queue payload |
approval_api.approve_mode | GET | All close roles | What the caller may do with a document from its Desk Actions menu: approve, approve with a self-approval reason, not an approver, or sent back | doctype, name | {mode, message} |
approval_api.approve | POST | Close Lead | Approve a document awaiting approval; a self-approval needs reason where Close Settings require it | doctype, name, reason | {name, docstatus, self_approved} |
approval_api.reject | POST | Close Lead | Reject with a reason: back to the workflow's first state, or (no workflow) a Comment and a rejected Close Event | doctype, name, reason | {name, docstatus, status} |
Reminders and audit trail
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
remind_api.remind | POST | Analyst or Close Lead | Remind an entity's people about a topic; refused outside an Open period or when there is nothing to remind about | fiscal_year, fiscal_period, entity, topic (tb or ic) | {event, recipients} |
trail_api.get_trail | GET | Group roles | The period's audit trail of Close Events, cut to scope, then filtered | fiscal_year, fiscal_period, kinds, actors, entities (JSON lists), date_from, date_to | {period, summary, events, hidden, total, options, filters} |
trail_api.export_trail_csv | GET | Group roles | The same filtered trail as a CSV download | same as get_trail | file download |
Konsol home cards and charts
Fifteen methods feed the Konsol home workspace and My Work (konsol#407, konsol#419). All but get_board open with frappe.only_for over the Group roles, so an Entity Accountant is refused. The seven card methods and seven chart methods are POST because Frappe's number card and chart widgets call a Custom source with frappe.xcall, which POSTs; they write nothing. Each refuses a non-empty filters argument ("take no filters") rather than ignoring it. The period they read is the current period: the working landing of period_api.get_context, and for charts the current fiscal year up to and including it. A card the readers cannot draw returns a gray "Cannot read: ..." card (a ValueError from a reader or model); a chart that cannot be drawn throws a ValidationError "<chart title> cannot be shown: <reason>", which the widget shows inside the chart.
| Method | Verb | Roles | Purpose | Key params | Returns |
|---|
overview_api.close_status | POST | Group roles | The current period close status, e.g. "FY2025 P07 · Amber" | filters (must be empty) | HTML: an indicator pill linked to a Desk route |
overview_api.trial_balances_in | POST | Group roles | Trial balances in / expected, cut to the caller's entity scope | same | same |
overview_api.waiting_for_me | POST | Group roles | How many documents the caller may approve now (the My work count) | same | same |
overview_api.ic_over_tolerance | POST | Group roles | Intercompany pairs over tolerance in the last build (counts, unscoped) | same | same |
overview_api.tb_exceptions | POST | Group roles | Submitted TB Exceptions for the current period that the caller may read | same | same |
overview_api.warehouse_freshness | POST | Group roles | Whether the consolidated numbers are current | same | same |
overview_api.get_checklist | GET | Group roles | The current period close checklist: readiness, equity rates awaiting approval, intercompany, draft journals, build, sign-off | — | {title, reason, lines, done, total}; with no current period, lines is empty and reason says why |
charts_api.tb_submission_progress | POST | Group roles | Trial balances submitted and excepted by period, current fiscal year | filters (must be empty); the other widget arguments (chart_name, refresh, time_interval, timespan, from_date, to_date, heatmap_year) are accepted and ignored | {labels, datasets: [{name, values}]} |
charts_api.net_sales_and_result | POST | Group roles | Net sales and net result by period for the default root group; net sales is the Close Settings "Net Sales Heading" | same | same |
charts_api.top_ic_differences | POST | Group roles | The ten largest IC differences by pair, current period (masked to the caller) | same | same |
charts_api.approvals_backlog | POST | Group roles | Documents waiting for approval, by document type | same | same |
charts_api.closing_vs_average_rate | POST | Group roles | Closing and average rate of the three functional currencies held by the most Active entities the caller sees, into the default group's reporting currency | same | same |
charts_api.entities_by_status | POST | Group roles | Entities (not group nodes) by status | same | same |
charts_api.days_to_close | POST | Group roles | Days from period end to sign-off for the periods whose latest run is signed | same | same |
mywork_board_api.get_board | GET | All close roles | mywork_api.get_my_work laid out as cards in Blocking, To do and Waiting columns; reads nothing else | — | {columns: [{kind, label, cards}], message, list_view} |
Example
curl "http://localhost:8069/api/method/konsol.close.signoff_api.get_signoff?fiscal_year=2026&fiscal_period=10" \
-b "cookies.txt"
curl -X POST "http://localhost:8069/api/method/konsol.close.checks_api.run_checks" \
-H "Content-Type: application/json" -b "cookies.txt" \
-d '{"fiscal_year": 2026, "fiscal_period": 10}'
Where the rules live
- Period status and the declared calendar:
konsol/period_status.py, konsol/fiscal_calendar.py, doctype EPM Fiscal Year.
- The sign-off gate:
konsol/close/signoff_gate.py.
- Each screen's pure logic is in a
*_model.py next to its *_api.py; the model files import no Frappe and are unit-tested on the host.
- Per-endpoint tests:
konsol/tests/test_close_*_api.py.