REST API · Webhooks · SDKs

Powerful APIs for developers.

Connect loyalty features into websites, applications, and business systems with simple API integration.

POST /api/v1/points/add
POST /api/v1/points/add
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "customer_id": "CUS00001",
  "points": 100,
  "reason": "Purchase"
}
Authentication

Secure API key authentication.

Authenticate every API request with secure API keys. Manage access, rotate keys, and monitor usage from your dashboard.

  • Bearer token authentication
  • Per-environment key scoping
  • Instant key rotation and revocation
Authorization header
# Header format
Authorization: Bearer YOUR_API_KEY

# Example request
curl https://api.aftersolves.com/v1/customers \
  -H "Authorization: Bearer sk_live_abc123..."
Endpoints

Core API endpoints.

Manage customers, points, rewards, memberships, and vouchers through a clean REST API.

Method
Endpoint
Description
POST
/api/v1/points/add
Add points to a customer
POST
/api/v1/points/deduct
Deduct points from a customer's balance
GET
/api/v1/customers/{id}/balance
Retrieve a customer's current point balance
POST
/api/v1/vouchers/generate
Generate voucher codes
POST
/api/v1/rewards/redeem
Redeem a reward
GET
/api/v1/memberships/{id}
Get membership tier info
POST
/api/v1/memberships/upgrade
Upgrade a customer's membership tier
GET
/api/v1/customers/{id}
Retrieve customer details

Full reference at docs.aftersolves.com

Examples

Code examples in every language.

Copy-paste examples in JavaScript, Python, PHP, Go, and more. Get started in minutes.

cURL
curl -X POST https://api.aftersolves.com/v1/points/add \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "CUS00001",
    "points": 100,
    "reason": "Purchase"
  }'
JavaScript
const response = await fetch('https://api.aftersolves.com/v1/points/add', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    customer_id: 'CUS00001',
    points: 100,
    reason: 'Purchase'
  })
});

const data = await response.json();
console.log(data);
Python
import requests

response = requests.post(
    'https://api.aftersolves.com/v1/points/add',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'customer_id': 'CUS00001',
        'points': 100,
        'reason': 'Purchase'
    }
)

print(response.json())

Ready to start building?

Start creating better customer experiences with AfterSolves Loyalty.