The Customer object
Represents a customer in the ZenPays system. Customers are end-users who make payments through your application. Creating customer records allows you to track payment history, manage KYC status, and provide a better checkout experience.
Fields
| Field | Type | Description |
|---|---|---|
id REQUIRED | string | Unique identifier for the customer |
merchantId REQUIRED | string | ID of the merchant this customer belongs to |
email REQUIRED | string | Email address of the customer |
name REQUIRED | string | Full name of the customer |
phone OPTIONAL | string | Phone number of the customer |
address OPTIONAL | CustomerAddress | Customer's address |
kycStatus OPTIONAL | KycStatus | KYC verification status KycStatus |
riskLevel OPTIONAL | RiskLevel | Risk level assigned to this customer RiskLevel |
isBlocked OPTIONAL | boolean | Whether the customer is blocked from making payments |
totalTransactions OPTIONAL | number | Total number of transactions by this customer |
totalVolume OPTIONAL | number | Total transaction volume for this customer |
lastTransactionAt OPTIONAL | string | ISO 8601 timestamp of the customer's last transaction |
metadata OPTIONAL | Record<string, unknown> | Custom key-value data attached to the customer |
createdAt REQUIRED | string | ISO 8601 timestamp when the customer was created |
updatedAt REQUIRED | string | ISO 8601 timestamp when the customer was last updated |
Example
{
"id": "obj_1a2b3c",
"merchantId": "merchant_1a2b3c",
"email": "customer@example.com",
"name": "string",
"phone": "string",
"address": "string",
"kycStatus": "pending",
"riskLevel": "low",
"createdAt": "2026-01-15T09:30:00Z",
"updatedAt": "2026-01-15T09:30:00Z"
}
Usage
const customer = await client.customers.get('cus_123');
console.log(`Customer ${customer.name} has made ${customer.totalTransactions} transactions`);