swellAPI.getActiveRedemptionOptions()

This method returns an array containing all active redemption options you setup. You can use this method to build a custom interface around your redemption options.

$(document).on("swell:initialized", () => {
    swellAPI.getActiveRedemptionOptions().forEach(option => {
     //render each option
    });
});
$(document).on("swell:initialized", () => {
	swellAPI.getActiveRedemptionOptions().forEach(option => {
		if (option.appliesToId !== null) {
			$(".swell-redemptions-list").append(
				$("<li>").addClass("swell-buy-product-btn").attr({
				 	"data-variant-id": option.appliesToId,
				 	"data-hide-logged-out": "true|false",
				 	"data-confirm-title": "Are you sure?",
				 	"data-confirm-btn-text": "Redeem",
				 	"data-error-type": "red",
				 	"data-error-title": "Whoops!",
				 	"data-error-okay-text": "Ok",
				 	"data-success-type": "green",
				 	"data-success-title": "Success!",
				 	"data-success-content": "Product was successfully added to your cart",
				 	"data-success-ok-btn": "Keep Shopping",
				 	"data-success-cart-btn": "View Cart",
				 	"data-success-cart-link": "/cart",
				 	"data-box-width": "400px",
				 	"data-mobile-box-width": "90%"
				})
			)
		}
	});
});

Redemption Option Object

AttributeTypeDescription
idintThe redemption option id, useful for setting up click handlers or triggering custom redemptions
namestringName of this option as set in the admin
iconstringThe Font Awesome icon class or image URL set for this option
descriptionstringThe description of this option
costTextstringThe number of points required string set in admin “200 Points”
costInPointsintThe number of points required to redeem this option
appliesToIDstringCan be comma-separated or empty string. This is the variant ID
backgroundImageURLstringThe hosted URL of the background image associated with this redemption option
discountTypestringThe discount type associated with this redemption option. This is the discount type selected when creating redemptions in the Swell admin