This action redeems a reward for a customer, the same way they would from their Customer App. JeriCommerce checks the reward's rules, removes the points, and gives the customer a discount code. Use it when customers redeem from your own website, app, or point of sale, or to redeem automatically from a Klaviyo flow.
What happens ¶
- The reward's points are removed from the customer's balance.
- The customer gets a discount code: a new single-use Shopify code or the next code from your uploaded batch, depending on the reward's discount.
- The customer receives an email with the code, and the code appears in their coupons.
- A Reward redeemed event with the
codeand a Balance changed event are sent to your events webhook. Listen to Reward redeemed if your system needs the code.
A Fixed reward always costs its Points cost. A Points as cash reward lets the customer choose how many points to use, between the reward's minimum and maximum. The discount is the points multiplied by the value of each point, rounded to two decimals. For example, 500 points worth 0.02 each give a 10.00 discount.
The redemption is rejected, without removing points, when:
- The customer doesn't have enough points, or some of their points are still on hold.
- The customer doesn't meet the reward's visibility or segment rules.
- The reward's discount has no codes left.
- The points to redeem are missing for a Points as cash reward, or outside its minimum and maximum.
Set it up ¶
Shopify Flow doesn't have a JeriCommerce action to redeem rewards. To redeem from an automation, use a Klaviyo webhook or the API.
In your store, customers can redeem rewards themselves from the Customer App, and your staff can redeem them at the register as described in See and Redeem Customer Rewards on Shopify POS.
Add a Webhook action to your Klaviyo flow. Fill in the builder below and copy each value into the webhook settings. To find a reward's ID, open it in Loyalty > Ways to redeem.
Your details
Find it in Settings > Technical > Program Information.
Create one in Settings > Technical > API Keys. It stays in your browser.
Action details
Open the reward in Loyalty > Ways to redeem to see its ID.
For Points as cash, enter a whole number of points, at least 1. Leave blank for a Fixed reward.
Copy and paste into Klaviyo
https://api.jericommerce.com/v1/programs/your-program-slug/reward/redeemapi-keyyour-api-key[
{
"email": "{{ person.email|default:'' }}",
"rewardId": ""
}
]For a Points as cash reward, enter the points to redeem as a whole number of at least 1. Leave it blank for a Fixed reward. Klaviyo Customer Hub supports Fixed reward options only.
Klaviyo webhooks are queued: JeriCommerce processes the redemption a few seconds later, and Klaviyo is not told if it's rejected.
POST https://api.jericommerce.com/v1/programs/{program_slug}/reward/redeem
Send your API key in the api-key header. See Authentication through the API. The body is an array of up to 100 items:
[
{
"email": "customer@example.com",
"rewardId": "2f6c1a2e-8f3b-4f0e-9a51-1d2b3c4d5e6f"
}
]
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string | Yes | Email of a customer already in the program. |
rewardId |
string | Yes | The reward's id. Get it from List rewards. |
pointsToRedeem |
integer | Only for Points as cash | How many points to convert, between the reward's minPoints and maxPoints. Ignored for a Fixed reward. |
In the API, a Fixed reward has "type": "fixed" and costs redeemCost points. A Points as cash reward has "type": "dynamic", and its discount is pointsToRedeem multiplied by currencyPerPoint.
The API answers 201 with an empty body as soon as the request is valid. The redemption is processed a few seconds later, so the response doesn't include the discount code, and rejections are not reported. See queued endpoints. To check in advance, compare the customer's balance from Get customer details with the reward's cost.
| Code | Status | Meaning |
|---|---|---|
MAX_ITEMS_PER_REQUEST_EXCEEDED |
400 |
The array has more than 100 items. |
| Validation errors | 400 |
email is missing, rewardId is not a valid ID, or pointsToRedeem is not a whole number of 1 or more. |
Build a ready-to-run request with your own values:
Your details
Find it in Settings > Technical > Program Information.
Create one in Settings > Technical > API Keys. It stays in your browser.
Action details
Open the reward in Loyalty > Ways to redeem to see its ID.
For Points as cash, enter a whole number of points, at least 1. Leave blank for a Fixed reward.
Your request
curl --request POST \
--url 'https://api.jericommerce.com/v1/programs/your-program-slug/reward/redeem' \
--header 'api-key: your-api-key' \
--header 'Content-Type: application/json' \
--data '[
{
"email": "customer@example.com",
"rewardId": ""
}
]'Paste it in a terminal to test the request with your program.