Basic Concepts

A small guide that will help you better understand some basic concepts of electronic invoices.

What is a CFDI?

The electronic invoice or Comprobante Fiscal Digital por Internet (CFDI) in Mexico is a digital receipt implemented by the tax authority of our country, adhering to the standards defined by the Servicio de Administración Tributaria (SAT).

The SAT specifies which guidelines are suitable for issuing these types of documents according to the needs they believe are essential for the proper handling of taxes

What function does a CFDI serve?

The electronic invoice or Comprobante Fiscal Digital por Internet (CFDI) serves as a document that describes a specific good or service purchased, the transaction date, its cost, and breaks down the taxes related to the payment of that transaction.

They also serve to support all income and expense movements of taxpayers before the tax authority

How is a CFDI composed?

Both the invoices you issue and those you receive must meet certain requirements and include specific data to be valid:

  • The Registro Federal de Contribuyentes (RFC) of the entity issuing the CFDI.
  • The tax regime under which it is registered with SAT.
  • Address (if the taxpayer has more than one location, the address where the invoice is being issued is specified).
  • Folio number assigned by SAT.
  • Sello digital.
  • Place and date of issuance.
  • RFC of the person requesting the fiscal document.
  • Description of the goods, products, or services for which the CFDI is being issued, including quantity, unit of measure, or type of goods.
  • Unit value of each of them; it must be specified in numbers.
  • The total amount of the invoice, which can be indicated in numbers or in words.
  • It should also be noted whether the payment was made in a single installment or in installments.
  • If applicable, the amount of transferred taxes must be indicated, broken down by tax rate, in addition to any withheld taxes.
  • Details of the payment method, such as cash, debit or credit card, electronic transfer, check, or through an electronic wallet authorized by SAT.
  • If it was a first-hand sale of imported goods, the number and date of the customs document must also be indicated.
  • Date and time of certification.
  • Serial number of the digital certificate used for sign.

These requirements are published in the current “Formato de factura Anexo 20 de la Resolución Miscelánea Fiscal“.

How many types of CFDIs are there?

Currently, there are six types of CFDIs:

  • CFDI de Ingreso (Income CFDI): Mainly issued for the provision of services, sale of goods or merchandise, leasing, or receipt of fees. Its purpose is to demonstrate the income of taxpayers.
  • CFDI de Egreso (Expense CFDI): Issued when there is a return of goods or the cancellation of an Income CFDI. Its purpose is to cover the outflows of money for a taxpayer.
  • CFDI de Traslado (Transfer CFDI): This CFDI supports goods that will be transferred from one point to another to verify the legality of the possession of these goods.
  • CFDI de Nómina (Payroll CFDI): It is the document that contains information on withholdings and payments to workers.
  • CFDI de Recepción de Pagos (Payment Reception CFDI): Generated when a payment is received, applicable when the payment method is applied in installments.
  • CFDI de Retención e Información de Pagos (Withholding and Payment Information CFDI): Supports tax withholdings made or payments performed.”

What is the technical structure of a CFDI?

The CFDI is a digital document generated in a file with XML or Extensible Markup Language format. For a receipt to be valid, it must meet the following characteristics:

We remind you that we have a Examples section where you can find the structure of different types of CFDIs, as well as our Libraries section where you can interact with different programming languages for creating your receipts.

What is a Timbre Fiscal?

Fiscal stamps are seals used for the issuance of CFDIs provided through companies certified by the SAT, commonly referred to as PACs (Authorized Certification Providers), such as ourselves, SmarterWeb.

What is to 'Timbrar' a CFDI?

The process in which both the issuer’s seal and the tax authority’s seal are added. It can be done directly on the SAT platform or through Authorized Certification Providers (PAC)

Is 'Timbrar' the same as 'Sellar' a CFDI?

“No, ‘Sellar’ a CFDI refers to signing the document with our Digital Stamp Certificate (CSD), so that the authenticity of the document can be verified. To seal the CFDI, the values of important attributes for the SAT are concatenated, representing our original chain.

On the other hand, ‘Timbrar’ refers to generating and placing a Digital Fiscal Stamp that validates a Digital Fiscal Receipt over the Internet. This fiscal stamp is obtained by connecting to an Authorized Certification Provider (PAC) over the internet.

What is a PDF of a CFDI?

The PDF in this context is a printed representation of the CFDI, whose content is more similar to the invoices we were familiar with before. This document can be printed, although it has no legal value, as the digital file is what matters.

If you want to have a printed representation, a barcode or the fiscal folio number of the receipt should be generated; the serial number of the Digital Stamp Certificate of the issuer and the SAT, and the original chain of the digital certification supplement.

Additionally, a legend stating ‘This document is a printed representation of a CFDI’ must be added.

Legal basis: RFM 2.7.1.7 Requirements for printed representations of CFDI.

What is an XML of a CFDI?

The XML is an adaptation of SGML (Standard Generalized Markup Language), a language that allows the organization and tagging of documents. In electronic invoicing, XML is used as a communication protocol through which the information to be invoiced is sent.

How to structure an XML?

For the XML structure to be valid, it must follow the technical guidelines for form and syntax for generating XML files specified by the W3C consortium, established at www.w3.org.

The XML document must be expressed under the UTF-8 encoding standard, and particularly, escape sequences should be used when there are any of the following special cases specified within the attributes of the file.

  • In the case of ‘&’, the sequence ‘&’ must be used.
  • In the case of ‘“’, the sequence ‘”‘ must be used.
  • In the case of ‘<‘, the sequence ‘<‘ must be used.
  • In the case of ‘>’, the sequence ‘>’ must be used.
  • In the case of ‘‘’, the sequence ”’ must be used

In order to be validated, it must be referenced to the namespace of the Digital Fiscal Receipt over the Internet and refer its validation to the path published by the SAT where the XSD schema object of this section is located. You can refer to Our examples for further reference on this structure.

What is the difference between the PDF and XML of a CFDI?

XML is a markup language that defines a set of rules for encoding documents and, in this context, represents the electronic invoice.

On the other hand, PDF (Portable Document Format in English), used to display documents in electronic form, is a graphical representation of the information expressed in the CFDI.

What is to 'issue' or 'stamp' an XML?

The issuance of an XML or the stamping is nothing more than the use of a digital signature generated from the information in our CFDI to keep our information secure and ensure that it is not altered after its creation. For this process, encryption algorithms are used to prevent the manipulation of our XML.

What is an encryption algorithm?

A traditional encryption algorithm is a function that transforms a message into a seemingly random and unreadable series using an encryption key that can be reversed (i.e., obtaining the original message) only by those who know the key. Through encryption, private information can be sent publicly over the internet without significant risk of others gaining access to it.

What is a Hash function?

A hash function is a method for generating keys or codes that uniquely represent a document or set of data. It is a mathematical operation performed on this data set of any length, and its output is a fixed-size and dimension-independent fingerprint. The content is unreadable.

What is SHA-256?

SHA-256 is a 64-character hexadecimal hash used to sign text documents and/or files, which is nearly unique and has a fixed size of 256 bits (32 bytes). A hash is only calculated in one direction and cannot be decoded back, hence its advantage and high level of encryption.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Updated on enero 4, 2024

Related Articles