Invoicing

Invoicing is a type of payment that uses a request to create a web link that customers can simply click to complete their purchases.

Invoicing allows the seller or supplier of goods and services to create and send the buyer an invoice for payment by email.

Also, in addition to invoicing, it is possible to pay using a QR code, payments in which the client needs to scan a QR code.
Interaction scheme
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
Request Body:
{
    "order_id": "828cf71d-a447-4a67-a149-c1df8bc197ca",
    "merchant_id": "123456",
    "amount": 100,
    "description": "Service invoice",
    "invoice_method": "qr",
    "currency": "KZT"
}
JWT token header:
{
  "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.
Invoice
You initiate an invoice by submitting a request to v5/merchant/invoice/init

Account initialization
Request URL:
POST https://api.freedompay.uz/v5/merchant/invoice/init

Request fields:
The lifetime of the invoice is 5 minutes. If there were no payment attempts within 5 minutes, the account goes into the status - incomplete
Invoice Information

Get account information.

Request URL:
POST https://api.freedompay.uz/v5/merchant/invoice/info
Request fields:
Response fields:
Bill payment

You pay the invoice using a token by sending a request to /v5/merchant/invoice/pay

Request URL:

POST https://api.freedompay.uz/v5/merchant/invoice/pay

Request fields:
Response fields:
Get account status

Get payment status - use our standard

Request URL:

POST https://api.freedompay.uz/v5/merchant/invoice/status

Request fields:
Response fields: