Skip to main content

Update Customer

Update an existing customer's information.

PUThttps://api.zenpayz.com/merchant/api/v1/customers/{customerId}
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
Content-Type
REQUIRED
application/json

Body Parameters

ParameterTypeDescription
email
OPTIONAL
stringCustomer email address
phone
OPTIONAL
stringPhone number (10-15 characters)
firstName
OPTIONAL
stringCustomer first name (1-100 characters)
lastName
OPTIONAL
stringCustomer last name (1-100 characters)
dateOfBirth
OPTIONAL
stringDate of birth (YYYY-MM-DD)
country
OPTIONAL
stringISO country code
ipAddress
OPTIONAL
stringCustomer IPv4 address
deviceFingerprint
OPTIONAL
stringDevice fingerprint (10-255 characters)
metadata
OPTIONAL
objectCustom key-value pairs

Response

Success (200 OK)

{
"success": true,
"data": {
"customerId": "cust_a1b2c3d4e5f6g7h8",
"email": "john.updated@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": "+1234567890",
"country": "US",
"status": "active",
"riskLevel": "low",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-15T10:35:00.000Z"
},
"message": "Customer updated successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-15T10:35:00.000Z",
"processing_time_ms": 60,
"api_version": "v1",
"endpoint": "PUT /customers/:id",
"user_type": "merchant"
}
}

Error Responses

CodeHTTPMessage
VALIDATION_ERROR400Invalid request parameters
UNAUTHORIZED401Invalid API key
CUSTOMER_NOT_FOUND404Customer doesn't exist

Examples

curl -X PUT "https://api.zenpayz.com/merchant/api/v1/customers/cust_a1b2c3d4e5f6g7h8" \
-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" \
-H "Content-Type: application/json" \
-d '{
"email": "john.updated@example.com",
"phone": "+1987654321"
}'