PHPackages                             php-core/swiss-qr-bill - 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. php-core/swiss-qr-bill

ActiveLibrary

php-core/swiss-qr-bill
======================

A PHP library to create Swiss QR bills

01HTML

Since Dec 27Pushed 4mo agoCompare

[ Source](https://github.com/php-core/swiss-qr-bill)[ Packagist](https://packagist.org/packages/php-core/swiss-qr-bill)[ RSS](/packages/php-core-swiss-qr-bill/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Swiss QR Bill
=============

[](#swiss-qr-bill)

Forked from  with the intent to fix open issues and improve the library.

[![Build Status](https://github.com/php-core/php-swiss-qr-bill/actions/workflows/ci.yml/badge.svg)](https://github.com/php-core/php-swiss-qr-bill/actions)

A PHP library to create Swiss QR Bill payment parts (*QR-Rechnung*).

[![Image of Swiss QR Bill example](docs/assets/example-payment-part.png)](docs/assets/example-payment-part.png)

Getting started
---------------

[](#getting-started)

```
composer require php-core/swiss-qr-bill

```

Then have a look at [example/example.php](example/example.php).

FAQs
----

[](#faqs)

- **Why is my IBAN not working?**
    A typical QR bill ([example](https://github.com/php-core/php-swiss-qr-bill/blob/master/example/example.php)) requires a special QR IBAN. You can get yours from your bank. A classic IBAN can be used for QR bills with a SCOR reference ([example](https://github.com/php-core/php-swiss-qr-bill/blob/master/example/example_scor.php)) or no reference number at all ([example](https://github.com/php-core/php-swiss-qr-bill/blob/master/example/example_minimal.php)).
- **How do I recognize a QR IBAN?**
    In a QR IBAN, the *institute id*, which is defined in the 5th to 9th character, is a number in the range of 30000 to 31999. (Example: CH44 **3199 9**123 0008 8901 2). For how to detect it in code, see
- **How do I create QR bills for international IBANs?**
    You can't. The QR bill by specification only supports IBANs from Switzerland and Liechtenstein.
- **How do I create QR bills for amounts in currencies other than CHF or EUR?**
    You can't. The QR bill by specification only supports CHF and EUR.
- **How do I change translations to use my own wording?**
    You can't. The translations are defined in the QR bill specification and are not meant to be changed by the user. See [this document](https://github.com/php-core/php-swiss-qr-bill/blob/master/docs/specs/style-guide-en.pdf), page 31.
- **How do I make my QR bills payable by Twint?**
    See
- **What PDF libraries are supported by this library?**
    The following libraries are currently actively supported:

    - [fpdf/fpdf](https://packagist.org/packages/fpdf/fpdf)
    - [tecnickcom/tcpdf](https://packagist.org/packages/tecnickcom/tcpdf)
    - [setasign/fpdi](https://packagist.org/packages/setasign/fpdi) (accepted by `FpdfOutput` and `TcPdfOutput`)

    The output of `HtmlOutput` is known to be used to generate PDFs with [PrinceXML](https://www.princexml.com), [Docraptor](http://docraptor.com), and [dompdf/dompdf](https://packagist.org/packages/dompdf/dompdf) (with some adjustments as decribed [here](https://github.com/php-core/php-swiss-qr-bill/issues/178#issuecomment-1222752493))
- **Why are you using `final` on most classes? I want to extend them!**
    This library implements the official specification of the QR bill. This implementation is not supposed to be adjusted as it might result in broken QR bills. Therefore many classes are marked as final. If you find the need to extend one of those final classes, you might have found a bug in this library. In that case it will be very helpful if you provide a bug report or even a pull request. Thank you!

Getting help
------------

[](#getting-help)

Do you need more help using this library?

- [Search the existing and closed issues](https://github.com/php-core/php-swiss-qr-bill/issues?q=is%3Aissue) to see if you find your answer there.
- If you still need help, you may [create an issue](https://github.com/php-core/php-swiss-qr-bill/issues) yourself to ask your question.

Please note that the maintainer of this library will not provide any support by email. The beauty of open source software lies in the fact that everybody can benefit from each other. Therefore questions will only be answered in public.

Versioning
----------

[](#versioning)

[Semantic versioning](https://semver.org/) is used for this library.

In addition, a minor version will always be published if any visible change in the output of the qr code or the payment part takes place, even if it could be considered to be just a bugfix.

### PHP version support

[](#php-version-support)

This library supports a PHP version as long as it accounts for at least approximately 10% [of current installations](https://packagist.org/packages/php-core/swiss-qr-bill/php-stats).

### Dependency support

[](#dependency-support)

Older versions of dependencies are supported as long as they do not hinder further development or account for at least approximately 10% of current installations of the corresponding dependency.

Support the project
-------------------

[](#support-the-project)

- Do you like this project? [Consider a Github sponsorship.](https://github.com/sponsors/sprain)
- Would you like to contribute? [Have a look at the open issues.](https://github.com/php-core/php-swiss-qr-bill/issues) Be nice to each other.
- Spread the word!

Official resources
------------------

[](#official-resources)

The repository contains the official specifications the library is based on:

- [Swiss Implementation Guidelines QR-bill](docs/specs/ig-qr-bill-v2.3-en.pdf)
- [Technical information about the QR-IID and QR-IBAN](docs/specs/qr-iid_qr-iban-en.pdf)
- [Style Guide QR-bill](docs/specs/style-guide-en.pdf)
- [Validation Tool](https://validation.iso-payments.ch/gp/qrrechnung/validation/)

For more official information see

-

For contributors of this library
--------------------------------

[](#for-contributors-of-this-library)

How to generate new test data:

1. Set `$regenerateReferenceFiles = true` in `TraitValidQrBillsProvider`
2. `composer update --prefer-lowest`
3. `vendor/bin/phpunit` – ignore failing tests in `testQrFile`
4. `composer update`
5. `vendor/bin/phpunit` – there should be no more errors
6. Set `$regenerateReferenceFiles = false` in `TraitValidQrBillsProvider`

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance51

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.2% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/103283996?v=4)[PHP Core](/maintainers/php-core)[@php-core](https://github.com/php-core)

---

Top Contributors

[![sprain](https://avatars.githubusercontent.com/u/260361?v=4)](https://github.com/sprain "sprain (672 commits)")[![kohlerdominik](https://avatars.githubusercontent.com/u/18621527?v=4)](https://github.com/kohlerdominik "kohlerdominik (39 commits)")[![tafel](https://avatars.githubusercontent.com/u/5629730?v=4)](https://github.com/tafel "tafel (19 commits)")[![Franco2911](https://avatars.githubusercontent.com/u/53708871?v=4)](https://github.com/Franco2911 "Franco2911 (18 commits)")[![thePanz](https://avatars.githubusercontent.com/u/226021?v=4)](https://github.com/thePanz "thePanz (6 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (5 commits)")[![markcameron](https://avatars.githubusercontent.com/u/1106894?v=4)](https://github.com/markcameron "markcameron (2 commits)")[![iquito](https://avatars.githubusercontent.com/u/973653?v=4)](https://github.com/iquito "iquito (2 commits)")[![Sandritsch91](https://avatars.githubusercontent.com/u/17873124?v=4)](https://github.com/Sandritsch91 "Sandritsch91 (1 commits)")[![finpension-aless](https://avatars.githubusercontent.com/u/152924456?v=4)](https://github.com/finpension-aless "finpension-aless (1 commits)")[![groupnet](https://avatars.githubusercontent.com/u/10133206?v=4)](https://github.com/groupnet "groupnet (1 commits)")[![JohnyRicio](https://avatars.githubusercontent.com/u/29255375?v=4)](https://github.com/JohnyRicio "JohnyRicio (1 commits)")[![auerswald](https://avatars.githubusercontent.com/u/2876592?v=4)](https://github.com/auerswald "auerswald (1 commits)")[![sdespont](https://avatars.githubusercontent.com/u/646632?v=4)](https://github.com/sdespont "sdespont (1 commits)")[![Shkryob](https://avatars.githubusercontent.com/u/1246955?v=4)](https://github.com/Shkryob "Shkryob (1 commits)")[![stoll](https://avatars.githubusercontent.com/u/4408878?v=4)](https://github.com/stoll "stoll (1 commits)")

### Embed Badge

![Health badge](/badges/php-core-swiss-qr-bill/health.svg)

```
[![Health](https://phpackages.com/badges/php-core-swiss-qr-bill/health.svg)](https://phpackages.com/packages/php-core-swiss-qr-bill)
```

PHPackages © 2026

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