> ## Documentation Index
> Fetch the complete documentation index at: https://docs-mx.taxo.ws/llms.txt
> Use this file to discover all available pages before exploring further.

# Tax Status Certificate (CSF)

> Understanding Constancia de Situación Fiscal and its extraction from SAT

## Overview

**Constancia de Situación Fiscal (CSF)** is an official document issued by SAT that certifies a taxpayer's current tax status in Mexico. This certificate is essential for numerous business and legal transactions, serving as proof of tax compliance and good standing with Mexican tax authorities.

## What is a Tax Status Certificate?

The CSF is a comprehensive document that provides official verification of:

* **Tax compliance status**: Current standing with SAT
* **Business registration details**: RFC, legal name, tax regime
* **Address information**: Fiscal domicile registration
* **Tax obligations**: Active requirements and filing status
* **Economic activities**: Registered business activities

> [accordion] Legal Authority
>
> The CSF has official legal standing for:
>
> * **Banking operations**: Account opening, loans, credit lines
> * **Government contracts**: Public sector procurement
> * **Business partnerships**: Joint ventures, supplier agreements
> * **Legal proceedings**: Court cases, notarial acts
> * **International trade**: Import/export documentation

> [accordion] Certificate Validity
>
> CSF certificates have specific validity periods:
>
> * **Standard validity**: 30 days from issue date
> * **Extended validity**: 6 months for specific procedures
> * **Real-time verification**: Online validation through SAT
> * **Automatic expiration**: Must be renewed regularly

> [accordion] Document Format
>
> CSF certificates are issued exclusively in PDF format:
>
> * **Digital signatures**: SAT's official electronic seal
> * **QR code verification**: Online authentication
> * **Security features**: Watermarks and encryption
> * **Standardized layout**: Consistent official format

## Information Contained in CSF

### Primary Taxpayer Data

> [card] Identity Information
>
> * RFC (Tax ID)
> * Legal business name
> * Commercial name (if different)
> * Taxpayer type (Individual/Entity)

> [card] Registration Details
>
> * Fiscal domicile address
> * Registration date with SAT
> * Current tax regime
> * Economic activity codes

> [card] Compliance Status
>
> * Tax filing status
> * Outstanding obligations
> * Penalty status
> * Good standing confirmation

> [card] Contact Information
>
> * Registered email address
> * Phone numbers on file
> * Legal representative details
> * Authorized third parties

### Tax Regime Information

The CSF includes detailed information about the taxpayer's tax regime:

| Regime Code | Description | Key Characteristics |
| - | - | - |
| `601` | General Legal Entities | Standard corporate tax regime |
| `603` | Legal Entities with Non-Profit Activities | Non-profit organizations |
| `605` | Individual with Business Activity | Small business owners |
| `606` | Individual with Business and Professional Activities | Independent professionals |
| `608` | Individual with Rental Income | Property rental income |
| `610` | Individual with Other Income | Mixed income sources |
| `612` | Legal Entity with Non-Profit Activities | Authorized to receive donations |
| `614` | Individual with Business Activities | Simplified trust regime |
| `616` | Individual Without Business Activities | Salary and investment income |

## Extracting Tax Status Certificates

### Basic Extraction Request

```json theme={null}
{
  "subject": {
    "identifier": "GACJ841128A87"
  },
  "credentials": {
    "SAT": {
      "type": "USERNAME_PASSWORD",
      "username": "GACJ841128A87", 
      "password": "CIEC_PASSWORD"
    }
  },
  "options": {
    "informationType": "TAX_STATUS",
    "period": {
      "from": "2024-01-01",
      "to": "2024-01-31"
    }
  }
}
```

> [!NOTE]
>
> Tax status certificates don't use the `direction` parameter since they represent the taxpayer's own status, not transactional documents.

### Certificate Types and Filtering

```json Current Status Certificate theme={null}
{
  "options": {
    "informationType": "TAX_STATUS",
    "certificateType": "CURRENT_STATUS"
  }
}
```

```json Historical Status theme={null}
{
  "options": {
    "informationType": "TAX_STATUS", 
    "period": {
      "from": "2023-01-01",
      "to": "2023-12-31"
    }
  }
}
```

```json Specific Date Range theme={null}
{
  "filters": {
    "issueDate": {
      "operator": "between",
      "value": ["2024-01-01", "2024-01-31"]
    }
  }
}
```

## Common Use Cases

### Banking and Financial Services

> [accordion] Account Opening
>
> **Requirements**: Current CSF (less than 30 days old)
>
> ```javascript theme={null}
> // Verify CSF is current for banking
> function validateCSFForBanking(csf) {
>   const issueDate = new Date(csf.issueDate);
>   const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
>
>   if (issueDate < thirtyDaysAgo) {
>     throw new Error('CSF too old for banking - must be less than 30 days');
>   }
>
>   if (csf.taxStatus !== 'ACTIVE') {
>     throw new Error('Taxpayer must be in active status');
>   }
>
>   return true;
> }
> ```

> [accordion] Credit Applications
>
> **Requirements**: CSF plus compliance verification
>
> ```javascript theme={null}
> // Credit evaluation using CSF data
> function evaluateCreditworthiness(csf) {
>   const evaluation = {
>     taxCompliance: csf.outstandingObligations === 0,
>     businessAge: calculateBusinessAge(csf.registrationDate),
>     taxRegime: csf.taxRegime,
>     economicActivity: csf.economicActivities,
>     riskScore: calculateRiskScore(csf)
>   };
>
>   return evaluation;
> }
> ```

### Government Contracting

> [accordion] Supplier Registration
>
> **Requirements**: Valid CSF with specific compliance status
>
> ```javascript theme={null}
> // Validate CSF for government contracting
> function validateCSFForGovernmentContract(csf) {
>   const requiredFields = [
>     'rfc', 'legalName', 'fiscalAddress', 
>     'taxRegime', 'economicActivities'
>   ];
>
>   for (const field of requiredFields) {
>     if (!csf[field]) {
>       throw new Error(`Missing required field: ${field}`);
>     }
>   }
>
>   if (csf.penalties && csf.penalties.length > 0) {
>     throw new Error('Taxpayer has outstanding penalties');
>   }
>
>   return true;
> }
> ```

> [accordion] Contract Execution
>
> **Requirements**: Ongoing compliance monitoring
>
> ```javascript theme={null}
> // Monitor CSF status during contract
> async function monitorContractorCompliance(rfc) {
>   const currentCSF = await extractTaxStatus(rfc);
>
>   const complianceReport = {
>     contractorRFC: rfc,
>     lastVerification: new Date(),
>     complianceStatus: currentCSF.taxStatus,
>     issues: [],
>     recommendedActions: []
>   };
>
>   if (currentCSF.outstandingObligations > 0) {
>     complianceReport.issues.push('Outstanding tax obligations');
>     complianceReport.recommendedActions.push('Request compliance plan');
>   }
>
>   return complianceReport;
> }
> ```

### Business Operations

### Supplier Verification

```javascript theme={null}
// Automated supplier verification using CSF
class SupplierVerificationService {
  async verifySupplier(supplierRFC) {
    try {
      // Extract latest CSF
      const extraction = await this.createTaxStatusExtraction(supplierRFC);
      const csf = await this.waitForExtraction(extraction.publicId);
      
      // Perform verification checks
      const verification = {
        rfc: supplierRFC,
        verificationDate: new Date(),
        checks: {
          activeStatus: this.checkActiveStatus(csf),
          validRegime: this.checkTaxRegime(csf),
          complianceStatus: this.checkCompliance(csf),
          addressVerification: this.checkAddress(csf)
        },
        riskAssessment: this.assessRisk(csf),
        approved: false
      };
      
      // Calculate overall approval
      verification.approved = Object.values(verification.checks)
        .every(check => check.passed);
      
      return verification;
    } catch (error) {
      return {
        rfc: supplierRFC,
        error: error.message,
        approved: false
      };
    }
  }
  
  checkActiveStatus(csf) {
    return {
      passed: csf.taxStatus === 'ACTIVE',
      message: csf.taxStatus === 'ACTIVE' 
        ? 'Taxpayer is active' 
        : `Taxpayer status: ${csf.taxStatus}`
    };
  }
  
  checkTaxRegime(csf) {
    const validRegimes = ['601', '603', '605', '606', '612'];
    return {
      passed: validRegimes.includes(csf.taxRegime),
      message: `Tax regime: ${csf.taxRegime}`
    };
  }
  
  checkCompliance(csf) {
    return {
      passed: csf.outstandingObligations === 0 && 
              (!csf.penalties || csf.penalties.length === 0),
      message: csf.outstandingObligations > 0 
        ? 'Has outstanding obligations' 
        : 'Compliant'
    };
  }
}
```

## Processing CSF Data

### Data Extraction from PDF

```javascript theme={null}
// Extract key information from CSF PDF
class CSFProcessor {
  async processTaxStatusCertificate(pdfBuffer) {
    try {
      // Parse PDF content
      const pdfText = await this.extractTextFromPDF(pdfBuffer);
      
      // Extract structured data
      const csfData = {
        rfc: this.extractRFC(pdfText),
        legalName: this.extractLegalName(pdfText),
        commercialName: this.extractCommercialName(pdfText),
        taxRegime: this.extractTaxRegime(pdfText),
        fiscalAddress: this.extractFiscalAddress(pdfText),
        economicActivities: this.extractEconomicActivities(pdfText),
        registrationDate: this.extractRegistrationDate(pdfText),
        issueDate: this.extractIssueDate(pdfText),
        taxStatus: this.extractTaxStatus(pdfText),
        outstandingObligations: this.extractOutstandingObligations(pdfText)
      };
      
      // Validate extracted data
      this.validateCSFData(csfData);
      
      return csfData;
    } catch (error) {
      throw new Error(`CSF processing failed: ${error.message}`);
    }
  }
  
  extractRFC(text) {
    const rfcPattern = /RFC:\s*([A-ZÑ&]{3,4}\d{6}[A-V1-9][A-Z1-9][0-9A])/;
    const match = text.match(rfcPattern);
    return match ? match[1] : null;
  }
  
  extractTaxRegime(text) {
    const regimePattern = /Régimen:\s*(\d{3})\s*-\s*([^\.]+)/;
    const match = text.match(regimePattern);
    return match ? {
      code: match[1],
      description: match[2].trim()
    } : null;
  }
  
  validateCSFData(data) {
    const required = ['rfc', 'legalName', 'taxRegime', 'issueDate'];
    const missing = required.filter(field => !data[field]);
    
    if (missing.length > 0) {
      throw new Error(`Missing required fields: ${missing.join(', ')}`);
    }
  }
}
```

### Integration with Business Systems

```javascript theme={null}
// Update customer/supplier records with CSF data
async function updateBusinessPartnerStatus(rfc) {
  try {
    // Get latest CSF
    const csf = await extractAndProcessCSF(rfc);
    
    // Update in CRM/ERP system
    await updateBusinessPartner(rfc, {
      legalName: csf.legalName,
      commercialName: csf.commercialName,
      fiscalAddress: csf.fiscalAddress,
      taxRegime: csf.taxRegime.code,
      taxStatus: csf.taxStatus,
      lastVerification: csf.issueDate,
      complianceStatus: csf.outstandingObligations === 0 ? 'COMPLIANT' : 'NON_COMPLIANT',
      economicActivities: csf.economicActivities
    });
    
    // Create compliance alert if needed
    if (csf.outstandingObligations > 0) {
      await createComplianceAlert({
        partnerRFC: rfc,
        issue: 'Outstanding tax obligations detected',
        severity: 'HIGH',
        actionRequired: 'Review business relationship'
      });
    }
    
    console.log(`Updated business partner ${rfc} with latest CSF data`);
  } catch (error) {
    console.error(`Failed to update partner ${rfc}:`, error.message);
  }
}
```

## Compliance and Best Practices

### Certificate Management

> [!TIP]
>
> Monitor CSF expiration dates (30-day validity)

> [!TIP]
>
> Set up automatic renewal reminders

> [!TIP]
>
> Maintain historical CSF records for audit trails

> [!TIP]
>
> Verify QR codes and digital signatures

> [!TIP]
>
> Store certificates in secure, encrypted storage

> [!TIP]
>
> Implement access controls for sensitive tax data

### Automated Compliance Monitoring

```javascript theme={null}
// Schedule regular CSF updates for critical suppliers
class ComplianceMonitor {
  constructor() {
    this.criticalSuppliers = [];
    this.monitoringSchedule = new Map();
  }
  
  async scheduleCriticalSupplierMonitoring(rfc, frequency = 'weekly') {
    this.criticalSuppliers.push(rfc);
    
    const schedule = {
      rfc: rfc,
      frequency: frequency,
      lastCheck: null,
      nextCheck: this.calculateNextCheck(frequency),
      status: 'active'
    };
    
    this.monitoringSchedule.set(rfc, schedule);
    
    // Set up automated checking
    this.scheduleCSFCheck(rfc, frequency);
  }
  
  async performScheduledCheck(rfc) {
    try {
      const csf = await extractAndProcessCSF(rfc);
      const schedule = this.monitoringSchedule.get(rfc);
      
      schedule.lastCheck = new Date();
      schedule.nextCheck = this.calculateNextCheck(schedule.frequency);
      
      // Check for compliance issues
      const issues = this.identifyComplianceIssues(csf);
      
      if (issues.length > 0) {
        await this.alertComplianceTeam(rfc, issues);
      }
      
      // Update schedule
      this.monitoringSchedule.set(rfc, schedule);
      
    } catch (error) {
      console.error(`Scheduled CSF check failed for ${rfc}:`, error.message);
    }
  }
}
```

## Troubleshooting Common Issues

> [accordion] Certificate Not Found
>
> **Problem**: CSF extraction returns no results
>
> **Possible Causes**:
>
> * Taxpayer not registered with SAT
> * RFC format incorrect
> * Recent registration (processing delay)
>
> **Solutions**:
>
> * Verify RFC format and spelling
> * Check SAT's public database for registration
> * Wait 24-48 hours for new registrations
> * Contact taxpayer to confirm RFC

> [accordion] Expired Certificate
>
> **Problem**: CSF is older than required validity period
>
> **Solutions**:
>
> * Request new CSF extraction
> * Implement automatic renewal processes
> * Set up expiration alerts
> * Use real-time verification when possible

> [accordion] PDF Processing Errors
>
> **Problem**: Cannot extract data from CSF PDF
>
> **Possible Causes**:
>
> * Corrupted PDF download
> * Changed PDF format by SAT
> * Security restrictions on PDF
>
> **Solutions**:
>
> * Re-download certificate
> * Update PDF parsing libraries
> * Implement OCR fallback
> * Manual data entry for critical cases

## Next Steps

> [card] [SAT API Quickstart](https://docs-mx.taxo.ws/countries/mx/tax-authorities/sat/quickstart.md)
>
> Start extracting tax status certificates from SAT

> [card] [Tax Retention](https://docs-mx.taxo.ws/countries/mx/document-types/tax-retention.md)
>
> Learn about tax retention document extraction

> [card] [Compliance Automation](https://docs-mx.taxo.ws/countries/mx/use-cases/compliance-automation.md)
>
> Automate compliance monitoring with CSF data

> [card] [Integration Best Practices](https://docs-mx.taxo.ws/global/integration-guides/best-practices.md)
>
> Production-ready integration patterns


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.