Skip to main content
POST
/
api
/
external
/
add-points
Add points to customer account
curl --request POST \
  --url https://loyalty-admin.appstle.com/api/external/add-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/add-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/add-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/add-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/add-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/add-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/add-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
{
  "availablePoints": 350,
  "creditedPoints": 600,
  "currentVipTier": "Gold",
  "customerStatus": "ACTIVE",
  "pendingPoints": 0,
  "rewards": [],
  "spentAmount": 1250.99,
  "storeCreditBalance": 0
}
{
"details": "Points must be a positive number",
"error": "Invalid request"
}
{
"error": "Invalid API key"
}

Headers

X-API-Key
string
required

API key for authentication

Body

application/json

Request containing customer ID/email, points to add, and optional description

points
number<double>
required

Number of points to add to the customer's account. Must be a positive number. Points are added to availablePoints immediately (not pending). Decimal values are supported for fractional points. Example: 50.0

Required range: x >= 0.01
Example:

50

customerEmail
string | null

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. Email matching is case-insensitive. Example: customer@example.com

Example:

"customer@example.com"

customerId
integer<int64> | null

Shopify customer ID (numeric). Identifies which customer receives the points. Provide either customerId OR customerEmail, not both. Customer must be enrolled in the loyalty program. Example: 67890

Example:

67890

earnRuleId
integer<int64> | null

Optional: ID of an earn rule to associate with this point addition. Used for categorization and reporting purposes only. Does not affect point calculation - points parameter takes precedence. Helps group similar types of point additions in reports. Example: 10

Example:

10

note
string | null

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"
Maximum string length: 500
Example:

"Compensation for delayed shipping - Order #1234"

Response

Points successfully added to customer account

achievableTierId
integer<int64>
availablePoints
number<double>
createAt
string<date-time>
creditedPoints
number<double>
currentVipTier
string
customerStatus
enum<string>
Available options:
ACTIVE,
INACTIVE,
EXCLUDED,
EXCLUDED_BY_CUSTOMER
dob
string<date>
expiringPointsAmount
number<double>
pendingPoints
number<double>
pointsExpireAt
string<date-time>
referredCompleted
integer<int64>
rewardedForCreatingAccount
boolean
rewardedForFacebook
boolean
rewardedForInstagram
boolean
rewardedForNewsLetter
boolean
rewardedForPinterest
boolean
rewardedForSharingOnFacebook
boolean
rewardedForSharingOnX
boolean
rewardedForSms
boolean
rewardedForTiktok
boolean
rewardedForTwitter
boolean
rewardedForYoutube
boolean
rewards
object[]
spentAmount
number<double>
storeCreditBalance
number<double>
storeCreditCurrency
string
vipTierExpiredAt
string<date-time>