Update Vendor KYC
Update the KYC (Know Your Customer) verification status of a vendor.
PATCH
https://api.zenpayz.com/merchant/api/v1/vendors/:id/kycBearer · API key
Request
Headers
| Header | Description |
|---|---|
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 |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id REQUIRED | string | Vendor ID (e.g., vnd_a1b2c3d4e5f6g7h8) |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
verificationStatus REQUIRED | string | KYC status (pending, verified, rejected) |
verifiedBy OPTIONAL | string | Identifier of the person who performed verification |
rejectionReason OPTIONAL | string | Reason for rejection (required when status is rejected) |
adminNotes OPTIONAL | string | Internal notes about the KYC review |
Response
Success (200 OK)
{
"success": true,
"data": {
"vendorId": "vnd_a1b2c3d4e5f6g7h8",
"previousKycStatus": "pending",
"kycStatus": "verified",
"verifiedBy": "admin_c3d4e5f6g7h8i9j0",
"rejectionReason": null,
"adminNotes": "All documents verified successfully",
"verifiedAt": "2024-03-21T15:00:00.000Z",
"updatedAt": "2024-03-21T15:00:00.000Z"
},
"message": "Vendor KYC status updated successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-03-21T15:00:00.000Z",
"processing_time_ms": 105,
"api_version": "v1",
"endpoint": "PATCH /vendors/:id/kyc",
"user_type": "merchant"
}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| VALIDATION_ERROR | 400 | Invalid verification status or missing rejection reason |
| UNAUTHORIZED | 401 | Invalid API key |
| VENDOR_NOT_FOUND | 404 | Vendor with specified ID does not exist |
Examples
- cURL
- JavaScript
- SDK
curl -X PATCH https://api.zenpayz.com/merchant/api/v1/vendors/vnd_a1b2c3d4e5f6g7h8/kyc \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-03-21T15:00:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{
"verificationStatus": "verified",
"verifiedBy": "admin_c3d4e5f6g7h8i9j0",
"adminNotes": "All documents verified successfully"
}'
const response = await fetch('https://api.zenpayz.com/merchant/api/v1/vendors/vnd_a1b2c3d4e5f6g7h8/kyc', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${apiKey}`,
'X-Timestamp': timestamp,
'X-Signature': signature,
'X-Secret-Salt': secretSalt,
'Content-Type': 'application/json',
},
body: JSON.stringify({
verificationStatus: 'verified',
verifiedBy: 'admin_c3d4e5f6g7h8i9j0',
adminNotes: 'All documents verified successfully',
}),
});
const result = await response.json();
console.log(result.data.kycStatus); // verified
const result = await zenpays.vendors.updateKyc('vnd_a1b2c3d4e5f6g7h8', {
verificationStatus: 'verified',
verifiedBy: 'admin_c3d4e5f6g7h8i9j0',
adminNotes: 'All documents verified successfully',
});
console.log(result.kycStatus); // verified