Automatically repeat a recipient's order on a weekly, fortnightly, or monthly schedule, with stock checks and confirmation flows built in.
Recurring orders let recipients opt in to automatic re-ordering. After completing an order, a recipient can set up a recurring schedule. The system then creates new orders automatically at the chosen frequency, cloning items from the original (source) order. Admins can monitor, pause, resume, or cancel recurring configurations from the admin panel.
A scheduled command (app:recurring-orders:create) runs via cron to process due configurations and create orders.
A recurring order config can be in one of three states:
| State | isActive | pausedAt | Description |
|-----------|------------|-------------|------------------------------------------------------|
| Active | true | null | The system will create orders on schedule. |
| Paused | false | set | Temporarily stopped. Can be resumed by an admin. |
| Cancelled | false | null | Permanently stopped. A new config must be created. |
Only one active config can exist per customer at a time. Creating a new config automatically cancels any existing active one.
isActive = true.The schedule calculator uses the source order's pickup date and the pickup location's delivery day to determine future dates. All calculations respect your food bank's configured timezone.
Weekly: Finds the next occurrence of the pickup location's delivery day after the source order date. If the delivery day has changed at the location since the original order, the current delivery day is used instead.
Fortnightly: Finds the next delivery day, then skips ahead one additional week to land approximately two weeks from the reference date.
Monthly: Finds the delivery day in the next month that falls closest to the same day-of-month as the original pickup. For example, if the original pickup was on the 15th and the location delivers on Wednesdays, the system picks the Wednesday nearest the 15th of the following month. If the target day exceeds the month's length (e.g. the 31st in February), it targets the 1st of the following month instead.
After each order is created, the schedule advances to the next date using the same logic.
The app:recurring-orders:create command runs on a schedule (typically daily) and processes all due configs. For each config whose nextScheduledDate is in the past or present:
nextScheduledDate to the next future date.When the system detects stock issues, it follows different paths:
When stock issues trigger a confirmation requirement:
The system sends three types of email related to recurring orders:
| Email | When sent | |------------------------------|-------------------------------------------------------| | Order created | After a recurring order is successfully created | | Stock issue | When some items were skipped due to stock problems | | Confirmation required | When some items are unavailable before order creation |
All emails are sent to the customer's email address and include relevant details such as the pickup location, pickup date, frequency, and item lists.
/admin/recurring-orders).pausedAt timestamp. No further orders will be created until resumed.pausedAt timestamp.How does a recipient set up a recurring order? From their account area after completing an order. They select a completed order and choose a frequency.
Can a recipient have multiple active recurring orders? No. Only one active config per customer is allowed. Creating a new one cancels the previous one.
What frequencies are available? Weekly, fortnightly (every two weeks), and monthly. Your food bank's settings control which frequencies are offered.
What happens if the pickup location changes its delivery day? The schedule calculator uses the pickup location's current delivery day. If the day changes, future orders will align to the new day.
What happens if items go out of stock? If some items are unavailable, the system pauses the config and emails the recipient a confirmation link. If all items are unavailable, the order is skipped and the schedule advances. If items become unavailable mid-creation, the order is created with available items and a stock issue email is sent.
Can admins create recurring orders on behalf of recipients? No. Recurring orders are created by recipients from their account area. Admins can only manage (pause, resume, cancel) existing configs.
How often does the system check for due orders?
The app:recurring-orders:create command should be set up as a cron job. The recommended frequency is daily, but it depends on your operational needs.
What timezone are scheduled dates stored in? Schedule calculations are performed in your food bank's configured timezone. The resulting dates are stored in UTC in the database.
Does the system check order limits? Yes. Before creating an order, the system checks whether the customer has reached their maximum order allowance. If they have, the order is skipped and the schedule advances.