Skip to content

The MH has two environments, and Open Factura keeps them separate end to end:

Environment Code API key Fiscal value
Test 00 of_test_… None
Production 01 of_live_… Legal
  • The key prefix decides the environment. A test key never touches production, and vice versa.
  • The dashboard uses the environment saved on the issuer (Company & Tax Authority → Tax details → Environment).
  • MH credentials (API password and certificate) are different in each environment: test ones don’t work in production.
  • Each key sees only the documents, events, products, and webhooks of its environment. Idempotency keys are also independent per environment.
  • Saved customers only exist in production. In test mode, the recipient goes in datos.receptor (409 clientes_solo_produccion).
  • PDFs from the test environment warn that the document has no legal value.

If you operate on a document from another environment, the API responds 409 ambiente_distinto.

  1. Complete the minimum tests Hacienda requires and obtain your authorization as an issuer (see Becoming an issuer with Hacienda).
  2. In Hacienda’s issuer portal (Sitio Emisores DTE), production environment, generate the production certificate and API password.
  3. Under Company & Tax Authority → MH credentials, upload them for environment 01 (PUT /api/v1/emisor/credenciales/01).
  4. For the dashboard, switch the issuer’s environment to production. For integrations, create an of_live_… key with the minimum permissions.
  5. Issue a first real document and check its stamp and its urlConsulta.

For AI assistants: llms.txt ·llms-full.txt ·every page as Markdown by adding .md to its path.