QR Reference

This example shows how to create a QR reference using the QRReferenceUtils class.

import ch.codeblock.qrinvoice.util.QRReferenceUtils;

// ...

// QR references can be created without restrictions from numeric input with up to 26 digits, the 27th digit is used as check digit
final String qrReference = QRReferenceUtils.createQrReference("127");

System.out.println(qrReference);
// prints 000000000000000000000001273

If your bank supplies you with customer IDs, the createQrReference method can add them as a prefix to your reference numbers:

import ch.codeblock.qrinvoice.util.QRReferenceUtils;

// ...

final String qrReference = QRReferenceUtils.createQrReference("123", "127"); // Customer ID 123 with reference number 127

System.out.println(qrReference);
// prints 123000000000000000000001279

Creditor reference

This example shows how to create a Creditor reference using the CreditorReferenceUtils class.

import ch.codeblock.qrinvoice.util.CreditorReferenceUtils;

// ...

// Creditor references can be created from alphanumeric (0-9a-zA-Z) input with up to 21 chars, 2 chars are used for "RF" prefix and two for the check digits
final String creditorReference = CreditorReferenceUtils.createCreditorReference("123");

System.out.println(creditorReference);
// prints RF78123