Cancellations and Returns

Note: Spartacus 4.x is no longer maintained. Please upgrade to the latest version.

Note: Spartacus 4.x was tested with SAP Commerce Cloud versions 1905 to 2205. Spartacus 4.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.

Note: This feature is introduced with version 1.4 of the Spartacus libraries.

The Cancellations and Returns feature in Spartacus allows customers to request a complete or partial cancellation for an order that has been placed, or a return for an order that has already been received. This allows customers to bypass having to call a customer service agent to cancel or return an order that was placed.

For more information, see Order Cancel Service and Return Service on the SAP Help Portal.

Back-End Requirements

The Cancellations and Returns feature in Spartacus requires SAP Commerce Cloud version 2005.0 or newer. The minimum version of 2005.0 is required because earlier versions do not include the endpoints related to this feature.

You should also consider installing Order Management in the back end. For more information, see Installing Order Management on the SAP Help Portal.

Enabling Cancellations and Returns in Spartacus

The Cancellations and Returns feature is disabled by default in Spartacus.

Since the feature is CMS-driven, the only way to enable it is through the CMS. The following procedure describes the changes you should make to the spartacussampledata extension, or to your own, custom extension.

Note: All of the required CMS data is already included in the spartacussampledata extension.

Enabling Cancellations and Returns through the CMS

  1. Import the following ImpEx to make the AccountOrderDetailsActionsComponent visible:

     INSERT_UPDATE CMSFlexComponent;$contentCV[unique=true];uid[unique=true];visible

    When this ImpEx is imported, the cancel or return action buttons are displayed on the Order Details page. The following is an example:

    Cancel Items Button

  2. Add the All Orders and Returns tabs to the Order History page by importing the following ImpEx:

     UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];cmsComponents(uid, $contentCV)

    By replacing the AccountOrderHistoryComponent with the AccountOrderHistoryTabContainer component in the BodyContent-orders slot, you can then see tabs in the Order History page, as follows:

    Order History Tabs

    These steps can also be done in Backoffice.


No special configuration is required.


No special extensibility is available for this feature.