https://github.com/easybill/zugferd-php
ZUGFeRD PHP SDK (Factur-X, XRechnung)
https://github.com/easybill/zugferd-php
factur-x xrechnung zugferd zugferd-php
Last synced: 3 months ago
JSON representation
ZUGFeRD PHP SDK (Factur-X, XRechnung)
- Host: GitHub
- URL: https://github.com/easybill/zugferd-php
- Owner: easybill
- License: mit
- Created: 2016-05-11T13:53:34.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2026-01-12T07:56:11.000Z (6 months ago)
- Last Synced: 2026-01-12T17:51:53.511Z (6 months ago)
- Topics: factur-x, xrechnung, zugferd, zugferd-php
- Language: XSLT
- Homepage: https://www.easybill.de
- Size: 6.2 MB
- Stars: 92
- Watchers: 16
- Forks: 35
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ZUGFeRD PHP
===========
[](https://packagist.org/packages/easybill/zugferd-php) [](https://packagist.org/packages/easybill/zugferd-php)[](https://packagist.org/packages/easybill/zugferd-php)
ZUGFeRD PHP SDK (Factur-X, XRechnung) - Convert PHP Objects to XML and back.
[Look @ Tests for more details](tests)
## Installation
The recommended way of installing this library is using [Composer](http://getcomposer.org/).
Add this repository to your composer information using the following command
```bash
composer require easybill/zugferd-php
```
## Usage ZUGFeRD v1
Convert XML to PHP Objects:
```php
use Easybill\ZUGFeRD\Reader;
$document = Reader::create()->getDocument('zugferd-file.xml');
echo $document->getHeader()->getId(); // Get invoice No.
```
Convert PHP Objects to XML:
```php
use Easybill\ZUGFeRD\Builder;
use Easybill\ZUGFeRD\Model\Document;
$doc = new Document(Document::TYPE_COMFORT);
$doc->getHeader()->setId('RE1337'); // Set invoice No.
$xml = Builder::create()->getXML($doc);
echo $xml; // Zugferd XML.
```
## Usage ZUGFeRD v2
Convert XML to PHP Objects:
```php
use Easybill\ZUGFeRD2\Reader;
$xml = file_get_contents('factur-x.xml');
$obj = Reader::create()->transform($xml);
```
Convert PHP Objects to XML:
```php
use Easybill\ZUGFeRD2\Builder;
$obj = ...;
$xml = Builder::create()->transform($obj);
echo $xml; // Zugferd XML.
```
## Contributing
Please feel free to send bug reports and pull requests.
## License
Published as open source under the terms of [MIT License](http://opensource.org/licenses/MIT).