Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lycet

> DevOps
Open source

API REST de Facturación Electrónica Sunat utilizando Greenter.

100 stars0 likes1 views
WebsiteGitHub

About

API REST de Facturación Electrónica Sunat utilizando Greenter.

Lycet - Greenter

Lycet es un API REST basado en greenter y Symfony Framework, UBL 2.1 es soportado.

Objetivo: Ofrecer una interfaz a greenter desde otros lenguajes de programación.

LIVE (Pruebas)

:rocket:
URL https://greenter-lycet.herokuapp.com/
API TOKEN greenter

Requerimientos

  • Php 7.4 o superior
  • Php Extensions habilitadas (soap, xml, openssl, zlib)
  • WkhtmltoPdf executable (PDF report)
  • Pem Certificate - convert pfx to pem

Pasos

Instalar Lycet

bash
git clone https://github.com/giansalex/lycet
cd lycet
composer install -o

Configuraciones

En el archivo .env ubicado en la raíz del proyecto, podrá cambiar estas configuraciones.

…

/data ├── cert.pem ├── logo.png ├── empresas.json (opcional para multiples empresas)

bash
También puede usar [lycet-ui-config](https://giansalex.github.io/lycet-ui-config/) como interfaz de usuario, siendo mas útil
esta opción cuando emplea contenedores.

#### API de gestión de empresas

También puede gestionar empresas programáticamente via API:

**Registrar/Actualizar empresa:**
```bash
curl -X PUT "http://localhost:8000/api/v1/configuration/company/20000000001?token=123456" \
  -H "Content-Type: application/json" \
  -d '{
    "SOL_USER": "20000000001MODDATOS",
    "SOL_PASS": "moddatos",
    "certificate": "",
    "FE_URL": "https://e-factura.sunat.gob.pe/ol-ti-itcpfegem/billService"
  }'

Subir logo (separado para evitar límite de payload):

bash
curl -X PUT "http://localhost:8000/api/v1/configuration/company/20000000001/logo?token=123456" \
  -H "Content-Type: application/json" \
  -d '{"logo": ""}'

Eliminar logo:

bash
curl -X DELETE "http://localhost:8000/api/v1/configuration/company/20000000001/logo?token=123456"

Eliminar empresa:

bash
curl -X DELETE "http://localhost:8000/api/v1/configuration/company/20000000001?token=123456"

Los campos opcionales (FE_URL, RE_URL, GUIA_URL, AUTH_URL, API_URL, CLIENT_ID, CLIENT_SECRET) permiten configurar URLs por empresa. Si no se proporcionan, se usan las del .env.

Ejemplo de contenido del archivo empresas.json, tambien puede cambiar la URL de los servicios para apuntar a un OSE.

json
{
  "20000000001": {
    "SOL_USER": "20000000001MODDATOS",
    "SOL_PASS": "moddatos",
    "certificate": "20000000001-cert.pem",
    "logo": "20000000001-logo.png"
  },
  "20000000002": {
    "SOL_USER": "20000000002MODDATOS",
    "SOL_PASS": "moddatos",
    "certificate": "20000000002-cert.pem",
    "logo": "20000000002-logo.png",
    "FE_URL": "https://my-ose.com/billService",
    "RE_URL": "https://my-ose.com/billService",
    "GUIA_URL": "https://my-ose.com/billService",
    "AUTH_URL": "https://api-test-seguridad.sunat.gob.pe/v1",
    "API_URL": "https://api-test.sunat.gob.pe/v1",
    "CLIENT_ID": "85e5b0ae-255c-4891-a595-0b98c65c9854",
    "CLIENT_SECRET": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

Para pruebas de Guia de remision, utilizar la siguiente configuración issue#605

Ejecutar

Usando Php Built-in Web Server.

php -S 0.0.0.0:8000 -t public

Ir a http://localhost:8000/

Docker

Desplegar con Docker.

bash
git clone https://github.com/giansalex/lycet
cd lycet
docker build -t lycet .

# copiar certificado y logo de prueba (puedes reemplazar por uno personal)
cp tests/Resources/* data
# ejecutar el contenedor
docker run -d -p 8000:8000  -v ./data:/var/www/html/data --name lycet_app lycet

Abrir el navegador, y dirígete a http://localhost:8000/

Docs

  • Conectando lycet desde nodejs

Puedes visitar greenter en postman que contiene ejemplos del envío de algunos comprobantes.

Ver swagger documentation, puedes crear un cliente en swagger editor, para tu lenguaje de preferencia.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPapi-restdockerfacturacion-electronicagreenter

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理