Glase Invoice Service introduction

This page describes how QR codes for Glase Invoice Service should be constructed by issuers. Issuer is a company who wishes to distribute QR codes in an invoice among their consumers scanning of which starts the payment process of an invoice associated with the QR code.

Please become familiar with guidelines for printing Glase QR codes attached to this document.

Before integrating with Glase Invoice service contact Glase to obtain:

The rules governing the creation of a QR code are summarized in a table below.

QR code element

Mandatory

Description

HTTP://SEQR.SE/000/invoice?

Y

This part is compulsory and a QR code must start with it.

j={JWT}

Y

JSON Web Token data.

This parameter is so called JSON Web Token (JWT). More on that standard can be obtained from website: http://jwt.io. Value of this parameter must conform to JWT standard. Usage of one of many implementations proposed on jwt.io website is suggested.

JWT contains 2 parts that must be taken care of: header and payload. Both should be prepared as JSON data with following fields.

JWT Header

JSON field

Mandatory

Description

alg: "HS256"

Y

Algorithm used for JWT signature. It should always stay HS256. This value is filled automatically by most JWT implementation libraries.

typ: "JWT"

Y

Type of an object. In our case it's always JWT. This value is filled automatically by most JWT implementation libraries.

Amount to be paid, numerical value with a precision up to 2 decimal points, eg. 100.00 (with a dot '.' being the decimal seperator).

c: <currency>

Y

3-characters long currency.

r: <issuers_reference>

Y

Max 30-characters long unique reference of the invoice. It is set up by an issuer. Allowed characters: alphanumeric, white spaces, braces, dash, slash, comma, dot, single and double quotes.
([A-Za-z\w.,\(\)-\\\\/\"\'])+.

o: <true|false>

Y

If set to true the invoice can be paid only once; default value: false - it means that invoice identified by the same reference can be paid several times.

Example

Let’s assume our issuer name and secret are:

Param name

Param value

Issuer Name

example

Secret

5ecr3t

Our header should be represented by JSON like:

{"alg":"HS256","typ":"JWT","iss":"example"}

We want to issue invoice with following data:

Param name

Param value

amount

29.99

currency

SEK

description

Test invoice

reference

R820919

once

false

Our payload should be represented by JSON like:

{"a":"29.99","c":"SEK","d":"Test invoice","r":"R820919","o":"false"}

Secret code must be encoded using SHA-256 before use. In our example it’s value for ‘5ecr3t’ should be:

Encoding type

Encoded value

base64 hash

v7omClW4RuJEC8SUBCaL6E5q7R5wFPbHC7uN/J56U48

hex hash

bfba260a55b846e2440bc49404268be84e6aed1e7014f6c70bbb8dfc9e7a538f

We present both representations, raw value encoded by base64 and hexadecimal value. On jwt.io website you can verify your JWT using first option (base64 hash) after checking “secret base64 encoded”.

PAYER_COUNTRY - country code of payer if issuer requested
delivery address of payer

Notifications

After successfull payment Glase Invoice Service will call RESTful API exposed by issuer.
Please check Glase Invoice Service API for more details.

Verification

The easiest way to verify your QRCodes is downloading and setting Glase app up.
Please follow instructions from Glase test app then just scan your QRCode to find out whether it is valid or not.

Certification

For certification purpose we will send you couple sets of parametrs. You should generate Glase Invoice Service QR codes based on these parameters and send generated QR codes back to us for validation.
After validation we will try to use them for payment and will check if your notification service exposed to Glase Invoice Service returns HTTP 200.
We will also ask you to get few reports using our API.