Inicio  |  Emisión  |  1.1. Conector  |  1.1.2. Tipos de archivo conector  |  1.1.2.7 Conector-txt v6.0 / CFDI
La LCO fue actualizada por última vez el 22/nov/2024

2022 update for CFDI

Starting January 1st, 2022 some modifications were introduced by the SAT regarding CFDI creation.:
  • Major version 4.0 is mandatory on May 1st 2022. (updated from 3.3)
  • Recipient name and address are mandatory.
  • If the operation is related to exports, new fields are needed.
  • Identification of base amount and base tax on a per product basis is needed.
  • Global invoice parameters and new rules for generic rfc usage.
a new mechanism for cfdi cancellation :
  • As of 2022, it is necessary to include the reason for cancelling a document.e The possible values are listed in the SAT catalogue.
  • If using 01 as reason (see above), a new field for linking documents must be used.

Conector-txt v6.0 / CFDI

Solución Factible®'s goal is to provided an easy way adoption on the costumer's side for the emission of electronic invoices. With this in mind, the CFDI connector has been developed to deliver the easiness of creating a CFDI document through a TXT file.

Specification

The current 6.0 version on the txt-connector file divides data between new lines (CR, LF o CR+LF.). Each line contains business data according to the CFDI(s) to create.

The file contains identifiers at the start of each line indicating the data's type being used. It is a sequential file read top to bottom and is based on the order of the CFDI's nodes, however this can be modified to your needs. Multiple CFDI(s) can be appended to a single file.

Each field of every section (identifier) is separated by the pipe character (|, ASCII 124) and are extracted on the right to left ordering, however field position can be configured to change parsing ordering.

If you require a different separating character it must be specified to Solución Factible®'s support personnel. Although it is suggested not to choose common characters such as "comma" or "semicolon" because they can interfere with the proper reading of the conector if your information contains data with such characters.

File encoding can be either ISO88591 (default) or UTF8.

SFERP|6.0|
Comprobante|1|A|true|||
Generales|06/11/2016 17:45:00|01|Contado|PUE|601||notas del comprobante|45070|
ComprobanteRelacionado|714E4B22-9620-499E-9659-01E0D19F719C|04|58670|F|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||oscar@dominioempresa.com.mx|||G01|
DireccionFiscal|México|Jalisco......|










The TXT file must contain, SFERP|6.0|, as the initial line. It is a unique and mandatory line which identifies the conector's version being used. Afterwards the CFDI data will be specified. All lines must start with their proper identifiers, all being marked in bold in the examples.

Identifiers and fields

Each identifier represents the start of a section that contains an specific number of fields. The different identifiers and their fields are shown next.

Some identifiers and their fields can repeat across lines within the file since business data might call for it. For instance multiple "Concepto" identifiers might exists to accommodate a CFDI that contains many products/services.

  • SFERP|6.0|
  • Comprobante|folioComprobante|serieComprobante|statusComprobante|ClaveConfirmacionPAC|sectorPrimario|
  • Cancelacion|reason|uuidSubstitution|folioSubstitution|serieSubstitution|internaldescription|
  • Generales|fechaHora|formaPago|condicionesPago|metodoPago|RegimenFiscal|motivoDescuento|notas|LugarExpedicion|
  • ComprobanteRelacionado|UUIDComprobanteRelacionado|TipoRelacion|folioRelacionado|serieRelacionado|
  • Divisa|moneda|monedaSimbolo|tipoCambio|
  • Receptor|Nombre|RFC|CURP|email|ResidenciaFiscal|NumRegIdTrib|UsoCFDI|RegimenFiscalReceptor
    • DireccionFiscal|pais|estado|municipio|ciudad|calle|numExterior|numInterior|colonia|cp|
    • DireccionEmbarque|nombre|rfc|pais|estado|municipio|ciudad|calle|numExterior|numInterior|colonia|cp|
  • Concepto|codigo|descripcion|unidad|cantidad|valorUnitario|comentario|importe|tasaDescuento|importeDescuento|
    cuentaPredial|ClaveProdServSAT|ClaveUnidadSAT|
    • ImpuestosConcepto|TipoImpuesto|NombreImpuesto|ImporteImpuesto|TasaOCuotaImpuesto|TipoFactor|
      BaseImpuesto|
    • AduanaConcepto|pedimentoAduana|
    • ParteConcepto|cantidad|descripcion|noIdentificacion|importe|unidad|valorUnitario|ClaveProdServSAT|
    • AduanaParte|pedimentoAduana|
    • ComplementoConcepto|nombre|ComplementoDatos|
    • CamposDinamicosConcepto|CAMPO_1|CAMPO_2|CAMPO_3|....|
  • ImpuestosComprobante|TipoImpuesto|NombreImpuesto|ImporteImpuesto|TasaOCuotaImpuesto|TipoFactor|
  • Totales|subtotal|totalTraslados|totalRetenciones|totalDescuentos|totalComprobante|
  • CamposDinamicos|CAMPO_1|CAMPO_2|CAMPO_3|....|
  • Complemento|IdentificadorComplemento|
  • Addenda|nombre|
    • Addenda data...

External links

Examples

Download more examples

Simple CFDI, one product.

Download

SFERP|6.0|
Comprobante|6|FTVN|true|||
Generales|12052017|01||PUE||622||Notas del comprobante|45070|
ComprobanteRelacionado|714E4B22-9620-499E-9659-01E0D19F719C|04|58670|F|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||oscar@dominioempresa.com.mx|||G01|
Concepto|123456|Bicicletas de motor de importacion.|PZA|1|10000|Producto importado|10000||||25101800|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|15 19 3710 5025673|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000|1600|0.00|0.00|11600|

Simple CFDI, many products.

Download

SFERP|6.0|
Comprobante|6|FTVN|true|||
Generales|12052017|01||PUE||622||Notas del comprobante|45070|
ComprobanteRelacionado|714E4B22-9620-499E-9659-01E0D19F719C|04|58670|F|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||empresa@dominioempresa.com.mx|||G01|
Concepto|123456|Bicicletas de motor de importacion.|PZA|1|10000|Producto importado|10000||||25101800|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|15 19 3710 5025673|
Concepto|124578|Alimento vivo para aves|PZA|1|10000|Producto importado|||||10121601|29|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|15 19 3710 5025673|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|20000|3200|0.00|0.00|23200|

Multiple CFDIs per file

Download

SFERP|6.0|
Comprobante|6|FTVN|true|||
Generales|05012011:09:40:10|01||PUE||622||Notas del comprobante|45070|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||empresa@dominioempresa.com.mx|||G01|
Concepto|123456|Bicicletas de motor de importacion.|PZA|1|10000|Producto importado|10000||||25101800|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|15 19 3710 5025673|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000|1600|0.00|0.00|11600|

Comprobante|2|A|true|
Generales|05012011:11:40:10|01||PUE||622||Notas del comprobante|45070|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||empresa@dominioempresa.com.mx|||G01|
Concepto|124578|Alimento vivo para aves|PZA|1|10000|Producto importado|||||10121601|29|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|14 23 8712 5025673|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000|1600|0.00|0.00|11600|

With different currency

SFERP|6.0|
Comprobante|41|FTVN|true|||
Generales|17052017|01||PUE||622||notas del comprobante|45079|
Divisa|Yen|JPY|0.166123|
Receptor|OSCAR KALA HAAK|KAHO641101B39||empresa@dominioempresa.com.mx|||G01|
DireccionFiscal|MEX|Jalisco|Zapopan|Zapopan|FRANCISCO I. MADERO|123||Centro|45900|
Concepto|23534855|Concepto con divisa JPY|PZA|1|10000|Producto importado|10000||||25101800|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000.01|1600|0.00|0.00|11600|

Products with customs' information

SFERP|6.0|
Comprobante|23|FTVN|true|||
Generales|14052017|01||PUE||622||Notas del comprobante|45070|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||cliente@consumidor.com.mx|||G01|
Concepto|23534855|Concepto con aduanera|PZA|1|10000|Producto importado|10000||||25101800|EA|
ParteConcepto|1|Descripcion|979854|1000|1|1000|01010101|
AduanaParte|10 47 3807 8002932|
ParteConcepto|1|Otra Descripcion|132156465|1000|1|1000|10101500|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
Concepto|23534856|Otro concepto con aduanera|PZA|1|10000|Producto importado|10000||||25101800|EA|
ParteConcepto|1|Más Descripciones|979854|1000|1|1000|10101501|
ParteConcepto|1|Otra más|132156465|1000|1|1000|10101502|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
ImpuestosComprobante|T|IVA|3200|16|Tasa|
Totales|20000|3200|0.00|0.00|23200|



















With IEPS taxes

SFERP|6.0|
Comprobante|33|FTVN|true|||
Generales|15052017|01||PUE||622||notas del comprobante|45079|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||oscar@dominioempresa.com.mx|||G01|
DireccionFiscal|MEX|Jalisco|Zapopan|Zapopan|FRANCISCO I. MADERO|123||Centro|45900|
Concepto|23534855|Concepto con IEPS|PZA|1|10000|Producto importado|10000|||132132132156654|25101800|EA|
ImpuestosConcepto|T|IEPS|1600|16|Cuota|10000|
ImpuestosComprobante|T|IEPS|1600|16|Cuota|
Totales|10000|1600|0.00|0.00|11600|

Concepto con ClaveProdServ 78111500

SFERP|6.0|
Comprobante|35|FTVN|true|||
Generales|15052017|01||PUE||622||notas del comprobante|45079|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||oscar@dominioempresa.com.mx|||G01|
DireccionFiscal|MEX|Jalisco|Zapopan|Zapopan|FRANCISCO I. MADERO|123||Centro|45900|
Concepto|23534855|Concepto con ClaveProdServ 78111500|PZA|1|10000|Producto importado|10000||||78111500|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000|1600|0.00|0.00|11600|

With predial account

SFERP|6.0|
Comprobante|32|FTVN|true|||
Generales|15052017|01||PUE||622||notas del comprobante|45079|
ComprobanteRelacionado|714E4B22-9620-499E-9659-01E0D19F719C|04|58670|F|
Divisa|Peso Mexicano|MXN|1|
Receptor|OSCAR KALA HAAK|KAHO641101B39||oscar@dominioempresa.com.mx|||G01|
DireccionFiscal|MEX|Jalisco|Zapopan|Zapopan|FRANCISCO I. MADERO|123||Centro|45900|
Concepto|23534855|Concepto con cuenta predial|PZA|1|10000|Producto importado|10000|||132132132156654|25101800|EA|
ImpuestosConcepto|T|IVA|1600|16|Tasa|10000|
AduanaConcepto|15 19 3710 5025673|
ImpuestosComprobante|T|IVA|1600|16|Tasa|
Totales|10000|1600|0.00|0.00|11600|

Data Dictionary

Download this table as a spreadsheet.

Type
Fields
Description
Comprobante" fields
Mandatory id
R
folioComprobante
Folio number for the cfdi Ex: 525
R
serieComprobante
Cfdis are organized by using a string called Serie. Ex: SJ
R
statusComprobante
Cfdi Status (1=active; 0=Canceled or void TRUE=active; FALSE=Canceled or void)
O
sectorPrimario
Primary sector of economy (TRUE=Active)
O
ClaveConfirmacionPAC
Additional field, required when registering the confirmation token delivered by the Certification-Authorized Provider (PAC) for creating CFDI(s) with big amounts (>=100'000,000.00 MXN), an exchange rate different to the one established by the Bank of Mexico, or both.
"Generales" fields
Mandatory id
R
fechaHora
Cfdi creation date-time. (ddMMyyyyHHmmss) Ex: 05012011:09:40:10
O
formaPago
Payment form, Ex: 01 (cash), 02 (check), 04 (credit card), 28 (debit card), etc.
O
condicionesPago
Payment conditions. Ex: CONTADO
O
metodoPago
Method of payment. Ex: PUE (Pago en una sola exhibición/Single payment) or PPD (Pago en parcialidades o diferido/payment in installments or deferred payment).
R
RegimenFiscal
Regime of entity. Ex: 612 (Personas físicas), 606 (Arrendamiento), 601 (Personas morales), etc.
O
motivoDescuento
Reason for a discount on CFDI.
O
notas
CFDI comments (id usefd, displayed on PDF only)
O
LugarExpedicion
location's postal code of the CFDI to generate
"ComprobanteRelacionado" fields
Optional id
C
UUIDComprobanteRelacionado
The financial folio of the CFDI related to this CFDI. Ex: "0001Z001-001Z-1XYZ-01X1-A01B01012121". If this CFDI replaces a canceled CFDI.
If this field is specified, fields "folioRelacionado" and "serieRelacionado" must be left unspecified.
R
TipoRelacion
The relationship code between this CFDI an the previous CFDI(s). Ex: 04 (Sustitución de los CFDI previos/previous CFDI(s) replacement), etc.
C
folioRelacionado
Folio of the related CFDI. If this field is specified field "UUIDComprobanteRelacionado" must be left unspecified, and field "serieRelacionado" must be filled too.
C
serieRelacionado
Series of the related CFDI. If this field is specified field "UUIDComprobanteRelacionado" must be left unspecified, and field "folioRelacionado" must be filled too.
"Divisa" fields
Optional id
If not used, the default moneda/currency will be Mexican Pesos "MXN"
O
moneda
Currency. Ejem: PESOS MEXICANOS, MXN
R
monedaSimbolo
Currency in ISO format. Ex: MXN
C
tipoCambio
Exchange rate, required if the currency is different from MXN or XXX Ex: 15.00
"Receptor" fields
Mandatory id
O
Nombre
Recipient/customer name. Ex: PÚBLICO EN GENERAL
R
RFC
Recipient/Customer RFC. Ex: XAXX010101000
C
CURP
Mandatory for payroll
O
email
Costumer/Recipient email.
C
ResidenciaFiscal
For registering the recipient's country of residence code for tax effects, when he/she is an alien, and is in conformity with ISO 3166 alpha-3. Required when the external commerce complement (comercio exterior) is included or the field NumRegIdTrib is registered.
O
NumRegIdTrib
For registering the recipient's fiscal identity's registry number when the recipient lives abroad. Required when the external commerce complement (comercio exterior) is included.
R
UsoCFDI
This CFDI usage code. Ex: I03 (Equipo de transporte/transport equipment), D04 (Donativos/donations), etc.
"DireccionFiscal" fields
Mandatory id
R
pais
Country. [Recipients Address] Ex: MÉXICO
O
estado
State [Recipients Address]
O
municipio
Municipio / delegacion [Recipients Address]
O
ciudad
City [Recipients Address]
O
calle
Street name [Recipients Address]
O
numExterior
External number [Recipients Address]
O
numInterior
Internal number, suite, apt [Recipients Address]
O
colonia
Colonia [Recipients Address]
O
cp
Zipcode [Recipients Address]
"DireccionEmbarque" fields
Optional id
O
nombre
[Shiping entity's Name]
O
RFC
[Shipping entity's RFC]
R
pais
Country. [Shipping Address] Ex: MÉXICO
O
estado
State [Shipping Address]
O
municipio
County [Shipping Address]
O
ciudad
City [Shipping Address]
O
calle
Street name [Shipping Address]
O
numExterior
External number [Shipping Address]
O
numInterior
Internal number, suite, apt [Shipping Address]
O
colonia
Neighborhood [Shipping Address]
O
cp
Zipcode [Shipping Address]
"Concepto" fields
Mandatory id
O
codigo
Product/service Code/SKU (Customer defined)
R
descripcion
Product description
O
unidad
Customer's defined unit of sale. ex: PZA
R
cantidad
Quantity. Ex: 5
R
valorUnitario
Unit price. Ex: 5.00
O
comentario
Extra notes/comments on product
R
importe
Unit price(valorUnitario) x quantity(cantidad). ex: 25.00
O
tasaDescuento
Discount rate scale from 0 to 100. ex: 20
O
importeDescuento
Discount (if not using rate). Ejem: 34.00. Must be lesser or equal to field "importe", negatives values are not permitted.
O
cuentaPredial
"Predial" account number, needed only when creating arrendamiento CFDI.
R
ClaveProdServSAT
Service or Product's code according to Mexico's IRS's published products and services code catalog.
R
ClaveUnidadSAT
Product's standardized unit of measurement applied to the product's quantity according to Mexico's IRS's published measurement units code catalog. The unit must correspond to the product's description.
"ImpuestosConcepto" fields
Optional id
R
TipoImpuesto
Tax type. T = Traslado // R = Retención
R
NombreImpuesto
Tax name. ex: 001(ISR), 002(IVA) or 003(IEPS)
R
ImporteImpuesto
Tax amount. ex: 160
C
TasaOCuotaImpuesto
Tax rate. Ex: 16. Required when field "TipoFactor" value's is "Tasa" or "Cuota".
R
TipoFactor
Code of the type of factor applied to the tax. Ex: "Tasa", "Cuota" or "Exento".
R
BaseImpuesto
Required for stating the tax calculation basis. Negative numbers are not permitted.
"AduanaConcepto" fields
Optional id
R
pedimentoAduana
Comma separated "pedimento" ids
"ParteConcepto" fields
Optional id
R
cantidad
Quantity "parte del concepto"
R
descripcion
Description "parte del concepto"
O
noIdentificacion
Code/SKU "parte del concepto"
R
importe
Unit price(valorUnitario) x quantity(cantidad). ex: 25.00 "parte del concepto"
R
unidad
unit of sale "parte del concepto"
R
valorUnitario
Unit price "parte del concepto"
R
ClaveProdServSAT
Service or Product's code according to Mexico's IRS's published products and services code catalog.
"AduanaParte" fields
Optional id
R
pedimentoAduana
Customs pedimento "parte del concepto"
"ImpuestosComprobante" fields
Optional id
R
TipoImpuesto
Tax type. T = Traslado // R = Retención
R
NombreImpuesto
Tax name. ex: 001(ISR), 002(IVA) or 003(IEPS)
R
ImporteImpuesto
Tax amount. ex: 160
R
TasaImpuesto
Tax rate. ex: 16
R
TipoFactor
Code of the type of factor applied to the tax. Ex: "Tasa", "Cuota" or "Exento".
"Totales" fields
Mandatory id
R
subtotal
Sum of all product amounts before discounts and taxes. Negative values are not permitted.
C
totalTraslados
Total of "Traslado" taxes. Mandatory if any "traslado" tax was used in concepto.
C
totalRetenciones
Total of "Retencion" taxes. Mandatory if any "retencion" tax was used in concepto. (Withholdings)
O
totalDescuentos
CFDI discount totals. Negative values are not permitted.
R
totalComprobante
CFDI total. Negative values are not permitted.
  • R= Required
  • C= Conditional
  • O= Optional

Interpreter (Intérprete)

If you would like to identify the values of your configuration chain for the TXT conector v6.0 click here.

comments powered by Disqus