Recurring Orders

Recurring orders – or subscriptions – is a feature where customers can create a series of future orders which are then automatically generated at a predefined interval, e.g. weekly, or monthly. 

Figure 1.1 Marking an order as a recurring order - and selecting a frequency and end date

At the technical level, a recurring order is created from the shopping cart app by submitting a cart with extra properties:  

  • Create recurring order-checkbox
  • Start date & End date
  • Frequency (Interval & Unit)

When these properties are present, a base order is created instead of a normal order – it serves as a template for future orders. The first time a base order is created, a scheduled task is automatically created. It runs every 5 minutes and generates orders accordingly.

From the backend you can see a list of base orders under Ecommerce > Recurring orders (Figure 1.2).

Figure 1.2 A list of recurring orders

Recurring orders can be created as invoice orders or with automatic payment. Automatic payment is currently supported by the following checkout handlers:

In order to set up automatic recurring payments, a token from the payment provider using the saved cards functionality. If the saved card is not named by the user on creation, it will be named automatically using the ID of the base recurring order. Currently, a user cannot change the credit card information saved on a base order, so if a card expires or a customer desires to use a new card for payment the current recurring order must be canceled and a new recurring order created.

In frontend, the Customer Experience Center app can be configured to show a list of previous and future orders related to a subscription (Figure 1.3). You can also configure the customer center app to allow the customer to cancel and restore individual orders in the series of future orders.

database

This is the database table associated with the Recurring Orders functionality:

EcomRecurringOrder

Contains setup data for recurring orders.

Field name Data type Length
RecurringOrderId int 4
RecurringOrderUserID int 4
RecurringOrderBaseOrderID nvarchar 50
RecurringOrderStartDate datetime 8
RecurringOrderEndDate datetime 8
RecurringOrderInterval int 4
RecurringOrderIntervalUnit int 4
RecurringOrderCanceledDeliveries nvarchar Max
RecurringOrderLastDelivery datetime 8