<!-- ZenPays documentation · https://docs.zenpayz.com/docs/rest-api/endpoints/vendors/update-vendor-kyc -->

# Update Vendor KYC

Update the KYC (Know Your Customer) verification status of a vendor.

<EndpointHeader verb="PATCH" path="/merchant/api/v1/vendors/:id/kyc" />

## Request

### Headers

<ParamTable
  label="Header"
  rows={[
    { name: "Authorization", required: true, desc: "`Bearer {api_key}`" },
    { name: "X-Signature", required: true, desc: "HMAC-SHA256 signature" },
    { name: "X-Timestamp", required: true, desc: "ISO 8601 timestamp" },
    { name: "X-Secret-Salt", required: true, desc: "Secret salt for HMAC validation" },
    { name: "Content-Type", required: true, desc: "`application/json`" },
  ]}
/>

### Path Parameters

<ParamTable
  rows={[
    { name: "id", type: "string", required: true, desc: "Vendor ID (e.g., `vnd_a1b2c3d4e5f6g7h8`)" },
  ]}
/>

### Body Parameters

<ParamTable
  rows={[
    { name: "verificationStatus", type: "string", required: true, desc: "KYC status (`pending`, `verified`, `rejected`)" },
    { name: "verifiedBy", type: "string", desc: "Identifier of the person who performed verification" },
    { name: "rejectionReason", type: "string", desc: "Reason for rejection (required when status is `rejected`)" },
    { name: "adminNotes", type: "string", desc: "Internal notes about the KYC review" },
  ]}
/>

## Response

### Success (200 OK)

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

<ErrorTable
  rows={[
    { code: "VALIDATION_ERROR", status: "400", message: "Invalid verification status or missing rejection reason" },
    { code: "UNAUTHORIZED", status: "401", message: "Invalid API key" },
    { code: "VENDOR_NOT_FOUND", status: "404", message: "Vendor with specified ID does not exist" },
  ]}
/>

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
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"
  }'
```

  </TabItem>
  <TabItem value="javascript" label="JavaScript">

```javascript
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
```

  </TabItem>
  <TabItem value="sdk" label="SDK">

```javascript
const result = await zenpays.vendors.updateKyc('vnd_a1b2c3d4e5f6g7h8', {
  verificationStatus: 'verified',
  verifiedBy: 'admin_c3d4e5f6g7h8i9j0',
  adminNotes: 'All documents verified successfully',
});

console.log(result.kycStatus); // verified
```

  </TabItem>
</Tabs>

</CodeRail>

## Related Endpoints

- [Get Vendor](/docs/rest-api/endpoints/vendors/get-vendor)
- [Update Vendor Status](/docs/rest-api/endpoints/vendors/update-vendor-status)
- [Update Vendor](/docs/rest-api/endpoints/vendors/update-vendor)
