Skip to main content

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

FieldTypeDescription
id
REQUIRED
stringUnique identifier for the customer
merchantId
REQUIRED
stringID of the merchant this customer belongs to
email
REQUIRED
stringEmail address of the customer
name
REQUIRED
stringFull name of the customer
phone
OPTIONAL
stringPhone number of the customer
address
OPTIONAL
CustomerAddressCustomer's address
kycStatus
OPTIONAL
KycStatusKYC verification status KycStatus
riskLevel
OPTIONAL
RiskLevelRisk level assigned to this customer RiskLevel
isBlocked
OPTIONAL
booleanWhether the customer is blocked from making payments
totalTransactions
OPTIONAL
numberTotal number of transactions by this customer
totalVolume
OPTIONAL
numberTotal transaction volume for this customer
lastTransactionAt
OPTIONAL
stringISO 8601 timestamp of the customer's last transaction
metadata
OPTIONAL
Record<string, unknown>Custom key-value data attached to the customer
createdAt
REQUIRED
stringISO 8601 timestamp when the customer was created
updatedAt
REQUIRED
stringISO 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`);