Billing and Scheduled Operations
Configure renewal behavior, validate dry runs, and monitor the platform's in-process job scheduler.
The platform records initial purchases and runs scheduled billing for renewals and related service actions. Review the billing configuration before enabling financial automation.
Review the engine
Open System → Billing Engine at /office/billing for run history and available operations. Configure billing values through System → Settings.
The billing engine defaults to dry run enabled. Dry runs record proposed actions without creating renewal invoices, charging cards, sending billing messages, or suspending or terminating services. Dry run applies to the engine; it does not make normal checkout a simulated payment flow.
Settings that affect customers
Review the stored values rather than assuming defaults fit your service agreement:
| Setting | Purpose |
|---|---|
billing_enabled | Master switch for billing engine execution |
billing_dry_run | Logs intended actions while financial automation remains inactive |
billing_cron_hour | Daily execution hour in server-local time |
billing_invoice_lead_days | How early to create renewal invoices |
billing_reminder_days_before | Reminder offsets before the due date |
billing_overdue_notice_days | Notice offsets after the due date |
billing_autocharge_enabled | Whether to attempt charges using stored payment methods |
billing_autocharge_max_attempts / billing_autocharge_retry_days | Retry limits and spacing |
billing_auto_suspend_enabled / billing_suspend_after_days | Whether and when overdue services are suspended |
billing_auto_terminate_enabled / billing_terminate_after_days | Whether and when overdue services are terminated |
billing_license_expiry_grace_days | Billing entitlement grace after the service due date |
Billing entitlement grace is separate from the CMS's 15-day local validation cache and five-day connectivity allowance. Do not use one mechanism's timing to explain another.
Enable live automation deliberately
- Keep dry run enabled while reviewing representative due and overdue services.
- Verify billing cycles, next due dates, prices, and invoice balances.
- Confirm renewal mail delivery, Stripe webhook settlement, and provisioning actions.
- Review proposed suspension and termination actions against your published terms.
- Turn dry run off only when the proposed behavior is correct.
- Inspect the first live run and its financial and service outcomes.
Termination can remove hosted resources through a provisioning integration. Assign clear responsibility for that setting and the recovery process.
Scheduler behavior
The job scheduler runs inside the persistent Next.js server. It is on by default in production and off in development. SCHEDULER_ENABLED explicitly overrides that behavior, including disabling it in production.
Job schedules can be overridden through the supported environment or database schedule settings. Schedules are resolved at startup, so restart after changing a cron expression. Record the server timezone when setting execution times.
The scheduled runner uses database leases to coordinate instances. Keep the application continuously running; static hosting or a serverless process that sleeps between requests is not a substitute for this scheduler.
External triggers
CRON_SECRET protects externally reachable job endpoints, including the billing and unverified-account cleanup routes. An external caller supplies it as a bearer token. The in-process scheduler does not need that token to run jobs.
External triggers are optional operational tools, not a requirement to make the built-in scheduler work.
Reconcile failures
For a paid invoice with incomplete fulfillment, investigate the existing invoice, transaction, service, and provisioning result. A registrar renewal failure, license activation issue, or deployment failure may require a separate repair after payment has been recorded.
Use the supported retry or settlement controls after reviewing the record. Avoid creating duplicate charges or marking an invoice paid simply to hide a failed provider operation.