carloschininin/facturax-contracts
Versioned DTO contracts for the Facturax API, with an optional Symfony bundle that registers validation and normalization services. Covers invoices, credit notes, daily summaries, voided documents, shipping guides, perceptions, retentions, and reversals, keeping payloads decoupled from Greenter.
Api\V1\Dto\...) for the Facturax API plus a shared validator/normalizer. It lets both sides of the API — Facturax itself and any client system — speak the same JSON shape for the document families that matter in Peruvian e-invoicing: comprobantes, notas de crédito/débito, resúmenes diarios, comunicaciones de baja, reversiones, guías de remisión, percepciones y retenciones. That covers the mainstream Greenter/SUNAT document set.ContractValidator and ContractNormalizer mean downstream apps can catch malformed payloads before they hit the API. As a PM this translates into fewer 4xx round-trips, cleaner error surfaces for end users, and less support load around "why did my document fail?"Greenter\Model\* while preserving enough semantics to map internally. This is a genuine architectural decision worth endorsing: it means the public contract can evolve independently of the underlying SUNAT/Greenter implementation. If you are building a product on top of Facturax, you are not signing up to be coupled to Greenter's internals.Api\V1\Dto namespace convention is the template you want for any future API surface — including non-Peruvian expansion. Adopting it now makes the "how do we do v2?" conversation a formality rather than a re-architecture.Adopt if:
Look elsewhere if:
Adoption posture I would recommend: treat this as a contract reference and integration convenience, not a dependency to build a product strategy around. If you are inside the Facturax ecosystem, consume it and pin the version tightly. If you are outside, use docs/examples/v1/ as the specification and implement your own DTOs — you get the same clarity with none of the single-maintainer risk.
For executives: "This is a small, focused package that defines the shared vocabulary for electronic invoicing through Facturax — the exact data shapes for invoices, credit notes, daily summaries, cancellations, shipping guides, withholdings and perceptions under Peruvian SUNAT rules. Adopting it is cheap when we are already a Facturax client, and it removes a class of integration bugs: our systems and the API agree on what a valid document looks like before anything is sent. Two caveats I want on record. First, it is very early — version 0.0.2, essentially one maintainer, no adoption yet — so it is a convenience, not a platform bet. Second, it requires PHP 8.5 and Symfony 8, which is ahead of where most of our stack sits. My recommendation is to adopt it only if Facturax is already load-bearing for us, and otherwise to treat its published examples as a specification we implement ourselves."
For engineering:
"This is a set of namespaced DTOs (Api\V1\Dto\...) for the Facturax API plus an optional Symfony bundle exposing ContractValidator and ContractNormalizer. The design intent is good: the contracts are intentionally decoupled from Greenter\Model\* while remaining mappable, so the public API surface can change independently of the SUNAT submission layer. Hard requirements are PHP 8.5+ and Symfony 8.x. Credentials, certificates, and SUNAT/OSE endpoints are explicitly not in scope — this validates and normalizes payloads, it does not transmit anything. For integration, the bundle gives you a service container hook if you are on Symfony; on Laravel you would bind the validator/normalizer yourself or, more likely, just use the DTOs and the example JSON in docs/examples/v1/ as your wire format. The real risk is dependency and maintenance: it is a v0.0.2 with one maintainer and no downstream users, so pin the exact version, wrap it behind our own interface, and assume we may have to fork or reimplement. Do not let it leak into domain code directly."
For legal / compliance: "This package describes document structure, not legal validity. It encodes the field shapes for Peruvian SUNAT document families and normalizes payloads so malformed ones fail early. It does not handle certification, digital signatures, SUNAT submission, or OSE transmission — those remain with the invoicing engine and our operational process. Two things to verify with us: that the versioned contract we pin actually reflects the current SUNAT schema requirements for each document family, and that we have an internal owner for tracking SUNAT regulatory changes rather than relying on a single external maintainer's release cadence. The package being pre-1.0 does not itself create compliance exposure, but treating it as a compliance guarantee would."
How can I help you explore Laravel packages today?