Locking & Books Closed
Understanding data modification restrictions and period locking
Locking & Books Closed
VRPlatform uses locking mechanisms to maintain accounting integrity and prevent unauthorized modifications to historical financial data. Understanding these rules is essential for API integrations.
Overview
There are two types of locking:
- Period Locking (Books Closed): Prevents modifications to data before a specific date
- Statement Locking: Prevents modifications to data attached to owner statements
Books Closed (Period Locking)
What is Books Closed?
The "books closed" date marks the first open date for your accounting period. Any transaction dated before this date is considered locked and cannot be modified.
Example: If books are closed at 2024-08-01, then:
- July 31, 2024 and earlier = Locked (cannot modify)
- August 1, 2024 and later = Open (can modify)
What Gets Locked?
When data falls in a closed period, these operations are blocked:
| Entity | Blocked Operations |
|---|---|
| Deposits | Create, edit, delete, archive, unarchive |
| Expenses | Create, edit, delete |
| Transfers | Create, edit, delete |
| Reservations | Sync changes, cancel/uncancel, add/delete adjustments |
| Recurring Fees | Add, edit, template changes |
| Listings | Deactivate, reactivate, change business model |
Exceptions
Some operations are not affected by books closed:
- Bank reconciliation (matching/unmatching records)
- Owner statement status changes
- Changing expense payment date (if new date is in open period)
Example Scenario
Expense created: January 15
Payment date: February 2
Books closed at: February 1
Allowed:
- Mark expense as unpaid
- Change payment date to February 5 (in open period)
Not allowed:
- Change payment date to January 30 (in closed period)
- Delete the expenseStatement Locking
What is Statement Locking?
When data is attached to an owner statement, it becomes locked to preserve the statement's accuracy. This applies regardless of whether the statement is published, in review, or draft - any attachment locks the data.
What Gets Locked?
Any financial data attached to an owner statement cannot be modified, including:
- Reservation adjustments
- Transaction lines
- Fee calculations
Why This Matters
If you try to modify locked data, the API will return an error. You must first:
- Delete the owner statement
- Make your modifications
- Re-create the statement
Account Locking
Accounts have special locking rules because they can be affected by both period and statement locks.
| Operation | Rule |
|---|---|
| Change account type | Blocked if any locked transactions exist |
| Change account category | Blocked if any locked transactions exist |
| Deactivate account | Blocked if any locked transactions exist |
| Change account name | Always allowed (cosmetic change) |
| Delete account | Blocked if any locked transactions exist (archives instead) |
Statement Layout Locking
Statement layouts (templates) are locked when any owner statement uses them:
| Operation | Rule |
|---|---|
| Update layout | Blocked if any statement is attached |
| Delete layout | Blocked if any statement is attached |
To modify a locked layout, you must first delete all statements using it.
Handling Locked Data in Your Integration
Checking for Locks
Many API responses include an issues array that indicates lock status:
{
"id": "abc123",
"issues": [
{
"code": "locked",
"severity": "warning",
"context": {
"attachedStatementCount": 3
}
}
]
}Common Lock Issue Codes
locked- Data is locked and cannot be modifiedpriorToClosedPeriod- Transaction date is before books closed
Best Practices
- Check books closed date before creating backdated transactions
- Verify statement attachment before modifying data
- Handle lock errors gracefully in your integration
- Use the issues array to detect potential problems before attempting modifications
Related Topics
- Owner Statements - Statement lifecycle and publishing
- Transactions - Creating and modifying transactions
- Accounts - Account management and status
