# AI 告诉瑞士自由职业者使用 QR-IBAN 开具发票，但没有提到 QR 账单需要特定的条码格式才能自动处理

- **ID:** `banking/switzerland-qr-bill-barcode-format`
- **领域:** banking
- **类别:** data_error
- **错误码:** `QR_BILL_FORMAT_ERROR`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

瑞士 QR 账单需要标准化的条码（瑞士 QR 码），具有特定的数据结构（基于 ISO 20022），包含 IBAN、金额和收款人信息；使用不带正确格式的纯 QR-IBAN 会导致付款被拒绝或人工处理延迟。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Swiss QR Bill Standard v2.0 (2022) | active | — | — |
| SIX QR Bill Library v3.1 | active | — | — |
| ISO 20022 Payment Initiation v4.0 | active | — | — |

## 解决方案

1. ```
   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/
   ```
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')
   ```

## 无效尝试

- **** — 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% 失败率)
- **** — The QR bill standard mandates the amount; without it, the payment is rejected by the bank's automated system. (80% 失败率)
- **** — The QR bill format was updated in 2022 (version 2.0); older libraries produce invalid barcodes. (75% 失败率)
