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
        • 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
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • 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
    • 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)
      • Statement
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction request' status
      • Transaction info
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
    • 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
  1. Purchase

Any amount

POST
https://api.freedompay.kz/g2g/any_amount
If you want the payer to enter the payment amount himself, you must use this method
When making a payment, the payer first gets to the form where he enters the amount of the payment
Then it is redirected to the payment page where the payment takes place

Interaction diagram#

Status success/error/pending
Merchant_API_V3-Any amount method.drawio.png

Request

Body Params multipart/form-data
pg_merchant_id
integer 
required
Merchant ID in {{project}}
Issued upon connection
pg_order_id
string 
required
Payment ID in the merchant system. It is recommended to keep this field unique
pg_amount
number 
optional
Payment amount in pg_currency
>= 0.01
pg_amount_interval_from
integer 
optional
The lower limit of the payment amount
pg_amount_interval_to
integer 
optional
The highest threshold for the payment amount
pg_currency
string 
optional
Currency in which the amount is specified
pg_description
string 
required
Payment description
(These parameters may include parameters from other sections. For the effective operation of SecureBox, it is recommended to follow the validation guidelines and field examples from this section)
pg_testing_mode
integer 
optional
Creating a payment in test mode
pg_lifetime
integer 
optional
Time during which the payment must be completed (in seconds)
pg_language
string <ISO 639-1:2002>
optional
The language of the payment page can be synchronized with the language of your application or website user
Default:
ru
Examples:
ruenkzkguz
pg_user_id
string 
optional
User ID in the merchant system
pg_user_ip
string 
optional
Client's IP address
pg_user_phone
string 
optional
The user's phone number (starting with the country code)
pg_user_contact_email
string 
optional
User's contact email address
pg_payment_method
string 
optional
Payment method
pg_check_url
string 
optional
URL to check the possibility of payment
pg_result_url
string 
optional
URL to report the result of the payment
pg_success_url
string 
optional
URL to which the user is sent in case of a successful payment
pg_failure_url
string 
optional
URL to which the user is sent in case of unsuccessful payment
pg_site_url
string 
optional
Merchant's site URL for returning the buyer after payment
pg_success_url_method
string 
optional
Method used for the success URL (GET or POST)
pg_failure_url_method
string 
optional
Method used for the failure URL (GET or POST)
pg_request_method
string 
optional
GET
pg_param1
string 
optional
Additional parameter 1
pg_param2
string 
optional
Additional parameter 2
pg_param3
string 
optional
Additional parameter 3
pg_generate_qr
boolean 
optional
Receive a QR code with a link to the payment form in base64 format
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
pg_loyalty_id
string 
optional
Identifier in the loyalty system
pg_loyalty_amount
number 
optional
Amount of accrued units in the loyalty system
pg_freedom_id
string 
optional
User identifier in the Freedom ecosystem
pg_salt
string 
required
Random string consisting of arbitrary numbers and Latin letters
pg_sig
string 
required
Request signature

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.kz/g2g/any_amount' \
--form 'pg_merchant_id=""' \
--form 'pg_order_id=""' \
--form 'pg_amount=""' \
--form 'pg_amount_interval_from=""' \
--form 'pg_amount_interval_to=""' \
--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_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_request_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
pg_payment_id
integer 
required
Payment ID
pg_status
string 
required
ok
pg_redirect_url
string 
required
pg_redirect_url_type
string 
required
pg_redirect_qr
string 
required
pg_salt
string 
required
pg_sig
string 
required
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>
Previous
Create payment
Next
Card