Recurring baskets and rewards

Recurring baskets, due runs, and the loyalty program.

/dashboard/platform/subscriptions needs canManageOrders. Data comes from groceryRecurringOverview.

Recurring baskets

A Subscription links a customer and product with quantity, frequency (weekly, biweekly, monthly), nextDeliveryDate, pausedUntil, and a status. Customers manage them at /subscriptions with manageGrocerySubscription(action, ...):

ActionEffect
createQuantity 1 to 10000, frequency, first run time
pauseNeeds pausedUntil. Not allowed on an inactive subscription
resumeBack to active
skipMoves to the next occurrence
cancelCancels it and any pending runs
prepareBuilds the basket for a due run

A due run prepares a basket for the customer to check out. It does not place an order. Staff press run due baskets on this page (processDueGrocerySubscriptions). The worker:subscriptions process does the same on a schedule.

Loyalty

configureGroceryLoyalty(name, earnPointsPer100Cents, redeemPointsPer100Cents, minimumRedemptionPoints, isActive) sets the store's single program. Customers see points with getGroceryLoyalty and redeem with redeemGroceryLoyalty(points, idempotencyKey). Refunds reverse the points earned.

On this page