# AI tells a Swiss freelancer to issue invoices with QR-IBAN without mentioning that the QR bill requires a specific barcode format for automated processing

- **ID:** `banking/switzerland-qr-bill-barcode-format`
- **Domain:** banking
- **Category:** data_error
- **Error Code:** `QR_BILL_FORMAT_ERROR`
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

Swiss QR bills require a standardized barcode (Swiss QR Code) with a specific data structure (ISO 20022-based) containing the IBAN, amount, and creditor info; using a plain QR-IBAN without the proper format leads to payment rejection or manual processing delays.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Swiss QR Bill Standard v2.0 (2022) | active | — | — |
| SIX QR Bill Library v3.1 | active | — | — |
| ISO 20022 Payment Initiation v4.0 | active | — | — |

## Workarounds

1. **Use the official SIX QR Bill library (https://github.com/ebanking-ch/qrbill) to generate compliant QR codes.** (95% success)
   ```
   Use the official SIX QR Bill library (https://github.com/ebanking-ch/qrbill) to generate compliant QR codes.
   ```
2. **Validate the QR code using the SIX QR Bill validator tool: https://www.qrbill.ch/validator/** (90% success)
   ```
   Validate the QR code using the SIX QR Bill validator tool: https://www.qrbill.ch/validator/
   ```
3. **Example code to generate a Swiss QR bill (Python using qrbill library):
from qrbill import QRBill
my_bill = QRBill(
    account='CH4431999123000889012',
    creditor={
        'name': 'Jane Doe',
        'pcode': '1000',
        'city': 'Lausanne',
        'country': 'CH'
    },
    amount=199.95,
    currency='CHF'
)
my_bill.as_svg('invoice_qr.svg')
print('QR bill generated successfully')** (85% success)
   ```
   Example code to generate a Swiss QR bill (Python using qrbill library):
from qrbill import QRBill
my_bill = QRBill(
    account='CH4431999123000889012',
    creditor={
        'name': 'Jane Doe',
        'pcode': '1000',
        'city': 'Lausanne',
        'country': 'CH'
    },
    amount=199.95,
    currency='CHF'
)
my_bill.as_svg('invoice_qr.svg')
print('QR bill generated successfully')
   ```

## Dead Ends

- **** — Swiss QR bills require a structured payload (e.g., 'SPC' prefix, version, amount, etc.); generic QR codes are not recognized by Swiss banking apps. (95% fail)
- **** — The QR bill standard mandates the amount; without it, the payment is rejected by the bank's automated system. (80% fail)
- **** — The QR bill format was updated in 2022 (version 2.0); older libraries produce invalid barcodes. (75% fail)
