Customers API
List Customers
Search by name, email, or company
sort
string
default:"totalSpent"
Sort field: totalSpent, totalTransactions, lastPurchaseAt, createdAt
GET /api/customers?search=john&sort=totalSpent&order=desc
Get Customer
Returns customer profile with:
- Contact information
- Transaction summary (total spent, count, avg, last purchase)
- Linked subscriptions
- Recent transactions
- Health score and risk indicators
Customer Health Score
Included in the customer detail response:
{
"healthScore": {
"score": 78,
"risk": "low",
"factors": {
"paymentSuccessRate": 95.5,
"tenure": 8,
"recentActivity": true,
"averageTransactionValue": 250.00,
"totalRevenue": 12500.00,
"transactionCount": 50
}
}
}