CSF
The Constancia de Situación Fiscal (CSF) is an official SAT document that certifies the fiscal status of a taxpayer. It contains the legal name, fiscal regime, and registered address of the RFC.
A CSF is fetched by creating an extraction with extractor: "csf". The same CIEC credentials stored for the entity are used to authenticate against the SAT portal.
Lifecycle
sequenceDiagram
autonumber
participant App as Your app
participant API as Meefi API
participant SAT as SAT portal
App->>+API: POST /v1/extractions
{ entity_id, extractor: "csf" }
API-->>-App: 201 Created
{ status: pending }
Note over API,SAT: Async extraction
API->>+SAT: Authenticate with RFC + CIEC
SAT-->>API: Session established
API->>+SAT: Request CSF PDF
SAT-->>-API: PDF bytes
API->>API: Parse PDF → legal_name, fiscal_regime, fiscal_address
API->>API: Upload PDF to storage
API->>API: Create CsfDocument record
API->>App: webhook csf_document.create
API->>App: webhook extraction.update { status: finished }
App->>+API: GET /v1/csf/{entity_id}
API-->>-App: 200 OK — CsfDocumentCsfDocument object
| Field | Type | Description |
|---|---|---|
id |
UUID | Primary key |
entity_id |
UUID | Entity this document belongs to |
extraction_id |
UUID | Extraction that produced this document |
legal_name |
string | null | Nombre / Razón Social as registered with the SAT |
fiscal_regime |
string | null | Régimen fiscal code and description (e.g. 601 General de Ley…) |
fiscal_address |
string | null | Domicilio Fiscal as registered |
pdf_available |
boolean | Whether the raw PDF is available for download |
created_at |
ISO 8601 | When this document was created |
Parsed fields are extracted from the PDF using pattern matching. If a field cannot be parsed it is returned as null; the document is still created.
Create a CSF extraction
POST /v1/extractions
{
"entity_id": "018abc12-...",
"extractor": "csf"
}
Requirements:
- The entity must have
credential_status: valid - No
optionsare required for CSF extractions
Response (201 Created):
{
"id": "...",
"extractor": "csf",
"status": "pending",
"entity": { "id": "...", "tax_id": "XAXX010101000", "name": "Acme SA de CV" }
}
Get the latest CSF document
GET /v1/csf/{entity_id}
Returns the most recently created CsfDocument for the entity. Returns 404 if no CSF extraction has completed yet.
{
"id": "...",
"entity_id": "...",
"extraction_id": "...",
"legal_name": "ACME SA DE CV",
"fiscal_regime": "601 General de Ley Personas Morales",
"fiscal_address": "AV INSURGENTES SUR 1000, BENITO JUÁREZ, CDMX, 03100",
"pdf_available": true,
"created_at": "2026-06-08T19:00:00.000000Z"
}
Download the CSF PDF
GET /v1/csf/{entity_id}/download
Returns a 5-minute signed URL for the raw PDF. Returns 404 if the PDF is unavailable.
{
"url": "https://storage.googleapis.com/..."
}
Webhooks
Two events fire during a CSF extraction:
extraction.update
Fires twice: when the extraction moves to running, and when it reaches finished or failed.
{
"type": "extraction.update",
"object": {
"status": "finished",
"entity": { "id": "...", "tax_id": "XAXX010101000", "name": "Acme SA de CV" }
}
}
csf_document.create
Fires once when the CSF document is created (after the PDF is parsed). This is the signal that new fiscal data is available.
{
"type": "csf_document.create",
"object": {
"id": "...",
"entity_id": "...",
"extraction_id": "...",
"legal_name": "ACME SA DE CV",
"fiscal_regime": "601 General de Ley Personas Morales",
"fiscal_address": "AV INSURGENTES SUR 1000, BENITO JUÁREZ, CDMX, 03100",
"entity": { "id": "...", "tax_id": "XAXX010101000", "name": "Acme SA de CV" }
}
}