RefundLineItem

Whenever the user tries to refund an already paid line item a line item, it should be possible to invoke a custom workflow instead of using the default enfore functionality. The workflow will be triggered if the line item’s requiresCustomRefundFlow is set and the sales item referenced by the line item has a custom workflow configured for the RefundLineItem extension point.

The workflow receives information about the line item to be refunded. If the workflow completes successfully, it must return the reason for the refund (a value from the LineItemCancelationReason enum) and the item will be refunded. If the workflow fails, an error is shown and the item is not refunded.

Workflow parameters

The RefundLineItem-CUWO does not yet receive a dedicated WorkflowParameters structure.

Success result

On success, the RefundLineItem-CUWO is expected to pass a RefundLineItemWorkflowResult structure to terminateSuccess.

The structure is defined as:

/**
 * The result value for a "refund line item" workflow.
 */
class RefundLineItemWorkflowResult extends WorkflowResult {
    readonly "@type" : string = "n4.cuwo.RefundLineItemWorkflowResult";

    /**
     * The reason for the refunding of the line item.
     */
    public reason : LineItemCancelationReason;

    /**
     * The new external data to attach to the line item. If not provided,
     * the existing external data of the line item will not be changed.
     */
    public updatedExternalData? : string;
}

Failure result

The RefundLineItem-CUWO does not yet have a dedicated WorkflowFailure structure to pass into terminateFailure.

Cancelation result

The RefundLineItem workflow does not support cancelation.