Skip to main content

Customers API

List Customers

page
number
default:"1"
Page number
perPage
number
default:"20"
Results per page
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

GET /api/customers/:id
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
    }
  }
}