Endpoints:
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 | Type | Description | |
---|---|---|---|
hidePointsInWallet | bool | Audience ID | |
loyaltyPoints | float | Total loyalty points that they have | |
discountTemplates | array | This is an array of all discounts available for the user + brand/ stores. Obj details below. |
Discount templates object is detailed here:
Field | Type | Description | |
---|---|---|---|
id | bool | Discount template ID | |
avatar | string | Total loyalty points that they have | |
name | array | This is an array of all discounts available for the user + brand/ stores. Obj details below. | |
pageTitle | string | Text description of discount | |
priceCap | string | Dollar value that they need to spend before discount is valid. OR “valid on offers up to” as well. | |
min | bool | priceCap is “valid on offers OVER {priceCap}” if this is true. If this is false it’s “valid on offers up to {priceCap}” | |
rewardType | string | Options: “cash”, “percentage”, “other” | |
rewardValue | string | Amount of points this will cost them to redeem. If “-1” then points are not required to redeem. | |
redemptionURL | string | Full 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> ); }