> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_housing/features/billing-and-rent.md).

# Billing and Rent

`rcore_housing` runs an automatic billing loop for rent and utilities. The defaults work out of the box - see [billing configuration](/paid-resources/rcore_housing/configuration/billing.md) for every knob.

## ⏱️ Cycle

```
[ cycle starts ] ──30 days──▶ [ bill issued ] ──1 day grace──▶ [ in-game grace 2h ] ──▶ [ eviction / cutoff ]
```

| Phase          | Default   | Description                                                  |
| -------------- | --------- | ------------------------------------------------------------ |
| Cycle          | `30` days | How often a new bill is generated for rent and utilities.    |
| Grace          | `1` day   | Wall-clock grace period before penalties trigger.            |
| In-Game Grace  | `2` hours | Extra time that only counts down while the player is online. |
| Check Interval | `1` hour  | How often the server scans for due bills.                    |

The check interval and time units flip to seconds in `TestMode` - see the warning in [billing configuration](/paid-resources/rcore_housing/configuration/billing.md).

## 💰 Owner Payouts

```lua
Config.Billing.OwnerRentShare = 90
```

Rent paid by a tenant is split: the owner receives `OwnerRentShare` % and the remainder is voided as a system fee. Defaults to 90 / 10.

`Config.Billing.RentedUtilitiesPayer` (`'tenant'` or `'owner'`) decides who covers utilities on rented properties.

## 💸 Advance Payments

Tenants can prepay multiple months at a discount:

| Months | Discount |
| ------ | -------- |
| 1      | 0%       |
| 3      | 5%       |
| 6      | 10%      |
| 12     | 15%      |

`Config.Billing.MaxPrepaidDays` (default 31) caps the absolute number of days that can be prepaid.

## 🚪 Eviction & Cutoff

If a bill goes unpaid past Grace + In-Game Grace:

* **Rent**: the tenant is evicted - their role and keys are removed, and the property becomes available again.
* **Utilities**: the property's utilities are cut. Use the [server API](/paid-resources/rcore_housing/api/server.md) (`HasUtilities`, `HasElectricity`, `HasWater`) to gate gameplay on this state.

## 📒 Ledger

Every payment is recorded in `rcore_housing_rent_ledger`. The property dashboard shows a per-cycle payment history for both owner and tenant.

## 🧪 Test Mode

```lua
Config.Billing.TestMode = true
```

Switches every time unit to seconds. Convenient for testing eviction flow during QA - make sure to flip it back off for production.
