Automated loyalty program management points tracking, tier progression, reward redemption, and engagement analysis.
import requests, json, pandas as pd
CRM_API = "https://api.retail.com/v2/loyalty"
def fetch_customers():
resp = requests.get(CRM_API + "/customers")
return resp.json().get("customers", [])
def calculate_tier(points):
if points >= 5000: return "Platinum"
if points >= 2000: return "Gold"
if points >= 500: return "Silver"
return "Bronze"
def suggest_reward(customer):
if customer["tier"] == "Platinum": return "VIP access"
if customer["tier"] == "Gold": return "RM 50 reward"
if customer["tier"] == "Silver": return "20% voucher"
return "Welcome bonus"
def analyze_loyalty(customers):
for c in customers:
c["tier"] = calculate_tier(c["points"])
c["reward"] = suggest_reward(c)
return customers
report = analyze_loyalty(fetch_customers())
print(json.dumps(report, indent=2))
Basic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer โ
Ask about AINNA pages, services and articles.
AINNA website sources only ยท answers up to 5 lines
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy