Freedom Pay
  1. Invoice
Freedom Pay
  • Gateway API
    • Introduction
    • Reference
      • Test cards
      • Error codes
    • Sync API
      • Introduction
      • Page
        • Introduction
        • Page
        • Page with amount control
        • Status
      • Pay
        • Introduction
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • Payout
        • Introduction
        • Card
        • IBAN
        • Balance
        • Status
        • StatusV2
      • Transfer
        • Introduction
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Introduction
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Introduction
        • Token Pay
        • Apple Pay
        • Google Pay
        • Samsung Pay
        • Token Payout
        • Status
    • Async API
      • Introduction
      • create
        • create payment
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • Merchant API
    • Introduction
    • Reference
      • Test cards
      • Test phone numbers
      • Error codes
    • Page
      • Introduction
      • Page
      • Page with amount control
      • Payout page
      • Frame
      • Widget
      • Status
    • Pay
      • Introduction
      • Cancel
      • Clearing
      • Refund
      • Status
    • Payout
      • Introduction
      • IBAN
      • Balance
      • Status by order_id
      • Status by Payment ID
      • Status by Payment ID V2
    • Mobile balance
      • Introduction
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Card
      • Introduction
      • Add
      • Add for payout
      • Remove
      • List
      • Status
    • Token
      • Introduction
      • Saved card with CVC input (Init)
      • Saved card with CVC input (Pay)
      • Non-acceptance payments
      • Non-acceptance payments (Pay)
      • Token payout
      • Status
    • Invoice
      • Introduction
      • Init
        POST
      • Info
        POST
      • Pay
        POST
      • Status
        POST
    • Additional
      • Introduction
      • Check request
      • Result notify
      • Payout notify
      • Redirect back
  • Card API
    • Introduction
    • Payment Cards
      • Reference
        • Request Status
        • Client product
        • Card product
        • Card status
        • Card block
        • Transaction
        • Error codes
      • Card issue
        • Bulk
        • Single
        • Physical
      • Card control
        • Activate
        • Block
        • Unblock
        • Set PIN
        • Reset PIN counter
        • Close
        • Identification
        • Info
        • Balance
        • Secret data
        • Statement
      • Client
        • Create
        • Edit
        • Card list
      • Additional
        • Request status
    • Gift Cards
      • Introduction
      • Reference
        • Request status
        • Card status
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Introduction
      • Rates
    • Products
      • Introduction
      • Reference
        • Request
        • Product
        • Freedom POS
        • Freedom ECOM
        • Freedom BOX
        • Limits
      • Add user
      • Add product
      • Add user with product
      • Grant user
      • Send auth data
      • Request status
    • E-Money
      • Introduction
      • Reference
        • Request
        • Operation
        • Error codes
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Introduction
      • Android SDK
      • iOS SDK
      • Reference
        • Error codes
      • Link
      • Token
      • Token refresh
      • Info
      • Profile
      • Request
  • Mobile SDK
    • Payment SDK
      • iOS
      • Android
    • Freedom QR
      • Reader SDK (Android)
      • Provider SDK (Android)
  • CMS
    • Introduction
    • Get Merchant ID and key
    • WordPress
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
      • Update
    • Tilda
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
    • InSales
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
    • Ecwid
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
    • Bitrix
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
    • PrestaShop
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
    • OpenCart
      • Introduction
      • Installation
      • Configuration
      • Test
      • Live payments
  1. Invoice

Introduction

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#

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.

Init#

To use this method, you need to initiate the payment by sending a request to the Freedom Pay Gateway.
In response, you will receive an invoice_id and a QR (URL to redirect the user in the form of a QR code).

Interaction diagram#

Status: success/error/pending
Merchant_API_V3-Invoice.drawio.png

Info#

Next, after the payer scans the QR code, you need to send a request to the Freedom Pay Gateway to display the payment information.

Pay#

This method is the actual request to process the payment.

Status#

This method is used to get information about the current status of a payment, such as whether it was successful, an error occurred, or is pending etc.

Support#

If you found an inaccuracy or need help, feel free to reach out! 👋
Email: support@freedompay.uz
Previous
Status
Next
Init