Spring Boot microservice that consumes the Fiscalapi API, for issuing compliance CFDI invoices in Mexico.
- Docker and Docker Compose
- Postman (optional, for testing with included collection)
Before starting the application, you need to configure your Fiscalapi account:
If you don't have an account yet, you can create one here. Don't forget to confirm your email by clicking the link sent.
To stamp invoices you need an active subscription in the test environment and available stamps in your account. More information
With your active subscription and available stamps, get your API keys to authenticate your HTTP requests to the API.
Copy application.properties.sample to application.properties and configure:
fiscalapi.url: Fiscalapi base URL (test/live)fiscalapi.api-key: Fiscalapi API Keyfiscalapi.tenant-id: Tenant IDfiscalapi.timezone: Timezone (default: America/Mexico_City)fiscalapi.debug: Debug mode for logging
-
Import collection: In Postman, go to
Import→File→ SelectFiscalapi-Spring.postman_collection.json -
Import environment: In Postman, go to
Import→File→ SelectFiscalapi-Spring-Dev.postman_environment.json -
Configure environment: Select the
Fiscalapi-Spring-Devenvironment and set thebaseUrlvariable tohttp://localhost:8080
docker compose up --buildService will be available at http://localhost:8080
docker compose down -v-
Invoices
/api/v4/invoicesManages the complete lifecycle of CFDI electronic invoices: create, list, cancel, query, download XML/PDF files, and send by email.
-
Products
/api/v4/productsRepresents goods or services offered by an organization. Programmatic management of product and service catalog with taxes.
-
People
/api/v4/peopleRepresents any tax entity (individual or company). Centralized concept for managing organization resources.
-
API Keys
/api/v4/apikeysAuthenticates requests. Each API key has associated roles and permissions that determine allowed actions.
-
Stamps
/api/v4/stampsFiscal folios purchased in bundles to validate electronic invoices with the SAT. One stamp is consumed per invoice issued.
-
Tax Files
/api/v4/tax-filesDigital Seal Certificates (.cer and .key files) issued by the SAT that allow digitally signing invoices.
-
Catalogs
/api/v4/catalogsCFDI 4.0 codes and values provided by the SAT, essential for creating electronic invoices.
- Spring Boot 3.5.7 with OpenJDK 25
- PostgreSQL with Flyway for migrations
- OpenAPI/Swagger at
/swagger-ui.html - JPA/Hibernate with schema validation
- Custom HTTP client for Fiscalapi
- Swagger UI:
http://localhost:8080/swagger-ui.html - OpenAPI JSON:
http://localhost:8080/api-docs - Postman Collection:
Fiscalapi-Spring.postman_collection.json
- Make sure you're using the latest SDK version.
- Check if the issue has already been reported.
- Provide a minimal reproducible example.
- Include complete error messages.
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Fiscalapi