Set up the cron job
How to run Tidemark Billing's scheduled tasks with a command-line cron entry or a web cron URL.
Renewal invoices, reminders, suspensions, automatic payments and support email pickup all run from the scheduler. You start it with one cron entry that runs every minute. Docker users can skip this article, because the image does it for you.
What the scheduler runs#
| Task | When | What it does |
|---|---|---|
billing:run |
Daily at 02:30 UTC | Creates renewal invoices, sends reminders, suspends and terminates overdue services, processes cancellations, expires quotes, applies due plan changes, sends trial reminders, retries pending provisioning |
billing:autopay |
Hourly | Charges saved payment methods for due invoices and retries failed charges |
queue:work |
Every minute | Processes queued jobs such as webhook deliveries and provisioning. Only added when the queue is not sync and no external worker is set |
tickets:fetch |
Every minute | Pulls support email from IMAP mailboxes. Only does anything when support tickets are switched on |
Command-line cron (recommended)#
- Open Settings → System. Under Scheduled tasks, find Command-line cron (recommended).
- Copy the line shown. It has your server's real PHP and
artisanpaths filled in. - Add it as a cron job with your host (in cPanel, Cron Jobs).
The line looks like this, with your own paths:
* * * * * php /home/you/billing/artisan schedule:run >> /dev/null 2>&1
Web cron (no command-line cron)#
If your host cannot run a cron command, use a URL instead.
- Open Settings → System.
- Under Web cron, select Generate URL.
- Set up a job at your host, or an external service, that requests the URL every minute. For example:
wget -q -O /dev/null "https://billing.example.com/cron/TOKEN".
Each request runs schedule:run and answers with the text ok. A wrong token returns a 404.
You can also set the token yourself with BILLING_CRON_TOKEN in .env. When it is set, it takes precedence over the generated one.
Anyone who has the URL can start a run, so keep it private. Regenerate URL invalidates the old one, so update your cron job afterwards.
Check that it works#
On Settings → System, Run billing tasks now runs the billing tasks once and shows how many items each one handled. Note this tests the billing run itself, not whether your cron entry is calling the scheduler.