Redeem customer points for rewards
curl --request POST \
--url https://loyalty-admin.appstle.com/api/external/redeem-points \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"redeemRuleId": 5
}
'import requests
url = "https://loyalty-admin.appstle.com/api/external/redeem-points"
payload = { "redeemRuleId": 5 }
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({redeemRuleId: 5})
};
fetch('https://loyalty-admin.appstle.com/api/external/redeem-points', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://loyalty-admin.appstle.com/api/external/redeem-points';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({redeemRuleId: 5})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://loyalty-admin.appstle.com/api/external/redeem-points",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'redeemRuleId' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://loyalty-admin.appstle.com/api/external/redeem-points"
payload := strings.NewReader("{\n \"redeemRuleId\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://loyalty-admin.appstle.com/api/external/redeem-points")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redeemRuleId\": 5\n}"
response = http.request(request)
puts response.read_body{
"availablePoints": 150,
"creditedPoints": 500,
"currentVipTier": "Gold",
"customerStatus": "ACTIVE",
"pendingPoints": 0,
"rewards": [
{
"createAt": "2025-01-29T10:30:00Z",
"discountCode": "LOYALTY15OFF",
"discountType": "PERCENTAGE",
"discountValue": 15,
"expiryDate": "2025-06-30T23:59:59Z",
"id": 12346,
"pointsRedeemed": 100,
"status": "UNUSED"
}
],
"spentAmount": 1250.99,
"storeCreditBalance": 0
}{
"details": "Customer has 50 points but needs 100 points for this redemption",
"error": "Insufficient points"
}{
"error": "Invalid API key"
}Headers
API key for authentication
Body
Redemption request with customer ID/email, redeem rule ID, points to redeem
ID of the redemption rule to use. Determines what reward the customer receives. Use GET /api/external/point-redeem-rules to get available redemption options. Must be an active redemption rule configured in your loyalty program. Example: 5
5
Customer's email address. Alternative to customerId for identifying the customer. Provide either customerId OR customerEmail, not both. Must be a valid email address that exists in your Shopify store. Example: customer@example.com
"customer@example.com"
Shopify customer ID (numeric). Identifies which customer is redeeming points. Provide either customerId OR customerEmail, not both. Example: 67890
67890
Number of points to redeem. Must be positive. If not provided, uses the default points value from the redemption rule. Customer must have at least this many available points. Example: 100.0
100
Shopify product variant ID. Required when redeeming for product-specific rewards (free product). Not required for discount codes or store credit rewards. Must be a valid variant ID from your Shopify catalog. Example: 12345678
12345678
Response
Points successfully redeemed and reward generated
ACTIVE, INACTIVE, EXCLUDED, EXCLUDED_BY_CUSTOMER Show child attributes
Show child attributes
curl --request POST \
--url https://loyalty-admin.appstle.com/api/external/redeem-points \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"redeemRuleId": 5
}
'import requests
url = "https://loyalty-admin.appstle.com/api/external/redeem-points"
payload = { "redeemRuleId": 5 }
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({redeemRuleId: 5})
};
fetch('https://loyalty-admin.appstle.com/api/external/redeem-points', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://loyalty-admin.appstle.com/api/external/redeem-points';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({redeemRuleId: 5})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://loyalty-admin.appstle.com/api/external/redeem-points",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'redeemRuleId' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://loyalty-admin.appstle.com/api/external/redeem-points"
payload := strings.NewReader("{\n \"redeemRuleId\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://loyalty-admin.appstle.com/api/external/redeem-points")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redeemRuleId\": 5\n}"
response = http.request(request)
puts response.read_body{
"availablePoints": 150,
"creditedPoints": 500,
"currentVipTier": "Gold",
"customerStatus": "ACTIVE",
"pendingPoints": 0,
"rewards": [
{
"createAt": "2025-01-29T10:30:00Z",
"discountCode": "LOYALTY15OFF",
"discountType": "PERCENTAGE",
"discountValue": 15,
"expiryDate": "2025-06-30T23:59:59Z",
"id": 12346,
"pointsRedeemed": 100,
"status": "UNUSED"
}
],
"spentAmount": 1250.99,
"storeCreditBalance": 0
}{
"details": "Customer has 50 points but needs 100 points for this redemption",
"error": "Insufficient points"
}{
"error": "Invalid API key"
}