OpenAPI Spec 3.0
Spec OpenAPI oficial de los 33 endpoints. Compatible con Postman, Insomnia, Bruno, Scalar, Swagger UI, generadores de cliente y cualquier herramienta que respete el estandar.
Que puedes hacer con la spec
Importar en cliente
Postman, Insomnia, Bruno, Hoppscotch, etc.
Explorar visualmente
Scalar o Swagger UI en el navegador.
Generar cliente
SDK en Python, JS, Go, PHP, Java, C# con openapi-generator.
Servidor mock
Prism o Stoplight para mockear el API.
Testing automatizado
Dredd, Schemathesis, Spectral para validar.
Documentacion auto
Redoc, ReadMe.io, Mintlify, etc.
Como importar la spec
En Postman
Menu Import → tab Link → pega https://api.cfdi4.com/docs/openapi-spec → Continue → Import.
En Insomnia
Menu → Application → Preferences → Data → Import Data → From URL → pega la URL.
En Bruno
Click derecho en el sidebar → Import Collection → From URL → pega la URL.
En Hoppscotch
Sidebar → Import → Import from URL → pega la URL.
Desde terminal con cURL
curl -O https://api.cfdi4.com/docs/openapi-spec
Explorar visualmente
Generar SDK en tu lenguaje
Usa openapi-generator.
Instalacion
npm install -g @openapitools/openapi-generator-cli
# o
brew install openapi-generator
# o
docker pull openapitools/openapi-generator-cli
Generar cliente Python
openapi-generator-cli generate -i https://api.cfdi4.com/docs/openapi-spec -g python -o ./sat-api-python
Generar cliente TypeScript
openapi-generator-cli generate -i https://api.cfdi4.com/docs/openapi-spec -g typescript-axios -o ./sat-api-ts
El generador soporta 50+ lenguajes: go, java, php, csharp, ruby, swift, kotlin, rust, etc.
Servidor mock
Para desarrollo sin gastar creditos, monta un mock con Prism:
npm install -g @stoplight/prism-cli
prism mock https://api.cfdi4.com/docs/openapi-spec
Prism arranca un servidor en http://localhost:4010 con datos de ejemplo.
Testing automatizado
Dredd
npm install -g dredd
dredd https://api.cfdi4.com/docs/openapi-spec https://api.cfdi4.com
Schemathesis (Python)
pip install schemathesis
schemathesis run https://api.cfdi4.com/docs/openapi-spec
Documentacion custom
Redoc (CLI)
npx @redocly/cli build-docs https://api.cfdi4.com/docs/openapi-spec -o mi-docs.html
Redoc (Docker)
docker run -p 8080:80 -e SPEC_URL=https://api.cfdi4.com/docs/openapi-spec redocly/redoc
Problemas comunes
La spec no carga en Postman
Verifica que la URL responda. Si retorna 404, contactanos.
Error de "schema invalid"
La spec puede tener un error de formato. Contactanos con el mensaje exacto.