The Swiss Implementation Guidelines QR-Bill allow two types of address types:

  • Structured Address

  • Combined Address

The following table compares them

Example: Structured Exampled: Combined Remarks

Address type

«S»

«K»

«S» - Structured address

«K» - Combined address

Name

Pia-Maria Rutschmann-Schnyder

Pia-Maria Rutschmann-Schnyder

Street or address line 1

Grosse Marktgasse

Grosse Marktgasse 28

«S» - Street/P.O. Box

«K» - Street and building number of P.O. Box

Building number or address line 2

28

9400 Rorschach

«S» - Building number

«K» - Postal code and town

Postal code

9400

«S» - Postal code

«K» - Do not fill in

Town

Rorschach

«S» - Town

«K» - Do not fill in

Country

CH

CH

Source: Swiss Implementation Guidelines QR-bill - version 2.0, Chapter 4.4.1, Table 8

QR Invoice API Examples

The QR Invoice Native Library provides an easy way to either use the structured or the combined address type.

Structured Address

#include <qrinvoice/model/qr_invoice.hpp>

qrinvoice::model::qr_invoice::builder qr_invoice_builder;

// ...

qr_invoice_builder.ultimate_debtor()
    .structured_address()
    .name("Pia-Maria Rutschmann-Schnyder")
    .street_name("Grosse Marktgasse")
    .house_number("28")
    .postal_code("9400")
    .city("Rorschach")
    .country("CH");

// ...

const qrinvoice::model::qr_invoice qr_invoice = qr_invoice_builder.build();

Combined Address

#include <qrinvoice/model/qr_invoice.hpp>

qrinvoice::model::qr_invoice::builder qr_invoice_builder;

// ...

qr_invoice_builder.ultimate_debtor()
    .combined_address()
    .name("Pia-Maria Rutschmann-Schnyder")
    .address_line1("Grosse Marktgasse 28")
    .address_line2("9400 Rorschach")
    .country("CH");

// ...

const qrinvoice::model::qr_invoice qr_invoice = qr_invoice_builder.build();