Wallet offers API

Endpoints:


Get wallet offers

Description: Returns all wallet offers for a specific persona. This includes any loyalty tier discounts if allowed in the geography or store/ brand level discounts.

How this is normally leveraged: Many times in the customer journey you might want to display offers available to a specific persona. (I.E: iHeartJane checkout, POS screens, etc.) You can leverage this endpoint to list out deals and for more advanced integrations, trigger redemptions, and or deduction of points.

Endpoint: (GET) /walletOffers/:phone

Response body:

{
    "data": {
		"hidePointsInWallet": false, 
        "loyaltyPoints": 3404, 
        "discountTemplates": [ 
			{
				"id": "1010", 
				"avatar": "image URL",
				"name": "Loyalty",
				"pageTitle": "15% OFF", 
				"priceCap": "100", 
				"min": false,
				"rewardType": "percentage",
				"rewardValue": "300",
                "redemptionURL" "A URL here", 
			},
			{
				"id": "1011",
				"avatar": "image URL",
				"name": "White widow 5gs BOGO", 
				"pageTitle": "BOGO", 
				"priceCap": "0",
				"min": false,
				"rewardType": "other",
				"rewardValue": "-1",
                "redemptionURL" "A URL here", 
			},
		],
    },
    "code": 200,
    "success": true
}

Field
TypeDescription
hidePointsInWalletboolAudience ID
loyaltyPointsfloatTotal loyalty points that they have
discountTemplatesarrayThis is an array of all discounts available for the user + brand/ stores. Obj details below.

Discount templates object is detailed here:

FieldTypeDescription
idboolDiscount template ID
avatarstringTotal loyalty points that they have
namearrayThis is an array of all discounts available for the user + brand/ stores. Obj details below.
pageTitlestringText description of discount
priceCapstringDollar value that they need to spend before discount is valid. OR “valid on offers up to” as well.
minboolpriceCap is “valid on offers OVER {priceCap}” if this is true. If this is false it’s “valid on offers up to {priceCap}”
rewardTypestringOptions: “cash”, “percentage”, “other”
rewardValuestringAmount of points this will cost them to redeem. If “-1” then points are not required to redeem.
redemptionURLstringFull URL that you should send a PUT request to with your API key to tell us if it was redeemed.

How to utilize this from a UI perspective. Below is a react example and final product utilizing the exact object given in the endpoint response example above:

let objectToRenderAtCheckout = [];
for(let discount in data){
    objectToRenderAtCheckout.push(
        <span>- {data[discount].name}: {data[discount].pageTitle} {data[discount].priceCap > 0 ? `| Promotion is only valid for a single use on orders ${data[discount].min ? "over" : "up to"} ${"$" + data[discount].priceCap}.` : null} {data[discount].rewardValue > 0 ? `| (${data[discount].rewardValue} points)` : null}<br/></span>
    );
}