Skip to main content

Compliance

This guide covers regulatory compliance considerations when using TxnCheck API for identity verification and fraud prevention in India.

Regulatory Landscape

RBI Guidelines

Reserve Bank of India regulations for KYC and payment security

IT Act 2000

Information Technology Act provisions for data protection

DPDP Act 2023

Digital Personal Data Protection Act requirements

PCI DSS

Payment Card Industry Data Security Standard

RBI KYC Compliance

Periodic Re-KYC

RBI requires periodic re-verification:
Customer TypeRe-KYC Frequency
High RiskAnnually
Medium RiskEvery 2 years
Low RiskEvery 10 years
async function scheduleReKYC(customerId: string, riskLevel: string) {
  const intervals = {
    high: 365,
    medium: 730,
    low: 3650,
  };
  
  const nextKYC = new Date();
  nextKYC.setDate(nextKYC.getDate() + intervals[riskLevel as keyof typeof intervals]);
  
  await db.customer.update({
    where: { id: customerId },
    data: { nextKYCDate: nextKYC },
  });
}

DPDP Act 2023 Compliance

The Digital Personal Data Protection Act requires explicit consent:
interface Consent {
  userId: string;
  purpose: string;
  dataCategories: string[];
  consentGiven: boolean;
  consentTimestamp: Date;
  withdrawable: boolean;
}

// Obtain consent before verification
async function obtainVerificationConsent(userId: string): Promise<boolean> {
  const consent = await db.consent.create({
    data: {
      userId,
      purpose: 'identity_verification',
      dataCategories: ['mobile', 'name', 'pan_last4'],
      consentGiven: true,
      consentTimestamp: new Date(),
      withdrawable: true,
    },
  });
  
  return consent.consentGiven;
}

// Check consent before API call
async function verifyWithConsent(userId: string, mobile: string) {
  const hasConsent = await checkConsent(userId, 'identity_verification');
  
  if (!hasConsent) {
    throw new ConsentRequiredError('User consent required for verification');
  }
  
  return client.upiByMobile(mobile, { sync: true });
}

Data Principal Rights

Implement rights management:
// Right to access
async function handleAccessRequest(userId: string) {
  const userData = await collectAllUserData(userId);
  return {
    personalData: userData,
    processingPurposes: ['identity_verification', 'fraud_prevention'],
    retentionPeriod: '7 years for compliance records',
    dataSharing: ['None - data not shared with third parties'],
  };
}

// Right to correction
async function handleCorrectionRequest(
  userId: string, 
  corrections: Record<string, any>
) {
  // Verify identity before allowing corrections
  await verifyIdentity(userId);
  
  // Apply corrections
  await db.customer.update({
    where: { id: userId },
    data: corrections,
  });
  
  // Log the correction
  await logDataCorrection(userId, corrections);
}

// Right to erasure
async function handleErasureRequest(userId: string) {
  // Check if we can delete (may need to retain for compliance)
  const canDelete = await checkRetentionRequirements(userId);
  
  if (!canDelete) {
    return {
      status: 'partial',
      message: 'Some data retained for regulatory compliance',
      retainedUntil: calculateRetentionEnd(userId),
    };
  }
  
  await deleteAllUserData(userId);
  return { status: 'complete' };
}

PCI DSS Compliance

If processing payment data alongside TxnCheck:

Requirement 3: Protect Stored Data

// Never store full PAN from KYC results
function processKYCResult(result: any): SafeKYCData {
  const kyc = result.result?.kycByMobile || {};
  
  return {
    name: kyc.fullName,
    panLast4: kyc.pan ? kyc.pan.slice(-4) : null,
    // Do NOT store: kyc.pan (full PAN)
  };
}

Requirement 10: Track Access

// Log all access to cardholder data
async function logPCIAccess(event: {
  userId: string;
  action: string;
  dataType: string;
  success: boolean;
}) {
  await db.pciAuditLog.create({
    data: {
      ...event,
      timestamp: new Date(),
      ipAddress: getRequestIP(),
      userAgent: getRequestUserAgent(),
    },
  });
}

Audit Trail Requirements

What to Log

EventRequired FieldsRetention
API CallRequest ID, timestamp, user, method90 days
Data AccessUser, data type, access level, reason7 years
ConsentUser, purpose, timestamp, action7 years
Data DeletionUser, data types, timestamp7 years

Audit Log Schema

interface AuditLog {
  id: string;
  eventType: 'api_call' | 'data_access' | 'consent' | 'deletion';
  userId?: string;
  customerId?: string;
  action: string;
  details: Record<string, any>;
  ipAddress: string;
  userAgent: string;
  timestamp: Date;
  // Immutable - use append-only storage
}

// Use append-only storage for audit logs
async function writeAuditLog(log: Omit<AuditLog, 'id' | 'timestamp'>) {
  // Write to immutable storage (e.g., append-only database, blockchain, S3 with object lock)
  await appendOnlyStorage.write({
    ...log,
    id: generateUUID(),
    timestamp: new Date(),
  });
}

Compliance Reporting

Generate Compliance Reports

interface ComplianceReport {
  period: { start: Date; end: Date };
  totalVerifications: number;
  consentMetrics: {
    obtained: number;
    withdrawn: number;
    pending: number;
  };
  dataRequests: {
    access: number;
    correction: number;
    erasure: number;
  };
  securityMetrics: {
    unauthorizedAttempts: number;
    dataBreaches: number;
  };
}

async function generateQuarterlyReport(
  startDate: Date,
  endDate: Date
): Promise<ComplianceReport> {
  return {
    period: { start: startDate, end: endDate },
    totalVerifications: await countVerifications(startDate, endDate),
    consentMetrics: await getConsentMetrics(startDate, endDate),
    dataRequests: await getDataRequestMetrics(startDate, endDate),
    securityMetrics: await getSecurityMetrics(startDate, endDate),
  };
}

Regular Compliance Reviews

Review TypeFrequencyResponsible Party
Access reviewMonthlySecurity team
Consent auditQuarterlyCompliance team
Data retention checkQuarterlyDPO
Security assessmentAnnuallyExternal auditor
Policy reviewAnnuallyLegal + Compliance

Data Processing Agreement

Ensure your agreement with TxnCheck covers:
  • Categories of personal data processed
  • Purpose limitation
  • Data retention periods
  • Sub-processor disclosure
  • Encryption standards
  • Access controls
  • Incident response procedures
  • Audit rights
  • Process for handling requests
  • Response timeframes
  • Cooperation requirements
  • Notification timeframes (72 hours)
  • Information to be provided
  • Remediation procedures

Compliance Checklist

Before Going Live

1

Legal Review

Have legal team review TxnCheck DPA and terms
2

Consent Flow

Implement and test consent collection
3

Data Mapping

Document all data flows and storage locations
4

Audit Logging

Verify audit logs capture required events
5

Retention Policies

Configure automated data deletion
6

Rights Handling

Implement data subject request workflows

Ongoing Compliance

  • Monthly access reviews
  • Quarterly consent audits
  • Annual security assessment
  • Regular policy updates
  • Staff training on data handling

Penalties for Non-Compliance

RegulationPotential Penalty
DPDP ActUp to ₹250 crore per violation
RBI KYCLicense restrictions, fines
PCI DSSFines up to $100,000/month, card processing suspension
Non-compliance with data protection regulations can result in significant financial penalties and reputational damage. Consult with legal and compliance experts for your specific situation.

Resources