Invoice#
Invoice QR Payment refers to a payment method where a QR code is generated as part of an invoice. This QR code contains all the necessary payment details
Authorization#
Request authorization occurs by generating and passing the JWS
token in the X-JWS-Signature
header
The JWS
is the part of the JWT
token that contains only the header
and signature
Request type application/json
.
Signature generation example#
{
"order_id": "828cf71d-a447-4a67-a149-c1df8bc197ca",
"merchant_id": "123456",
"amount": 100,
"description": "Service invoice",
"invoice_method": "qr",
"currency": "KZT"
}
{
"uri": "/v5/merchant/invoice/init",
"merchant_id": "123456",
"method": "POST",
"params": "",
"alg": "HS512"
}
The merchant key can be secret_key
. In this case, the following JWT
token can be generated:
eyJwYXRoIjoiL3Y1L21lcmNoYW50L2ludm9pY2UvaW5pdCIsIm1lcmNoYW50X2lkIjoxMjM0NTYsIm1ldGhvZCI6IlBPU1QiLCJwYXJhbXMiOiIiLCJhbGciOiJIUzUxMiJ9.eyJvcmRlcl9pZCI6IjgyOGNmNzFkLWE0NDctNGE2Ny1hMTQ5LWMxZGY4YmMxOTdjYSIsIm1lcmNoYW50X2lkIjoxMjM0NTYsImFtb3VudCI6MTAwLCJkZXNjcmlwdGlvbiI6ItCh0YfQtdGCINC30LAg0YPRgdC70YPQs9C4IiwiaW52b2ljZV9tZXRob2QiOiJxciIsImN1cnJlbmN5IjoiS1pUIn0.wCwFCAmxN0nbTm6mad8GxowIjgkCwfF7IAy2ijO9thLjsZFXnS4K_I4NPnXjkTFTMnEzqjk8rtIVmtf7NbGyvg
The merchant needs to cut out the part containing payload
from the JWT
token and get the following line:
eyJwYXRoIjoiL3Y1L21lcmNoYW50L2ludm9pY2UvaW5pdCIsIm1lcmNoYW50X2lkIjoxMjM0NTYsIm1ldGhvZCI6IlBPU1QiLCJwYXJhbXMiOiIiLCJhbGciOiJIUzUxMiJ9..wCwFCAmxN0nbTm6mad8GxowIjgkCwfF7IAy2ijO9thLjsZFXnS4K_I4NPnXjkTFTMnEzqjk8rtIVmtf7NbGyvg
This string is the signature of the request and must be passed in the X-JWS-Signature
request header parameter.
Supported signature encryption algorithm HS512
.