Freedom Pay
  1. Purchase
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
          POST
        • Any amount
          POST
        • Card
          POST
        • 3DSecure
          POST
        • Recurrent
          POST
        • Cancel
          POST
        • Clearing
          POST
        • Refund
          POST
        • Status
          POST
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
      • Merchant SDK
        • Android
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Payment Cards
      • Overview
      • Dictionaries
      • Bulk issue
      • Issue card
      • Issue plastic card
      • Activate card
      • Block card
      • Unblock card
      • Set PIN
      • Reset PIN counter
      • Close card
      • Update client
      • Card info
      • Balance
      • Secret data
      • Secret data (version 2)
      • Operations' list
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction info
      • Cardholder validation
      • Set limits
      • Limits list
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
      • Create terminal
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Overview
      • Design
      • iOS SDK
      • Android SDK
      • OAuth2
        • Authorization link
        • Token exchange
        • Token refresh
        • User info
        • Request profile
        • Get profile status
        • Create user
        • Update user
      • OIDC
        • Authorization endpoint
        • Token exchange
        • Userinfo
      • Error codes
      • Examples
        • Keycloak
    • Transfer
      • Overview
      • Get token
      • Refresh token
      • Get agents
      • Fees
      • Create person
      • Create business
      • Create transfer
      • Print application
      • Confirm
      • Search
      • Payout
      • Payout confirm
      • Cancel
      • Get person info
      • Get business info
      • Status
      • Info
    • Device ID
      • Android SDK
      • iOS SDK
    • Implement SuperApp
      • Overview
      • Pay
      • Refund
    • Account
      • Settlement
        • Overview
        • Create payment
        • Payment status
    • Invoice
  1. Purchase

Create payment

POST
https://api.freedompay.kz/g2g/payment_page/
There are two options for using the method:
direct data transfer from the merchant to FreedomPay
data transfer via the user's browser to FreedomPay
When directly transferring data from the merchant to FreedomPay, the merchant must send data to init_payment.php.
 When transferring data via the user's browser to FreedomPay, the merchant must redirect the user with the data to payment.php.
You can transfer arbitrary additional parameters whose names do not begin with pg_. All these parameters will be transferred to pg_check_url and pg_result_url.
The names of additional merchant parameters must be unique.
After receiving the pg_redirect_url parameter, the user is redirected to the payment page, where the payer completes the payment.
If successful, the user will be redirected to the payment page.
If the merchant has not transferred all the parameters necessary to create a payment transaction (payment system, user's phone number and parameters necessary for the selected payment system), they are requested from the user on the freedompay.kz website.
Frame is an embeddable HTML element that loads page content from the Freedom Pay Gateway. It is used to display the payment form (e.g., fields for entering the card number and CVV code) directly on the merchant's page.
To invoke the Frame method, the parameter pg_payment_route = frame must be included in the request to the Freedom Pay Gateway.
To use this method, you should contact your manager.

Interaction diagram#

Status: success/error/pending
Merchant_API_V3-Payment page.drawio.png

Request

Body Params multipart/form-data

Request Code 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.kz/g2g/payment_page/' \
--form 'pg_merchant_id=""' \
--form 'pg_order_id=""' \
--form 'pg_amount=""' \
--form 'pg_currency=""' \
--form 'pg_description=""' \
--form 'pg_testing_mode=""' \
--form 'pg_lifetime=""' \
--form 'pg_language=""' \
--form 'pg_user_id=""' \
--form 'pg_user_ip=""' \
--form 'pg_user_phone=""' \
--form 'pg_user_contact_email=""' \
--form 'pg_payment_method=""' \
--form 'pg_request_method=""' \
--form 'pg_check_url=""' \
--form 'pg_result_url=""' \
--form 'pg_success_url=""' \
--form 'pg_failure_url=""' \
--form 'pg_site_url=""' \
--form 'pg_success_url_method=""' \
--form 'pg_failure_url_method=""' \
--form 'pg_param1=""' \
--form 'pg_param2=""' \
--form 'pg_param3=""' \
--form 'pg_generate_qr=""' \
--form 'pg_idempotency_key=""' \
--form 'pg_loyalty_id=""' \
--form 'pg_loyalty_amount=""' \
--form 'pg_freedom_id=""' \
--form 'pg_salt=""' \
--form 'pg_sig=""'

Responses

🟢200Success
application/xml
Body

Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>123456</pg_payment_id>
    <pg_redirect_url>https://customer.freedompay.kz/</pg_redirect_url>
    <pg_redirect_url_type>need data</pg_redirect_url_type>
    <pg_redirect_qr>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...</pg_redirect_qr>
    <pg_salt>some random string</pg_salt>
    <pg_sig>signature-abc123</pg_sig>
</response>
🟢200Invalid Signature
Modified at 2025-03-03 07:41:50
Previous
Overview
Next
Any amount