Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sepa-payment-qr-code

derhuerst1.3kISC2.0.2

Generate a QR code to initiate a SEPA bank transfer.

payment, sepa, bank transfer, qr, quick response, epc, sct, msct, credit transfer

readme

sepa-payment-qr-code

Generate a QR code to initiate a SEPA credit transfer a.k.a. bank transfer.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installation

npm install sepa-payment-qr-code

Usage

// generate-qr-code.js
const generateQrCode = require('sepa-payment-qr-code')

const qr = generateQrCode({
    name: 'Red Cross of Belgium',
    iban: 'BE72000000001616',
    amount: 123.45,
    unstructuredReference: 'Urgency fund',
    information: 'Sample QR code'
})

process.stdout.write(qr)
node generate-qr-code.js | qrencode -t ansiutf8 -l M
# prints QR code to the terminal

This library only generates the text input to be QR-encoded. Use the library of your choice to render the QR code to PNG/SVG/React/etc.

Note the following limitations posed by European Payments Council's (EPC) Quick Response Code: Guidelines to Enable Data Capture for The Initiation of a Sepa Credit Transfer document:

2 2D Code Guidelines Definition:

  • QR code error level M (15% of code words can be restored)
  • Maximum QR code version 13, equivalent to module size 69 or 331 byte payload
  • Character sets:
    • UTF-8
    • ISO 8859-1
    • ISO 8859-2
    • ISO 8859-4
    • ISO 8859-5
    • ISO 8859-7
    • ISO 8859-10
    • ISO 8859-15

Also note that EPC QR codes are always in euros (EUR).

See also

Contributing

If you have a question or need support using sepa-payment-qr-code, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.