Remove points from customer account
Manually removes (debits) loyalty points from a customer’s account.
Common use cases:
- POS / offline refunds where Shopify doesn’t see the return
- ERP-driven debit adjustments for operational corrections
- Reversing points awarded in error
- Punitive deductions per merchant policy
Request body fields:
- customerId OR customerEmail: Identify the customer (required, provide one)
- points: Number of points to remove (required, must be greater than 0 — the endpoint debits this amount)
- note: Description/reason for points removal (optional but recommended for audit trail)
- earnRuleId: Associate with an earn rule for categorization (optional)
How it works:
- Finds the customer in your store’s loyalty customer list, or returns 400. customerStatus isn’t checked: a customer the merchant excluded, or who opted out, still loses the points and the call returns 200
- Creates an APPROVED debit point_transaction (PointType=DEBIT)
- Deducts points from customer’s available balance immediately
- Writes an activity log row with type DEBIT_POINTS / event ADD_REMOVE_POINTS, source EXTERNAL
- Syncs the updated balance back to Shopify customer metafields
- Returns the updated customer loyalty information
Important notes:
- The
pointsvalue is always provided as a positive number — the endpoint applies it as a debit - Operation is real-time and not reversible — call /api/external/add-points to credit back if needed
- Note field appears in customer’s transaction history and activity log
- Does NOT trigger any customer email
curl --request POST \
--url https://loyalty-admin.appstle.com/api/external/remove-points \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '{
"points": 50
}'import requests
url = "https://loyalty-admin.appstle.com/api/external/remove-points"
payload = { "points": 50 }
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({points: 50})
};
fetch('https://loyalty-admin.appstle.com/api/external/remove-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/remove-points';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({points: 50})
};
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/remove-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([
'points' => 50
]),
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/remove-points"
payload := strings.NewReader("{\n \"points\": 50\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/remove-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 \"points\": 50\n}"
response = http.request(request)
puts response.read_body{
"achievableTierId": 123,
"availablePoints": 123,
"createAt": "2023-11-07T05:31:56Z",
"creditedPoints": 123,
"currentVipTier": "<string>",
"customerStatus": "ACTIVE",
"dob": "2023-12-25",
"dobYearProvided": true,
"expiringPointsAmount": 123,
"pendingPoints": 123,
"pointsExpireAt": "2023-11-07T05:31:56Z",
"referralLink": "https://referral.appstle.com/abc123def456ghij",
"referredCompleted": 123,
"rewardedForCreatingAccount": true,
"rewardedForFacebook": true,
"rewardedForInstagram": true,
"rewardedForNewsLetter": true,
"rewardedForPinterest": true,
"rewardedForSharingOnFacebook": true,
"rewardedForSharingOnX": true,
"rewardedForSms": true,
"rewardedForTiktok": true,
"rewardedForTwitter": true,
"rewardedForYoutube": true,
"rewards": [
{
"createAt": "2023-11-07T05:31:56Z",
"customerId": 123,
"discountCode": "<string>",
"shop": "<string>",
"status": "USED",
"activeFrom": "2023-11-07T05:31:56Z",
"amount": 123,
"description": "<string>",
"discountCodeId": "<string>",
"expireDate": "2023-11-07T05:31:56Z",
"id": 123,
"lastExpiryReminderSentDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"orderName": "<string>",
"pointRedeemRuleId": 123,
"pointTransactionId": 123,
"productData": "<string>",
"rewardType": "STORE_CREDIT",
"usageCount": 123,
"usedAt": "2023-11-07T05:31:56Z",
"variantId": 123
}
],
"spentAmount": 123,
"storeCreditBalance": 123,
"storeCreditCurrency": "<string>",
"vipTierExpiredAt": "2023-11-07T05:31:56Z",
"vipTierOrderCount": 123,
"vipTierSpentAmount": 123
}Body
Request containing customer ID/email, points to add, and optional description
Number of points to add to the customer's account. Must be greater than 0. Points are added to availablePoints immediately, unless the earn rule in earnRuleId requires manual approval. Decimal values are supported for fractional points. Example: 50.0
x >= 0.0150
Customer's email address. Alternative to customerId for identifying the customer. Provide customerId or customerEmail. When you send both, customerId is used. Must be the email of a customer in your store's loyalty customer list, or the call returns 400 with the title "Customer not found using this email". Email matching is case-insensitive. Example: customer@example.com
"customer@example.com"
Shopify customer ID (numeric). Identifies the customer whose points change. Provide customerId or customerEmail. When you send both, customerId is used. The customer must be in your store's loyalty customer list, or the call returns 400 with the title "Customer not found using this customerID". The customer's status isn't checked: the call also works for a customer the merchant excluded or who opted out. Example: 67890
67890
Optional: ID of an earn rule to record this transaction under. The number of points always comes from the points field. When adding points, the earn rule must exist in your store, be active and be within its scheduled dates, otherwise the request fails with 400 ("Point Earn Rule not found" or "Point Earn Rule is not active"). If the earn rule requires manual approval, the added points are pending until approved. When removing points, the ID is only stored on the transaction. Example: 10
10
Optional but strongly recommended: Description of why points are being added. This note appears in the customer's transaction history and admin logs. Best practices:
- Be specific about the reason
- Include reference numbers (order ID, ticket ID, etc.)
- Use consistent formatting for easier reporting Examples:
- "Birthday bonus - January 2025"
- "Compensation for delayed shipping - Order #1234"
- "Referral bonus from external campaign"
- "Migration - transferred from old system"
- "Manual adjustment per support ticket #567"
500"Compensation for delayed shipping - Order #1234"
Response
Points successfully removed from customer account
The customer's short referral link, on https://referral.appstle.com/ or the merchant's custom referral domain. Its last part is the customer's referral token, which Accept referral offer takes as token. The link redirects to the store's primary domain with appstle_referral=true and appstle_referral_code={token} in the query string.
"https://referral.appstle.com/abc123def456ghij"
curl --request POST \
--url https://loyalty-admin.appstle.com/api/external/remove-points \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '{
"points": 50
}'import requests
url = "https://loyalty-admin.appstle.com/api/external/remove-points"
payload = { "points": 50 }
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({points: 50})
};
fetch('https://loyalty-admin.appstle.com/api/external/remove-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/remove-points';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({points: 50})
};
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/remove-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([
'points' => 50
]),
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/remove-points"
payload := strings.NewReader("{\n \"points\": 50\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/remove-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 \"points\": 50\n}"
response = http.request(request)
puts response.read_body{
"achievableTierId": 123,
"availablePoints": 123,
"createAt": "2023-11-07T05:31:56Z",
"creditedPoints": 123,
"currentVipTier": "<string>",
"customerStatus": "ACTIVE",
"dob": "2023-12-25",
"dobYearProvided": true,
"expiringPointsAmount": 123,
"pendingPoints": 123,
"pointsExpireAt": "2023-11-07T05:31:56Z",
"referralLink": "https://referral.appstle.com/abc123def456ghij",
"referredCompleted": 123,
"rewardedForCreatingAccount": true,
"rewardedForFacebook": true,
"rewardedForInstagram": true,
"rewardedForNewsLetter": true,
"rewardedForPinterest": true,
"rewardedForSharingOnFacebook": true,
"rewardedForSharingOnX": true,
"rewardedForSms": true,
"rewardedForTiktok": true,
"rewardedForTwitter": true,
"rewardedForYoutube": true,
"rewards": [
{
"createAt": "2023-11-07T05:31:56Z",
"customerId": 123,
"discountCode": "<string>",
"shop": "<string>",
"status": "USED",
"activeFrom": "2023-11-07T05:31:56Z",
"amount": 123,
"description": "<string>",
"discountCodeId": "<string>",
"expireDate": "2023-11-07T05:31:56Z",
"id": 123,
"lastExpiryReminderSentDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"orderName": "<string>",
"pointRedeemRuleId": 123,
"pointTransactionId": 123,
"productData": "<string>",
"rewardType": "STORE_CREDIT",
"usageCount": 123,
"usedAt": "2023-11-07T05:31:56Z",
"variantId": 123
}
],
"spentAmount": 123,
"storeCreditBalance": 123,
"storeCreditCurrency": "<string>",
"vipTierExpiredAt": "2023-11-07T05:31:56Z",
"vipTierOrderCount": 123,
"vipTierSpentAmount": 123
}