Freedom Pay
  1. Mobile balance
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
        POST
      • Pay
        POST
      • Approve
        POST
      • Resend code
        POST
      • Status
        POST
    • 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
      • Info
      • Pay
      • Status
    • 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. Mobile balance

Init

POST
https://api.freedompay.uz/init_payment.php

Request

Body Params multipart/form-data
pg_order_id
string 
required
Payment ID in the merchant system. It is recommended to keep this field unique.
Example:
00102
pg_merchant_id
integer 
required
Merchant ID in {{project}}. Issued upon connection.
pg_amount
number 
required
Payment amount in pg_currency. Minimum 0.01.
Example:
10
pg_description
string 
required
Description of the product or service. Displayed to the customer during the payment process.
Example:
Ticket
pg_salt
string 
required
Random string.
Example:
some random string
pg_sig
string 
required
Request signature.
pg_currency
string 
optional
The currency in which the amount is specified. KZT
Example:
KZT
pg_check_url
string 
optional
URL to check the possibility of payment. Called before the payment
pg_result_url
string 
optional
URL to report the result of the payment. Called after payment on success or failure.
pg_request_method
string 
optional
GET
Example:
POST
pg_success_url
string 
optional
URL to which the user is sent in case of a successful payment (for online systems only).
pg_failure_url
string 
optional
URL to which the user is sent in case of unsuccessful payment (for online systems only).
pg_success_url_method
string 
optional
GET is a button that is submitted by the GET method. POST is a button that is submitted using the POST method.
Example:
GET
pg_failure_url_method
string 
optional
GET is a button that is submitted by the GET method. POST is a button that is submitted using the POST method.
Example:
GET
pg_site_url
string 
optional
URL of the merchant's site to show the buyer a link by which they can return to the merchant's site after creating an account. Applies to offline PS (cash).
Example:
http://site.kz/return
pg_lifetime
integer 
optional
Default: 86400. Time (in seconds) during which the payment must be completed. Minimum: 300 seconds (5 minutes). Maximum: 604800 seconds (7 days).
Example:
86400
pg_user_phone
string 
optional
The user's phone number (starting with the country code). If not specified
Example:
77777777777
pg_user_contact_email
string 
optional
User's contact email address. If specified
Example:
mail@customer.kz
pg_user_ip
string 
optional
Client's IP address. Necessary for the analysis of disputable situations in case of suspected fraud.
Example:
127.0.0.1
pg_language
string 
optional
The language of the payment pages on the {{project}} site and (if possible) payment systems. Options: 'en'
Example:
ru
pg_testing_mode
integer 
optional
Creating a payment in test mode.
Example:
1
pg_user_id
string 
optional
User ID in the merchant system.
Example:
No65GFR755789T
pg_param1
string 
optional
Additional parameter 1.
Example:
Additional information
pg_param2
string 
optional
Additional parameter 2.
Example:
Additional information
pg_param3
string 
optional
Additional parameter 3.
Example:
Additional information
pg_payment_method
string 
optional
Value - Payment method. Example: mobile_commerce.
Example:
mobile_commerce
pg_generate_qr
boolean 
optional
In case you want to receive a QR code with a link to the {{project}} payment form in base64 format
Example:
1
pg_commission_discount
boolean 
optional
If you want to use a discount on the commission
Example:
1
pg_commission_discount_fix
number 
optional
To use a fixed discount amount.
pg_commission_discount_percentage
number 
optional
To use a percentage discount.
pg_idempotency_key
string 
optional
Idempotency key. Used to prevent duplicate request creation. A unique value within the merchant's scope; the same key cannot be used for different operations.

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.freedompay.uz/init_payment.php' \
--form 'pg_order_id="00102"' \
--form 'pg_merchant_id=""' \
--form 'pg_amount="10"' \
--form 'pg_description="Ticket"' \
--form 'pg_salt="some random string"' \
--form 'pg_sig=""' \
--form 'pg_currency="KZT"' \
--form 'pg_check_url=""' \
--form 'pg_result_url=""' \
--form 'pg_request_method="POST"' \
--form 'pg_success_url=""' \
--form 'pg_failure_url=""' \
--form 'pg_success_url_method="GET"' \
--form 'pg_failure_url_method="GET"' \
--form 'pg_site_url="http://site.kz/return"' \
--form 'pg_lifetime="86400"' \
--form 'pg_user_phone="77777777777"' \
--form 'pg_user_contact_email="mail@customer.kz"' \
--form 'pg_user_ip="127.0.0.1"' \
--form 'pg_language="ru"' \
--form 'pg_testing_mode="1"' \
--form 'pg_user_id="No65GFR755789T"' \
--form 'pg_param1="Additional information"' \
--form 'pg_param2="Additional information"' \
--form 'pg_param3="Additional information"' \
--form 'pg_payment_method="mobile_commerce"' \
--form 'pg_generate_qr="1"' \
--form 'pg_commission_discount="1"' \
--form 'pg_commission_discount_fix=""' \
--form 'pg_commission_discount_percentage=""' \
--form 'pg_idempotency_key=""'

Responses

🟢200Success
application/xml
Body
pg_status
string 
required
Shows the result of the query.
Status Description
ok: Request successful
error: The request failed.
pg_payment_id
integer 
required
The unique identifier of the payment transaction in {{project}}. Serves as a key for all further work with the transaction.
pg_redirect_url
string 
required
The URL to redirect the user to. It can be both on the site {{site}} and on the site of the payment system.
pg_redirect_url_type
string 
required
The type of page to which the redirect occurs. Possible values:
need data: Dialogue with the buyer to clarify the parameters (e.g., payment system, phone number, required parameters).
payment system: Page of the payment system website or a page with instructions for paying through this payment system.
If the merchant receives a response with pg_redirect_url_type="need data", the merchant may not redirect the buyer to the received URL but clarify missing parameters on your site. After specifying the parameters and re-requesting the creation of a payment transaction, a new transaction will be created.
pg_redirect_qr
string 
optional
URL to redirect the user as a QRCode. Transmitted in base64 format.
pg_salt
string 
required
Random string.
pg_sig
string 
required
Request signature.
Example
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <pg_status>string</pg_status>
  <pg_payment_id>0</pg_payment_id>
  <pg_redirect_url>string</pg_redirect_url>
  <pg_redirect_url_type>string</pg_redirect_url_type>
  <pg_redirect_qr>string</pg_redirect_qr>
  <pg_salt>string</pg_salt>
  <pg_sig>string</pg_sig>
</root>
Previous
Introduction
Next
Pay