Skip to main content

Get Customer History

Retrieve transaction history for a specific customer.

GEThttps://api.zenpayz.com/merchant/api/v1/customers/{customerId}/history
Bearer · API key

Request

Path Parameters

ParameterTypeDescription
customerId
REQUIRED
stringCustomer ID (e.g., cust_a1b2c3d4e5f6g7h8)

Headers

HeaderDescription
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

Query Parameters

ParameterTypeDescription
limit
OPTIONAL
integer50Number of records to return

Response

Success (200 OK)

{
"success": true,
"data": {
"customerId": "cust_a1b2c3d4e5f6g7h8",
"transactions": [
{
"id": "txn_xxxxx",
"amount": 1000,
"currency": "USD",
"status": "success",
"paymentMethod": "upi",
"createdAt": "2024-01-14T15:30:00.000Z"
}
],
"activities": [
{
"id": 1,
"activityType": "payment_completed",
"description": "Payment of 1000 USD completed",
"ipAddress": "203.0.113.42",
"deviceFingerprint": "fp_xxxxx",
"riskLevel": "low",
"isSuspicious": false,
"metadata": {},
"createdAt": "2024-01-14T15:30:00.000Z"
}
]
},
"message": "Customer history retrieved successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-15T10:30:00.000Z",
"processing_time_ms": 95,
"api_version": "v1",
"endpoint": "GET /customers/:id/history",
"user_type": "merchant"
}
}

Examples

curl -X GET "https://api.zenpayz.com/merchant/api/v1/customers/cust_a1b2c3d4e5f6g7h8/history?limit=50" \
-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"