Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscription models

The subscription model object and the allowed CRUD operations on the related resource endpoint

A subscription model determines how automatic order subscriptions using recurring order copies are generated for the associated market. The subscription model defines which subscription frequencies are available in that market. Those available frequencies can be specified for the orders' line items. Based on the line items that have a frequency, the necessary order subscriptions are generated, according to the specified subscription strategy.

Subscription frequencies

To set the allowed subscription frequencies, use the frequencies attribute and populate it with an array of strings chosen from this list:

  • hourly

  • daily

  • weekly

  • monthly

  • two-month

  • three-month

  • four-month

  • six-month

  • yearly

If you need to use a custom frequency that is not in the above list, crontab expressions are also accepted, as long as it is not more frequent than every hour. For example, 30 * * * * (minute 30 of every hour) is allowed, while * * 1 * * (every minute of the first day of the month) is not.

Subscription strategies

To set the subscription strategy for the associated market, use the strategy attribute. At the moment, two strategies are available:

  • by_frequency — one order subscription is generated for each distinct frequency specified across the source order's line items, each with its related order subscription items (default strategy).

  • by_line_items — an order subscription is generated for any source order's line item that has a frequency, each with the related order subscription item.

Automatic subscription activation and cancellation

By default, the generated order subscriptions are automatically activated. Set the auto_activate attribute to false if you want to override this behavior.

If you set the auto_cancel attribute to true (default is false), the created order subscriptions will be automatically cancelled in case the source order is cancelled.

How-to

Check the related guide to learn more about how to configure a subscription model and generate automatic subscriptions from a source order.

Last updated