Support shopper-initiated order management

Once an order is created, Oracle Commerce provides functionality that allows the shopper to manage the order.

This section describes how to configure Commerce so that shoppers can initiate cancellations, returns, or exchanges on orders they have placed through their account.

Support shopper-initiated cancellations

You can configure the Order Details widget on the Order Details layout to enable shopper-initiated cancellations. Once this is done a shopper may initiate a cancellation on an order they have placed provided the following criteria are met:

  • The remorse period is enabled in the Admin settings for your site.
  • The order is within the remorse period.
  • The order status is QUEUED, or all of the following status criteria are met:
    • The order status is not CANCELLED, NO_PENDING_ACTION, PENDING_APPROVAL, PENDING_REMOVE, QUEUED, or REMOVED.
    • The paymentGroup status is not SETTLED.
    • The shippingGroup status is not NO_PENDING_ACTION.
    • No item within the order has a status of DELIVERED.

If each of these criteria are met, a Cancel Order button is displayed to the shopper when they review an order on the Order Details layout. When the shopper clicks on the button, they are asked to select a reason for cancelling the order and to confirm the cancellation. Once the cancellation is confirmed, Commerce uses the order cancellation webhook to instruct the fulfillment system to cancel the order and updates the order status accordingly. An email is then sent to the shopper telling them that their order has been cancelled.

To configure shopper-initiated cancellations on your site you must:

  • Enable the remorse period for your site. For further information on enabling the remorse period, refer to the Set the customer remorse period.
  • Ensure you have an Order Details layout that contains an Order Details widget instance. From the Design page, open the Grid View for the Order Details layout and click on the Settings icon on the Order Details widget instance. Check the Enable Shopper Initiated Cancel box and click Save.

If you need to add the Order Details widget to the Order Details layout on your site, refer to the Add widgets to a layout section of Customize your store layouts for more information.

Support shopper-initiated in-flight cancellations

You can configure Oracle Commerce so that user can cancel an order post the remorse period, using the extended remorse period option. The user can also cancel an order post the remorse period, that is, after the order is submitted for fulfillment by Order Submit Webhook.

To configure shopper-initiated in-flight cancellations on your site you must enable the Extended Remorse Period in the admin settings for your site. From the Oracle Commerce administration UI, Agent Console Settings, Extended Remorse Period, click the checkbox Enable Extended Remorse Period, and specify the number of days from the date of submission during which orders can be cancelled.

The pointOfNoRevision property, which is updated by the fulfillment system and when set to true, indicates that the item has passed the point at which the fulfillment system can prevent the item from being shipped or provisioned. When a shopper selects to cancel an inflight order, if any item in the order has passed the point of no revision (pointOfNoRevision = true) then the system returns an error indicating that this order cannot be cancelled.

Note:Remorse Period and Extended Remorse Period are independent settings that are not mutually exclusive, in that both periods start from the time that the shopper places the order. While the Remorse Period actually delays the submission of the order to the fulfillment system, the Extended Remorse period applies even if the order has already been submitted to fulfillment.

Setup for the validateCancel SSE

You need to setup the SSE validateCancel or shopper-initiated in-flight cancellations would not be able to validate if the order is within the extendedRemorsePeriod. The SSE validateCancel is only triggered with the sample widget and not the OOTB widget.

Below SSEs are available in the Admin Developer: Validate-cancel-app-store.zip (storefront), Validate-cancel-app-agent.zip (Agent), and OrderQualification.zip . The Validate-cancel-lib.zip SSE (required), is included in other two SSEs. You do not need not download it.

Download the SSE validateCancel by clicking Admin UI, Developer tab. Once you download the SSE, you will need to edit the configuration file in SSE. When you download each SSE, refer to the README file for instructions.

Note: You must upload these SSEs to the node server. You need not download the library file here, since the library file contains the classes and would be packaged as node-modules when either download of the store/agent SSEs.

How to initiate and submit flow for cancel order

To initiate a Cancel Order, you can use this endpoint:

/ccstoreui/v1/orders/initiateCancelOrder POST
/ccagentui/v1/orders/initiateCancelOrder POST

Or, if you are using custom widget, after making a call to the SSE, which validates if the order is still within the ExtendedRemorsePeriod, you can click the Cancel order button in the custom widget Order details.

When you click the Cancel order button in the order details page (after remorse period has expired and within extended remorse period), following occurs:

  1. A Cancel order is created (clone of original order with prices made zero)
  2. An in-memory return request is created. This means a return request object that is not persisted and just stays in memory. This return request facilitates the refunds for items with one time price.
  3. The Cancel summary page displays the details of the cancel order and return request.

    Note: This cancel order summary is an OOTB widget. The order details widget has code to handle the invocation of the initiateCancelOrder endpoint and redirection to this page and display this widget.

To submit a Cancel Order, you can use this endpoint:

/ccstoreui/v1/orders/submitCancelOrder PUT
/ccagentui/v1/orders/submitCancelOrder PUT

Or you can use the Cancel order summary widget in cancel checkout page

Once the user reviews the Cancel order summary and clicks on Confirm button, the submit cancel order flow is triggered and the following occurs:

  1. The Order qualification webhook is triggered which will trigger the Order qualification pipeline and the validate cancel module will check if the cancellation is still allowed. You need to use this webhook to check whether the order is still in extended remorse period. If you do not use this webhook, it will not check for extendedRemorsePeriod. You will need to configure this webhook before using this feature, using the latest version of OrderQualification SSE.
  2. Other validations are performed to check if there is any change in the original order.
  3. When validation passes, the in-memory return request (created in the initiate cancel order) is submitted and confirmed. Note: The first time the return request is created, it is just to return the refund values and is not persisted on the server. On submit cancel, the return request is created again and that one is submitted and confirmed. All items in this return request will be marked as returnRequired = false. This is because in 19A, cancel in-flight can be triggered only when all items have PONR=false. Therefore, none of these items need to be returned (since they never got shipped). The return request is created for the sole purpose of refund.
  4. The cancel order is then submitted (as a zero value order) using the existing submit order flow and sent to the fulfillment system for further processing. The state of the original order is changed to REMOVED, while the order still remains in the database.

Note: If you use the Cancel order summary widget in cancel checkout page, and if before submitting, you try to navigate to some other page, you cannot resume your cancellation. You will have to initiate the cancel again and submit the order. For orders for which cancel was initiated but not completed, a scheduler runs to clean them up.

Initiate the appropriate Terminate asset operation in the asset management system (CPQ)

When an in-flight order is cancelled, some items in that order may be assets in Oracle CPQ and need to be terminated. Manage this by using the Order Asset Operation SSE and related webhooks:

Server Side Extension Endpoint Order Asset Operation

Item Description
SSE Order Asset Operation
Endpoint Name Order Asset Operation
Trigger The endpoint can be triggered by the Order Asset Operation webhook.
Inputs:

Order - the original order that is being cancelled.

Operation - Terminate. This webhook may be used for Terminate and Get Assets

Returns

Collection of items containing:

BOM - A configured item or Bill of Materials that represents the terminate asset instructions.

Asset ID - The asset ID to which the BOM relates.

Commerce Item ID - the ID value for the order item that corresponds with the asset record, that is, the order item that resulted in the creation of the asset.

Note the following:
  • If any item in the original order has become an asset in CPQ, the cancel order flow will take care of the termination of those assets.
  • Sub items of an configurable item (with soldAsPackage=false) can be tracked individually for return.

    If an configurable item in the original order has soldAsPackage=false, each sub item will have its own shippingGroupCommerceItemRelationships. When a return request is created there will be corresponding return items for those sub items, which will help in tracking the return status of the sub items when return is initiated on the root item.

    Note: Return of a sub item alone is not supported.

Non-Shippable items

Non-shippable items are items that cannot be physically shipped, such as mobile phone tariffs, IPTV packages, downloadable items, etc. For these items, the administrator can set the shippable flag at the item level. From Oracle Commerce administration, select Catalog, item, General, and then click on the Shippable checkbox. The Shippable property is selected by default and must be unchecked to indicate that a product is non-physical.

Support shopper-initiated returns

In addition to shopper-initiated cancellations, you can also configure your storefront to allow shoppers to initiate returns of fulfilled orders. See Order Details for information about how to do this.

Note that some items may not be returnable. If a product or SKU’s Not Returnable property is set to true, neither a shopper nor an agent can initiate a return for that item. If order information is maintained in an external system, you can use the Return Request Validation webhook to communicate with the system to determine whether an order can be returned. For more information about this webhook, see Return Request webhooks.

The Agent Console also includes tools that enable a customer service agent to initiate a return or exchange on behalf of a shopper. See Understand the Agent Console for information about these tools.