schoero / swissqrbill

Swiss QR Bill generation in Node.js and browsers
MIT License
159 stars 29 forks source link

QR-REFERENCE #380

Closed vaibhavG321 closed 2 years ago

vaibhavG321 commented 2 years ago

Hello,

I am a little new to swiss payments. And I am using this library to create a qr-bill in my project.

But I have doubt about qr-reference, as I am using a qr-iban so I need a qr-reference for it.

So please anyone tell me how to get this qr-reference.

Thank you

schoero commented 2 years ago

What are your questions exactly?

If you don't need or want to use a QR-Reference, you can simply use your normal IBAN without any reference.

The QR-Reference can be used to automate your accounting processes.

It is a 27-digit number, usually starting with an identification number, which you receive from your bank together with the QR-IBAN. The last digit of the reference is the checksum. You can calculate the checksum using the calculateQRReferenceChecksum function, exported from utils. The rest of the digits have no structure and can be freely chosen. It usually makes sense to use a combination of the customer number and invoice number and fill the other digits with 0.

vaibhavG321 commented 2 years ago

Thanks a lot!

Actually, I want to use QR-Reference. I have QR-IBAN but didn't know how to get the QR-Reference.

Can you please confirm, how many starting digits are the identification number? I just want to ask about the proper structure of this 27-digit QR-Reference.

schoero commented 2 years ago

I'm not sure about that. When I got my QR-IBAN, I have received a 6-Digit identification number from my bank (ZKB) and a diagram how it must be used which looked like that:

II IIIIN NNNNN NNNNN NNNNN NNNNC
^      ^                       ^
Identification number
       Variable numbers
                               Checksum

But I think the length of the identification number varies from bank to bank. It could also be possible that some banks do not use an identification number at all, as the specification of the QR-Reference only cover the length, the allowed characters (0-9) and the checksum.

I would recommend to check with your bank if they have specific requirements.

vaibhavG321 commented 2 years ago

Thanks a lot! I will follow your steps and confirm the identification number once.