<!-- ZenPays documentation · https://docs.zenpayz.com/docs/reference/objects/customer -->

# 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

<ParamTable
  label="Field"
  rows={[
    { name: "id", type: "string", required: true, desc: "Unique identifier for the customer" },
    { name: "merchantId", type: "string", required: true, desc: "ID of the merchant this customer belongs to" },
    { name: "email", type: "string", required: true, desc: "Email address of the customer" },
    { name: "name", type: "string", required: true, desc: "Full name of the customer" },
    { name: "phone", type: "string", required: false, desc: "Phone number of the customer" },
    { name: "address", type: "CustomerAddress", required: false, desc: "Customer's address" },
    { name: "kycStatus", type: "KycStatus", required: false, desc: "KYC verification status [KycStatus](/docs/reference/enums/compliance)" },
    { name: "riskLevel", type: "RiskLevel", required: false, desc: "Risk level assigned to this customer [RiskLevel](/docs/reference/enums/compliance)" },
    { name: "isBlocked", type: "boolean", required: false, desc: "Whether the customer is blocked from making payments" },
    { name: "totalTransactions", type: "number", required: false, desc: "Total number of transactions by this customer" },
    { name: "totalVolume", type: "number", required: false, desc: "Total transaction volume for this customer" },
    { name: "lastTransactionAt", type: "string", required: false, desc: "ISO 8601 timestamp of the customer's last transaction" },
    { name: "metadata", type: "Record<string, unknown>", required: false, desc: "Custom key-value data attached to the customer" },
    { name: "createdAt", type: "string", required: true, desc: "ISO 8601 timestamp when the customer was created" },
    { name: "updatedAt", type: "string", required: true, desc: "ISO 8601 timestamp when the customer was last updated" },
  ]}
/>

## Example

```json
{
  "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

```typescript
const customer = await client.customers.get('cus_123');
console.log(`Customer ${customer.name} has made ${customer.totalTransactions} transactions`);
```
