Billing Automation
What the scheduler does on its own, including suspensions, terminations, balance renewals and more, and how to tune it.
Most day-to-day billing work runs on its own. The scheduler runs every minute from your server's cron, and the queue worker carries out the heavy jobs it starts. You only decide the rules.
Automation only works if the cron entry and the queue worker are both running. The admin dashboard warns you when the queue worker is down. Every scheduler run is recorded under Admin → Schedule Logs.
The renewal timeline
For a recurring order with the default settings:
Day 0 Due date +3 days +7 days
│ │ │ │
Order paid ──────▶ Payment due ───▶ SUSPENDED ────────────▶ TERMINATED
(customer can (service stopped, (service deleted,
still renew) data kept, customer cannot be undone)
can still renew)- The Suspension Period (default 3 days) and Termination Period (default 7 days) are counted from the due date. Change them under Settings → Metrics & Options.
- One-time orders have no due date and are never suspended or terminated automatically.
- Orders with an active subscription keep moving their due date forward, so they don't expire while the subscription is active.
Scheduled tasks
| Task | Frequency | What it does |
|---|---|---|
| Suspend expired orders | Every 3 hours | Suspends active orders whose due date is more than Suspension Period days in the past. Customers are emailed, and the primary admin gets a summary. |
| Terminate expired orders | Every 3 hours | Terminates suspended orders whose due date is more than Termination Period days in the past. Customers are emailed, and the primary admin gets a summary. |
| Balance auto-renewals | Daily | Renews overdue orders that have auto balance renew turned on, by deducting the price from the customer's balance. If the balance is too low, the customer is emailed instead. |
| Update currency rates | Daily | Refreshes market exchange rates for your currencies. |
| Send mass mails | Every minute | Sends queued and scheduled mass mails. |
| Test server connections | Every 5 minutes | Checks the health of every server connection, sends alerts and pauses purchasing if needed. |
| Check for updates | Every 30 minutes | Checks GitHub for new WemX releases. |
| Check marketplace updates | Daily | Checks for new versions of extensions installed from the marketplace. |
| License check | Every 3 hours | Reports the license as active. |
| Heartbeat | Every minute | Records that the scheduler is alive. |
Extensions can add their own tasks. The Tickets module, for example, closes inactive tickets every hour.
Customer-side renewal options
Customers have three ways to keep an order active:
- Manual renewal. On the order page, choose a period (or a custom end date) and pay the invoice. The price is the order's daily rate times the number of days.
- Auto balance renewal. Turn on the switch on the order page. The scheduler then pays renewals from the account balance.
- Subscription. Attach a subscription gateway so the provider renews the order automatically.
Renewing a suspended order moves its due date forward, but in the current beta it doesn't unsuspend the service automatically. Unsuspend the order from the admin panel after the customer pays.
Running tasks by hand
Every task is an Artisan command, which is useful for testing or catching up after downtime:
php artisan cronjobs:orders:suspend-expired
php artisan cronjobs:orders:terminate-expired
php artisan cronjobs:orders:renew-balance-renewals
php artisan cronjobs:update-currency-rates
php artisan server-connections:test