Skip to main content

The complete flow for API Web

In practice, the client and product catalogs are managed separately and reused across multiple invoices. For the API, it is not necessary to have a client or product catalog for stamping, since that information is specified directly in the request JSON.

Step 1 — Manage places of issue

Before invoicing, you need to add your business’s place of issue / branch office; this procedure is done only once.
Save the ZipCode, since you will use it as the place of issue in the main request.

Step 2 — Issue the CFDI

Save the Id from the Response, since you will use it for the following operations.

Step 3 — Download PDF / XML

Once issued, download the PDF and XML:

Step 4 — Send by email

You can send the PDF and XML by email:

Step 5 — Cancellation (if applicable)

Cancellation with motive 02
Cancellation motives:
  • 01 — Receipt issued with errors with a related document
  • 02 — Receipt issued with errors without a related document
  • 03 — The transaction did not take place
  • 04 — Nominative transaction related in the global invoice

API Web vs Multi-issuer API

Checklist before going to production

1

Verify your production account

Create an account at app.facturama.mx, or sign in and verify that your account has an active subscription.
2

Purchase the API annual license

Purchase the API annual license from the shopping cart to enable access to the production API.
3

Upload your Digital Seal Certificate (CSD)

Upload your Digital Seal Certificate (.cer and .key) files. This is required to issue CFDIs in production.
4

Update the base URL

Change the base URL from https://apisandbox.facturama.mx to https://api.facturama.mx. No other code changes are required.
5

Issue a real CFDI

Create a real invoice for a small amount (for example, MXN $1.00) and verify that it appears in the SAT portal.
6

Recommended: Configure error handling

Implement retries with exponential backoff for temporary SAT 5xx errors.