Remove Redemption from Cart

SwellAPI.removePointRedemptionIdFromCart(pointRedemptionID, callback)

This method can be used to remove a point redemption made by the customer in case they changed their mind.

This is mostly relevant if the point redemption that is used is not the platform's native discount/coupon solution.

For example, Yotpo's Loyalty's SFCC basket price adjustments.

If the callback is used to adjust the UI, the customer will see that the action was canceled and their point balance has been restored.

$(document).on("swell:setup", function() {
      var callback = function() {
        $("#callback").show();
      }
      swellAPI.removePointRedemptionIdFromCart(pointRedemptionID, callback)
    });
  });

Options

Attribute

Type

Description

PointRedemptionId

int

The ID that was returned as part of the 'Make redemption'/'Convert points to discount' redemption method. See example image below.

callback

function

This should pass a function that will update the UI and other elements of your choice once the redemption is removed from the cart.