PHPackages                             henry-ht/ubl21dian - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. henry-ht/ubl21dian

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

henry-ht/ubl21dian
==================

Core for electronic invoicing pre-validation - DIAN UBL 2.1

v1.0.0(1y ago)015LGPL-3.0PHPPHP &gt;= 5.4

Since Jun 18Pushed 1y agoCompare

[ Source](https://github.com/henry-ht/ubl21dian)[ Packagist](https://packagist.org/packages/henry-ht/ubl21dian)[ Docs](https://thecreativehenry.app)[ RSS](/packages/henry-ht-ubl21dian/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

UBL 2.1 DIAN
============

[](#ubl-21-dian)

Core for electronic invoicing pre-validation - DIAN UBL 2.1.

Fork of the [ubl21dian](https://gitlab.com/torresoftware/ubl21dian) package by Torresoftware, designed to generate electronic documents in UBL 2.1 format in compliance with DIAN regulations in Colombia. This version includes customizations and specific enhancements to integrate with other Laravel solutions or adapt to particular use cases.

UBL 2.1 DIAN DETAILS
====================

[](#ubl-21-dian-details)

Package for electronic invoicing in Colombia

Tags
====

[](#tags)

- 1: ✅ Contains valid tests with the binary security token (SOAP) and XAdES (XML) signature using sha1, sha256, and sha512 algorithms.
- 2: ✅ Includes the main templates for consuming the web service; requires curl as a dependency.
- 3: ✅ Fixes the canonicalization error.
- 4: ✅ Provides valid tests for sending credit notes and calculating the CUDE.
- 5: ✅ Licensed under LGPL.
- 6: ✅ Includes valid tests for sending debit notes and the standard document name.

Functions
=========

[](#functions)

- Document signing
- Asynchronous sending
- Status query by zipkey
- Status query by CUFE
- Numbering range query
- Asynchronous test set sending

### Example of electronic invoice signing and validation using UBL 2.1 (Laravel)

[](#example-of-electronic-invoice-signing-and-validation-using-ubl-21-laravel)

This snippet demonstrates how to generate the XML of an invoice, digitally sign it, and validate it against the XSD schema using the `SignInvoice` package.

```
    use ubl21dian\XAdES\SignInvoice;

    $view = view('dian-xml.Invoice')->with([
        'sale'      => $this->sale
    ]);

    $xml = $view->render();

    $sign = new SignInvoice(storage_path(env('DIAN_PFXPATH')), env('DIAN_PFXPASSWORD'));

    $sign->softwareID = $this->sale->dian_resolution->software_id;
    $sign->pin = env('DIAN_PIN');
    $sign->technicalKey = env('DIAN_TECHNICAL_KEY');
    $sign->sign($xml);

    $xmlSign = $sign->getDocument()->saveXML();

    $validate = $this->validateXmlWithXsd($xmlSign, storage_path('XSD/maindoc/UBL-Invoice-2.1.xsd'));
```

```
    /**
     * Validates an XML file against one or multiple XSD schemas.
     *
     * @param string $xmlContent Content of the XML to be validated.
     * @param string|array $xsdPaths Path(s) to the XSD file or XSD files.
     * @return bool Validation result.
     */
    public function validateXmlWithXsd(string $xmlContent, $xsdPath): bool
    {
        $dom = new \DOMDocument();
        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = false;
        $dom->loadXML($xmlContent);

        $valid = false;

        $valid = $dom->schemaValidate($xsdPath);

        return $valid;
    }
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance48

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

381d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf28e1a351743385aa2b77be899076beb65b5d378d3673f7ee99d9a50ca595bb?d=identicon)[henry-ht](/maintainers/henry-ht)

---

Top Contributors

[![henry-ht](https://avatars.githubusercontent.com/u/15837863?v=4)](https://github.com/henry-ht "henry-ht (5 commits)")

---

Tags

xmlweb servicecoreubldiansoap dian

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/henry-ht-ubl21dian/health.svg)

```
[![Health](https://phpackages.com/badges/henry-ht-ubl21dian/health.svg)](https://phpackages.com/packages/henry-ht-ubl21dian)
```

###  Alternatives

[spatie/laravel-sitemap

Create and generate sitemaps with ease

2.6k16.6M147](/packages/spatie-laravel-sitemap)[easybill/e-invoicing

A package to read and create EN16931 e-invoices or CIUS like: XRechnung, ZUGFeRD etc.

14158.3k](/packages/easybill-e-invoicing)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

1610.0k](/packages/japanese-date-japanese-date)[lion/bundle

Lion-framework configuration and initialization package

122.4k4](/packages/lion-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
