Overview of the concepts related to Recurring Orders and the checkout process.
General concepts
Recurrence Policies
A Project can have multiple Recurrence Policies at the same time and they can be reused across different Recurring Orders.
You have two options for choosing a schedule:
- StandardSchedule: daily, weekly, or monthly
- DayOfMonthSchedule: a specific date of each month
Standard schedules
intervalUnit, for example Days, Weeks, or Months, and also the value field, which represents the number of intervals between orders.| Order frequency | Value | Interval unit |
|---|---|---|
| Daily | 1 | Days |
| Weekly | 1 | Weeks |
| Monthly | 1 | Months |
| Every 10 days | 10 | Days |
| Every 2 weeks | 2 | Weeks |
| Every 3 months | 3 | Months |
Day of month schedules
Recurring items
Define a schedule or interval
To set the schedule or interval:
-
Create (or add) a Line Item or Custom Line Item with the
RecurrenceInfofield set:- For Line Items
- For Custom Line Items
-
Update a Line Item or Custom Line Item with the
RecurrenceInfofield set:- For Line Items
- For Custom Line Items
Define a price selection mode
A Recurring Order can span several months, resulting in the generation of multiple scheduled orders over time. When selling a product over an extended period, it's common for its price to change—sometimes more than once.
recurrenceInfo field on each recurring item. The price selection mode determines whether Recurring Orders should retain the original item price or adopt the new price going forward.You can choose one of the following price selection modes:
Fixed: the price set at the time the Recurring Order was created remains the same. With this configuration, any changes made to the Product's price will not affect existing Recurring Orders.Dynamic: each time a new order is generated from a Recurring Order, the platform retrieves and applies the current Product price. With this configuration, any updates to a Product's price will affect all existing Recurring Orders going forward.
Prices
Prices (both Embedded and Standalone) carry information about possible recurrence. Each price that is defined on a recurring item must be connected to a Recurrence Policy.
When selecting a price for a Recurring Order, the platform will use the standard price selection rules, along with the specified Recurrence Policy, to determine the correct price for the given SKU and recurrence. If no such price is found, the platform defaults to using the standard one-time purchase price.
monthly recurrence, the platform will attempt to locate a price explicitly tied to that monthly policy.You only need to set recurrence information on prices if you intend to offer special pricing for recurring items; otherwise, no changes to your existing pricing configuration are needed.
For example, to sell yogurt in 3 different intervals, you set a price for each interval:
If you are using external pricing, you can set the price for the individual Line Item or Custom Line Item on the Cart, when creating or updating the Cart.
Recurring Carts
RecurringOrder is known as a recurring Cart and is used as the source to create all subsequent orders generated by a specific Recurring Order. A recurring Cart contains only Line Items and Custom Line Items that are linked to a Recurrence Policy.Recurring Orders
Initial creation
To create a Recurring Order, you can use the following methods:
| Method | Description | Use case |
|---|---|---|
| Create Order from Cart (Orders API) | Automatically checks Line Items and Custom Line Items for recurrence information, and if found, creates a Recurring Order for each recurrence schedule that is found. | Use when the Cart contains a mix of one-time and recurring purchases, or recurring items with different schedules. |
| Create RecurringOrder (RecurringOrders API) | Requires a Cart where all Line Items and Custom Line Items are recurring and share the same recurrence schedule. You can also set the startsAt, expiresAt, and custom fields. | Use when all items in the Cart are linked to the same recurrence schedule and you need additional flexibility to set when the Recurring Order starts or stops, or to store custom information. |
Method A: Create Order from Cart
- On the OrderFromCartDraft, you specify the
cartthat contains items. - An Order is created from the specified Cart.
- The platform evaluates the Line Items and Custom Line Items:
- If no recurrence information is found, no further action is taken.
- If one or more items contain recurrence information:
- Recurring items are grouped by their recurrence schedule (specified in the Recurrence Policies).
- For each group, a new Recurring Order and a new recurring Cart are created.
- Each recurring Cart inherits the base configuration of the original Cart (for example, tax mode, customer group, inventory mode, store, business unit) but contains only the items that belong to that group.
- If multiple shipping methods are used, only the shipping methods and addresses associated with the items in the group are copied to the new Cart.
Example
A customer wants to buy four different products (SKUs). Their Cart has the following items:
| Item | Purchase interval | Ship to |
|---|---|---|
| SKU1 | One-time purchase | Home |
| SKU2 | Weekly | Home |
| SKU3 | Monthly | Office |
| SKU4 | Monthly | Office |
The customer completes the checkout process and receives an email with the confirmation.
Internally, the following steps happen:
- A new Order is created with all four items.
- The platform determines that three of the four items are recurring and groups them by their recurrence interval:
- Group A: SKU2 (weekly)
- Group B: SKU3 and SKU4 (monthly)
- For each group, a new Recurring Order and a new recurring Cart are created.
- The new recurring Carts inherit the base configuration of the original Cart.
This results in the following:
- Recurring Order A: SKU2 is shipped weekly to the home address.
- Recurring Order B: SKU3 and SKU4 are shipped monthly to the office address.
Method B: Create RecurringOrder
- On the RecurringOrderDraft, you specify the
cartthat contains the recurring items. - A new Recurring Order is created.
- The
originfield on the specified Cart changes toRecurringOrder.
Subsequent Orders
Once a Recurring Order is created, the platform automatically creates new Orders based on the defined schedule. Each Recurring Order contains the following information:
cart: the recurring Cart for this Recurring Order. It serves as a blueprint for generating future orders.nextOrderAt: the date and time when the next order will be created.originOrder: the original Order from which this Recurring Order was initiated. This field is only populated when the Recurring Order is created via the Create Order from Cart endpoint.startsAt: date and time when this Recurring Order becomes active and eligible to generate new Orders.schedule: The defined interval that determines how often new orders are generated for this Recurring Order.
Delays can occur due to application or server-side processing.
The following example shows when the next orders are created for a Recurring Order configured with a weekly interval.
| Date | Status | Order created | nextOrderAt |
|---|---|---|---|
| 1 Jul 2025 | Active | ✓ | 8 Jul 2025 |
| 8 Jul 2025 | Active | ✓ | 15 Jul 2025 |
| 15 Jul 2025 | Active | ✓ | 22 Jul 2025 |
| 22 Jul 2025 | Active | ✓ | 29 Jul 2025 |
| 29 Jul 2025 | ... | ... | ... |
OrderCreated Message is emitted only for the initial Order created directly from a Cart.Paused Recurring Orders
You can pause a Recurring Order at any time. When paused, subsequent Orders will not be created until the Recurring Order is reactivated.
The following example shows when the next orders are created for a Recurring Order configured with a weekly interval that has been paused and then reactivated.
| Date | Status | Order Created | nextOrderAt |
|---|---|---|---|
| 1 Jul 2025 | Active | ✓ | 8 Jul 2025 |
| 6 Jul 2025 | Paused by the user | ✗ | empty |
| 19 Jul 2025 | Reactivated by the user | ✗ | 22 Jul 2025 |
| 22 Jul 2025 | Active | ✓ | 29 Jul 2025 |
| 29 Jul 2025 | Active | ... | ... |
Failed Recurring Orders
Failed. The RecurringOrderFailed Message always reports the cause in its failureReason field and can include additional details in its optional errors field.Failed state, and generates no Orders, until you resolve the issue and set it back to Active using the Set RecurringOrder State update action.Payments BETA
RecurringOrder CartOrigin.Payment strategies
| Behavior | No RecurringPaymentConfiguration | Checkout PaymentStrategy |
|---|---|---|
| When the Order is created | Immediately when due | Only after the payment succeeds |
| Who collects payment | You, after the Order exists | commercetools Checkout, before the Order exists |
| If the payment fails | The Order already exists | No Order is created, and the Recurring Order transitions to Failed |
| Inventory | Handled according to the Cart's InventoryMode when the Order is created | Reserved before payment for the TrackOnly and ReserveOnOrder InventoryModes, and released if the payment fails |
Payment allocations
percentage, or an AbsoluteAllocation, expressed as an amount. All allocations in a configuration must be of the same type.Checkout PaymentStrategy, configure a single allocation that covers 100% of the Order total with one Payment Method, so the same Payment Method can be charged for future Orders. For Payment Connector requirements and other constraints, see the Checkout documentation.Use the following update actions on the recurring Cart to manage the configuration:
| Update action | Use to |
|---|---|
| Set RecurringPaymentStrategy | Set the paymentStrategy without changing the existing allocations. If no configuration exists, one is created without allocations. |
| Set RecurringPaymentConfiguration | Set the paymentStrategy and the allocations together, replacing any existing configuration. |
| Add RecurringPaymentAllocation | Add a single allocation to an existing configuration. |
| Remove RecurringPaymentAllocation | Remove a single allocation by its id. |
Checkout payment flow
Checkout PaymentStrategy, the following steps happen:- A snapshot of the recurring Cart is created and frozen with the
HardFreezeFreezeStrategy, so that its total cannot change while the payment is in progress. - Inventory is reserved for Line Items that use the
TrackOnlyorReserveOnOrderInventoryMode. Other inventory modes aren't reserved in this step. - commercetools asks Checkout to charge the Payment Methods in
paymentAllocations. - Checkout processes the payment and reports the result. This step is asynchronous and does not complete within a single API call.
- If the payment succeeds, the Order is created and the inventory reservation is committed. If the payment fails, the reservation is released and the Recurring Order transitions to the
FailedRecurringOrderState.
nextOrderAt; subscribe to the OrderCreatedFromRecurringOrder Message instead.RecurringOrder CartOrigin. It is deleted after the Order is created, or after the payment fails. If the payment succeeds but the Order cannot be created, the Cart copy is kept so that the refund remains traceable. Do not modify these Carts.Payment failures
- The payment fails. Resolve the cause, which is usually a Payment Method that must be updated, before setting the Recurring Order back to
Active. - The payment succeeds but the Order cannot be created. This most often happens when an API Extension rejects the Order creation. commercetools releases the inventory reservation and asks Checkout to refund the payment.
Because a rejection after payment triggers a refund, run validations that can be performed on the Cart as API Extensions on the Cart rather than on Order creation.