Skip to main content

Introduction

The CFDI (Comprobante Fiscal Digital por Internet) is the standardized electronic invoicing format in Mexico, managed by the country’s tax authority, the SAT (Servicio de Administración Tributaria). This system ensures that all fiscal documents are digitally generated, validated, and reported to SAT in compliance with national tax laws. In this guide we’ll walk you through the steps required to first register a supplier and then issue invoices in their name.

Prerequisites

To issue invoices in Mexico via the SAT, you will need:
  • Supplier details, including:
    • name,
    • taxpayer ID or RFC (Registro Federal de Contribuyentes),
    • address, and,
    • fiscal regime code issued by SAT.
  • Customer details, the same as the supplier, plus CFDI use code (código de uso CFDI).
  • Line item details including quantities, prices, applicable tax rates, and the SAT product-service code.
  • To have chosen an invoice series.
  • Issue place code (lugar de expedición).
  • A signing certificate known as a CSD (Certificado de Sello Digital) issued by the SAT for every supplier.

Setup

There are four key processes to prepare:
  • create supplier post-registration workflow,
  • connect the SAT Mexico app,
  • configure a supplier registration workflow, and,
  • prepare an invoicing workflow.
These instructions apply to both the sandbox and live environments, with a few exceptions for supplier data and registration details when real details are not available.
All of the following steps must be carried out from the Invopop Console.

Running

In this section we’ll provide details on how to first persist and register a supplier, followed by issuing invoices on their behalf. As usual, the recommended approach for running jobs is to perform two steps; first upload the document to the silo, second create a job.

Register a Supplier

Suppliers can be registered either manually via the Invopop Console or programatically via the API. The process is essentially the same, so for this guide we’ll demonstrate the manual process.
Suppliers in Mexico must authorize the PAC (Procesador Autorizado de Certificación) used by Invopop to sign, stamp and send CFDIs to the SAT on their behalf. Please visit https://firmamanifiesto.lunasoft.net/ and follow the process to authorize SW Sapiens by Luna Soft S.A. de C.V.. This is not an automated service and can only be performed manually by a representative of the supplier.
Find the Contacts section of the sidebar and click Suppliers. Tap the + New Supplier button to be presented with a new editor. Copy and paste the following example that uses example data provided by the SAT. This will only work in sandbox environments, in production you’ll need the details of a real company:
SAT Mexico supplier example
{
  "$schema": "https://gobl.org/draft-0/org/party",
  "uuid": "018fbeda-bc61-7000-b66d-398ce3e21c43",
  "name": "ESCUELA KEMPER URGATE",
  "tax_id": {
    "country": "MX",
    "code": "EKU9003173C9"
  },
  "ext": {
    "mx-cfdi-fiscal-regime": "601"
  }
}
Tap Build, ensure there are no errors, and click Save. We should now see the document. Find and click the Select Workflow button. Select the Register Supplier workflow created during setup, and click Run Workflow. The execution should be successful, and the silo entry will now be in the “Processing” state. Tap the Meta tab to see the registration link:
Supplier Registration Link
You can access the registration link via the API by fetching the silo entry and reading the meta row where the key is set to registration-link.
Tap the registration link and a new browser window will be presented with a form to upload the credentials for the supplier. Note that this form can be shared directly with the supplier if required.
Issuer Registration Form
The details from this form are sent securely to the PAC (Authorised Certification Provider) who will be responsible for signing invoices and sending them to the SAT. You can find test RFCs and CSDs on the SW Sapien test pages. Download the zip file and extract the certificates if you’d like to try out the full flow. The CSD comprises two files (with extensions .cer and .key) and a password. Suppliers, companies or individuals, can follow this guide on how to obtain one. Certificates have already been registered for all sandbox users, so you can safely run the “Post-registration workflow” manually and leave the new supplier in the sent state. From this point on you can now send invoices on behalf of the supplier.

Send an Invoice

The following examples are of partial GOBL documents you can copy and paste directly into the Invopop Console or store via the API as silo entries. GOBL Invoices sent to the SAT require the following properties in order to perform the correct normalization and validation steps. Invopop will try to assign these automatically, but we recommend defining them explicitly before upload:
This main type of invoice is a standard B2B invoice from a Mexican supplier to another Mexican customer.Notice:
  • we’ve added the mx-cfdi-v4 addon, this ensures the document will be validated using the CFDI v4 rules built into the GOBL library,
  • extensions (ext) fields have been used in multiple locations for fields whose values cannot be determined any other way,
  • VAT will be applied at the standard rate, the percentage will be set automatically, and,
  • there are no totals nor calculations, all of these will be made automatically when uploading.
SAT B2B Invoice
{
  "$schema": "https://gobl.org/draft-0/bill/invoice",
  "$regime": "MX",
  "$addons": [
    "mx-cfdi-v4"
  ],
  "series": "XXMX",
  "tax": {
    "ext": {
      "mx-cfdi-issue-place": "44100"
    }
  },
  "supplier": {
    "uuid": "018fbeda-bc61-7000-b66d-398ce3e21c43",
    "name": "ESCUELA KEMPER URGATE",
    "tax_id": {
      "country": "MX",
      "code": "EKU9003173C9"
    },
    "addresses": [
      {
        "street": "Julia Navarrete No. 1430",
        "locality": "Guadalajara",
        "region": "Jalisco",
        "code": "44100",
        "country": "MX"
      }
    ],
    "emails": [
      {
        "addr": "esckemperugarte@example.com"
      }
    ],
    "ext": {
      "mx-cfdi-fiscal-regime": "601"
    }
  },
  "customer": {
    "name": "UNIVERSIDAD ROBOTICA ESPAÑOLA",
    "tax_id": {
      "country": "MX",
      "code": "URE180429TM6"
    },
    "addresses": [
      {
        "locality": "Ciudad de Mexico",
        "region": "Ciudad de Mexico",
        "code": "86991",
        "country": "MX"
      }
    ],
    "ext": {
      "mx-cfdi-fiscal-regime": "601",
      "mx-cfdi-post-code": "86991",
      "mx-cfdi-use": "G01"
    }
  },
  "lines": [
    {
      "quantity": "1",
      "item": {
        "name": "Standard Plan",
        "price": "1000.00",
        "ext": {
          "mx-cfdi-prod-serv": "81112002"
        }
      },
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard"
        }
      ]
    }
  ]
}
This is a standard B2C invoice from a Mexican supplier to a Mexican physical person with tax details, but no specific tax declaration requirements. This would be for a larger sale when the “Simplified” and “Global Invoice” do not apply.In addition to the observations for regular B2B invoices, note in the customer:
  • the presence of an RFC in the same format as for companies, and,
  • the mx-cfdi-fiscal-regime and mx-cfdi-use extensions have been set to 616 and S01 respectively reflecting that the customer is not subject to tax.
It is important in Mexico to ensure the correct Fiscal Regime and CFDI Use codes are set correctly as the SAT will check these details and reject documents with unexpected combinations.
SAT B2C Invoice
{
    "$schema": "https://gobl.org/draft-0/bill/invoice",
    "$regime": "MX",
    "$addons": [
        "mx-cfdi-v4"
    ],
    "uuid": "0197a6ba-658f-7000-b2b4-31647f904530",
    "type": "standard",
    "series": "XXMX",
    "issue_date": "2025-06-25",
    "issue_time": "08:30:00",
    "currency": "MXN",
    "tax": {
        "ext": {
            "mx-cfdi-doc-type": "I",
            "mx-cfdi-issue-place": "44100",
            "mx-cfdi-payment-method": "PPD"
        }
    },
    "supplier": {
        "uuid": "018fbeda-bc61-7000-b66d-398ce3e21c43",
        "name": "ESCUELA KEMPER URGATE",
        "tax_id": {
            "country": "MX",
            "code": "EKU9003173C9"
        },
        "addresses": [
            {
                "street": "Julia Navarrete No. 1430",
                "locality": "Guadalajara",
                "region": "Jalisco",
                "code": "44100",
                "country": "MX"
            }
        ],
        "emails": [
            {
                "addr": "esckemperugarte@example.com"
            }
        ],
        "ext": {
            "mx-cfdi-fiscal-regime": "601"
        }
    },
    "customer": {
        "name": "LUIS IAN ÑUZCO",
        "tax_id": {
            "country": "MX",
            "code": "IAÑL750210963"
        },
        "addresses": [
            {
                "locality": "Ciudad de Mexico",
                "region": "Ciudad de Mexico",
                "code": "85256",
                "country": "MX"
            }
        ],
        "ext": {
            "mx-cfdi-fiscal-regime": "616",
            "mx-cfdi-use": "S01"
        }
    },
    "lines": [
        {
            "i": 1,
            "quantity": "1",
            "item": {
                "name": "Standard Plan",
                "price": "500.00",
                "ext": {
                    "mx-cfdi-prod-serv": "81112002"
                }
            },
            "sum": "500.00",
            "taxes": [
                {
                    "cat": "VAT",
                    "rate": "standard",
                    "percent": "16.0%"
                }
            ],
            "total": "500.00"
        }
    ],
    "totals": {
        "sum": "500.00",
        "total": "500.00",
        "taxes": {
            "categories": [
                {
                    "code": "VAT",
                    "rates": [
                        {
                            "key": "standard",
                            "base": "500.00",
                            "percent": "16.0%",
                            "amount": "80.00"
                        }
                    ],
                    "amount": "80.00"
                }
            ],
            "sum": "80.00"
        },
        "tax": "80.00",
        "total_with_tax": "580.00",
        "payable": "580.00"
    }
}
In Mexico, a General Public Invoice (Factura al Público en General) is a type of tax document issued to record sales made to customers who do not request an invoice with a specific Federal Taxpayer Registry (RFC) number. Instead, a generic RFC is used to identify the recipient:
  • XAXX010101000 for domestic transactions
  • XEXX010101000 for foreign transactions
This type of invoice is mandatory for businesses that sell to the general public and do not issue individual invoices for each transaction.To create this type of invoice in Invopop:
  • the customer field is not required
  • the $tags field is used to identify this as a simplified invoice.
SAT Mexico simplified invoice example
{
  "$schema": "https://gobl.org/draft-0/bill/invoice",
  "$regime": "MX",
  "$addons": [
    "mx-cfdi-v4"
  ],
  "$tags": [
    "simplified"
  ],
  "uuid": "3aea7b56-59d8-4beb-90bd-f8f280d852a0",
  "type": "standard",
  "series": "TEST",
  "code": "00001",
  "issue_date": "2023-07-10",
  "issue_time": "12:00:00",
  "currency": "MXN",
  "tax": {
    "ext": {
      "mx-cfdi-doc-type": "I",
      "mx-cfdi-issue-place": "44100"
    }
  },
  "supplier": {
    "name": "ESCUELA KEMPER URGATE",
    "tax_id": {
      "country": "MX",
      "code": "EKU9003173C9"
    },
    "ext": {
      "mx-cfdi-fiscal-regime": "601"
    }
  },
  "lines": [
    {
      "quantity": "1",
      "item": {
        "name": "Cobro por tarjetas",
        "price": "10.00",
        "ext": {
          "mx-cfdi-prod-serv": "84141602"
        }
      },
      "discounts": [
        {
          "percent": "10.0%",
          "amount": "1.00"
        }
      ],
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard",
          "percent": "16.0%"
        }
      ]
    },
    {
      "quantity": "1",
      "item": {
        "name": "Porcentaje sobre GMV",
        "price": "10.00",
        "unit": "service",
        "ext": {
          "mx-cfdi-prod-serv": "80141628"
        }
      },
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard",
          "percent": "16.0%"
        }
      ]
    }
  ],
  "payment": {
    "terms": {
      "notes": "Condiciones de pago"
    }
  }
}
The Global Invoice is used to group a set of invoices into a single CFDI document.Notice:
  • the $tags field has been used to identify this as a global invoice,
  • each line has a ref which is used to identify the invoice that it belongs to,
  • the tax.ext.mx-cfdi-global-month, mx-cfdi-global-period, and mx-cfdi-global-year fields have been used to identify the global invoice period.
SAT Mexico global invoice example
{
  "$schema": "https://gobl.org/draft-0/bill/invoice",
  "$addons": [
    "mx-cfdi-v4"
  ],
  "$tags": [
    "global"
  ],
  "uuid": "3aea7b56-59d8-4beb-90bd-f8f280d852a0",
  "series": "GLOBAL",
  "code": "0001",
  "issue_date": "2025-04-01",
  "issue_time": "12:00:00",
  "tax": {
    "ext": {
      "mx-cfdi-global-month": "03",
      "mx-cfdi-global-period": "04",
      "mx-cfdi-global-year": "2025",
      "mx-cfdi-issue-place": "44100"
    }
  },
  "supplier": {
    "name": "ESCUELA KEMPER URGATE",
    "tax_id": {
      "country": "MX",
      "code": "EKU9003173C9"
    },
    "ext": {
      "mx-cfdi-fiscal-regime": "601"
    }
  },
  "lines": [
    {
      "quantity": "1",
      "item": {
        "ref": "SALE1",
        "name": "Sale 1",
        "price": "10.00"
      },
      "discounts": [
        {
          "percent": "10.0%"
        }
      ],
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard"
        }
      ]
    },
    {
      "quantity": "1",
      "item": {
        "ref": "SALE2",
        "name": "Sale 2",
        "price": "20.00"
      },
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard"
        }
      ]
    }
  ],
  "payment": {
    "advances": [
      {
        "key": "cash",
        "description": "Prepaid",
        "percent": "100%"
      }
    ]
  }
}
The Credit Note is used to cancel an invoice.Notice:
  • the $type field has been set to credit-note,
  • the preceding field has been used to identify the invoice that is being cancelled.
SAT Mexico credit note example
{
  "$schema": "https://gobl.org/draft-0/bill/invoice",
  "$addons": [
    "mx-cfdi-v4"
  ],
  "uuid": "3aea7b56-59d8-4beb-90bd-f8f280d852a0",
  "issue_date": "2023-05-29",
  "issue_time": "12:00:00",
  "type": "credit-note",
  "series": "CN",
  "code": "0003",
  "currency": "MXN",
  "preceding": [
    {
      "series": "TEST",
      "code": "0001",
      "issue_date": "2023-07-10",
      "issue_time": "12:00:00",
      "stamps": [
        {
          "prv": "sat-uuid",
          "val": "1fac4464-1111-0000-1111-cd37179db12e"
        }
      ]
    }
  ],
  "supplier": {
    "name": "ESCUELA KEMPER URGATE",
    "tax_id": {
      "country": "MX",
      "code": "EKU9003173C9"
    },
    "addresses": [
      {
        "street": "Julia Navarrete No. 1430",
        "locality": "Guadalajara",
        "region": "Jalisco",
        "code": "44100",
        "country": "MX"
      }
    ],
    "ext": {
      "mx-cfdi-fiscal-regime": "615"
    }
  },
  "customer": {
    "name": "UNIVERSIDAD ROBOTICA ESPAÑOLA",
    "tax_id": {
      "country": "MX",
      "code": "URE180429TM6"
    },
    "addresses": [
      {
        "locality": "Ciudad de Mexico",
        "region": "Ciudad de Mexico",
        "code": "86991",
        "country": "MX"
      }
    ],
    "ext": {
      "mx-cfdi-fiscal-regime": "624",
      "mx-cfdi-use": "G01"
    }
  },
  "lines": [
    {
      "quantity": "2",
      "item": {
        "name": "Cigarros",
        "ext": {
          "mx-cfdi-prod-serv": "50211502"
        },
        "price": "100.1010",
        "unit": "piece"
      },
      "taxes": [
        {
          "cat": "VAT",
          "rate": "standard"
        }
      ],
      "total": "200.2020"
    }
  ],
  "payment": {
    "terms": {
      "notes": "Pago a 30 días."
    }
  }
}

FAQ

Please contact the Invopop support team if you have any questions that are not listed here.
Invopop uses SW Sapien, an Authorised Certification Provider (PAC), to sign and stamp CFDI documents for the Mexican tax authority.
The library that transforms GOBL into CFDI documents is publicly available as an open-source project and can be found at github.com/invopop/gobl.cfdi.For further details on how GOBL prepares data for conversion, see the Mexico Tax Regime.