Get Customer Risk Profile
Retrieve the risk assessment profile for a customer.
GET
https://api.zenpayz.com/merchant/api/v1/customers/{customerId}/riskBearer · API key
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
customerId REQUIRED | string | Customer ID (e.g., cust_a1b2c3d4e5f6g7h8) |
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Response
Success (200 OK)
{
"success": true,
"data": {
"customerId": "cust_a1b2c3d4e5f6g7h8",
"riskLevel": "low",
"riskScore": 15,
"fraudScore": 5,
"reasons": [],
"recommendations": ["Approve transaction"],
"requiresManualReview": false,
"allowTransaction": true,
"blockedReasons": []
},
"message": "Customer risk profile retrieved successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-15T10:30:00.000Z",
"processing_time_ms": 70,
"api_version": "v1",
"endpoint": "GET /customers/:id/risk",
"user_type": "merchant"
}
}
Risk Levels
| Level | Score Range | Description |
|---|---|---|
vip | - | VIP customer, trusted with high success rate |
low | 0-29 | Low risk, standard processing |
medium | 30-59 | Moderate risk, enhanced monitoring |
high | 60-84 | High risk, manual review recommended |
warning | - | Warning level, elevated monitoring |
risky | - | Risky behavior detected |
critical | 85-100 | Very high risk, transactions may be blocked |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpayz.com/merchant/api/v1/customers/cust_a1b2c3d4e5f6g7h8/risk" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt"
const risk = await zenpays.customers.getRiskProfile('cust_a1b2c3d4e5f6g7h8');
console.log(`Risk level: ${risk.riskLevel}, Score: ${risk.riskScore}`);