PERIOD_CLOSE journal entry that transfers that net result to Retained Earnings. From that point forward, the period’s records are read-only — they can be viewed and reported on, but no one can create, edit, or delete transactions dated within the closed window. This gives your organization an immutable historical record and clear, auditable period boundaries.
periods:close permission to close or undo a period, and reports:read to run the preview. Contact your administrator if you need either permission.Why Close Periods
Closing periods is not just a bookkeeping formality. It serves several interconnected purposes:- Data integrity. Once closed, no one can accidentally (or deliberately) backdate a transaction into a finalized period. Reports generated from closed periods will always return the same numbers.
- Accounting accuracy. The closing entry zeroes out all income and expense accounts and transfers the net balance to Retained Earnings, resetting temporary accounts so the next period starts clean.
- Audit compliance. External auditors expect to see period boundaries enforced. A permanent, sequential close history demonstrates that your organization operates proper internal controls.
- Operational confidence. Distributed volunteer organizations are especially prone to accidental backdating. Period closing eliminates that risk entirely.
The Closing Workflow
Always preview before you close. The preview endpoint shows you exactly which period will be affected, the net income figure, and any warnings — without touching your data.Preview the period close
periodStart, periodEnd, and netProfitLoss, and surfaces any validation warnings you should resolve first. If the system cannot close right now (for example, the current period has not yet ended), canClose returns false along with a reason.Reconcile and verify
netProfitLoss from the preview against your Profit & Loss report for the same period. Confirm that all deposits, loan payments, and expenses for the period have been posted, and that no DRAFT journal entries remain. Address any items listed in validations.warnings before proceeding.Get sign-off
Generate a unique idempotency key
x-idempotency-key header to prevent duplicate closes if a request is retried. Generate a key that uniquely identifies this specific close operation.Execute the period close
PERIOD_CLOSE journal entry created:What Happens Automatically
Period Determination
Agatabo determines which period to close automatically — you do not specify dates manually.- First-ever close: The system identifies the earliest transaction date in your organization (or the organization creation date if no transactions exist) and closes the period that contains it.
- Subsequent closes: The system identifies the last closed period’s end date and closes the period immediately following it. Periods must always be closed in strict chronological order — you cannot skip a period.
- Current period protection: Agatabo will never close the period that contains today’s date. Only fully elapsed past periods can be closed.
Income and Expense Analysis
For each period close, Agatabo scans all POSTED journal entries (excluding any previousPERIOD_CLOSE entries) within the period’s date range and identifies every INCOME and EXPENSE account with a non-zero net balance.
The PERIOD_CLOSE Journal Entry
Agatabo creates a single balanced journal entry of kindPERIOD_CLOSE, dated at the last moment of the closing period. This entry zeros out every income and expense account and transfers the net result to Retained Earnings:
- INCOME accounts (normal credit balance): DEBIT the account to zero it out; CREDIT Retained Earnings.
- EXPENSE accounts (normal debit balance): CREDIT the account to zero it out; DEBIT Retained Earnings.
- Interest Income balance: 0
- Operating Expenses balance: 0
- Retained Earnings balance: +125,000 RWF
Transaction Lock
You retain full read access to closed periods. You can view historical transactions, generate reports, export data for audits, and inspect journal entries — you simply cannot modify them.Sequential Closing Enforcement
Agatabo enforces strict sequential closing. You must close periods in the exact chronological order they occurred.| Scenario | Result |
|---|---|
| Close January → close February → close March | ✅ Allowed |
| Close January → skip February → close March | ❌ Not allowed |
| Close most recent open period | ✅ Allowed |
Undoing a Period Close
When to Undo
Undo a period close only when a material error was discovered that cannot be corrected in the current period — for example, a significant misposted transaction, a bank reconciliation discrepancy, or an auditor-required adjustment. For immaterial errors, the recommended approach is to post a correcting entry in the current open period with a clear description referencing the original error. This is less disruptive and preserves the integrity of the closed period.Limitations
- You can only undo the most recently closed period. If January, February, and March are all closed, you can undo only March.
- To undo January, you must first undo March, then February, then January — one at a time, in reverse order.
- You cannot undo the same period twice in a row.
How to Undo
PERIOD_CLOSE entry as REVERSED, then creates a new reversal journal entry with the opposite debits and credits. The period reopens immediately — you can now post corrections.
After the undo:
- Make all required corrections.
- Re-run your Profit & Loss and Balance Sheet reports.
- Obtain re-approval from management.
- Re-close the period following the standard workflow above.
Year-End Closing
Year-end closing in Agatabo is an extension of monthly (or quarterly) closing, not a separate process. Once you have closed every period in the fiscal year, your annual financials are complete.Close all periods in the fiscal year
Close the final period
Generate annual financial statements
Verify Retained Earnings
Complete external audit (if required)
Common Errors
"No completed accounting period available to close"
"No completed accounting period available to close"
"x-idempotency-key header is required"
"x-idempotency-key header is required"
x-idempotency-key header.Solution: Add a unique key to your request. A simple formula is period-close-YYYY-MM-DD-{timestamp}. The key prevents accidental duplicate close operations if a request is retried."No closed period available to undo"
"No closed period available to undo"
GET /period-closing/preview first to confirm the current close state. If no periods are closed, there is nothing to undo."Last closed period has already been undone"
"Last closed period has already been undone"
"Transaction date in closed period"
"Transaction date in closed period"
"User is not part of this organization"
"User is not part of this organization"
x-organization-id header, or the header contains an incorrect organization ID.Solution: Verify that the x-organization-id header matches your organization’s ID and that the user holds a valid role in that organization.Audit Trail
Organization Settings
Permissions
periods:close and how to grant it safely.