1. Purchase
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Card data encryption
      • Payments
        • Overview
        • Pay by card
        • Pay by card: complete 3DS
        • Pay with Apple Pay
        • Pay with Google Pay
        • Pay by recurring profile
        • Create payment page
        • Create payment page with any amount
        • Capture payment (clearing)
        • Cancel payment
        • Refund payment
        • Get payment status
      • Payout
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfer
        • Overview
        • Transfer from card to card
        • Transfer from card to card: complete 3DS
        • Get exchange rates
        • Get transfer status
      • Saved cards
        • Overview
        • Save card
        • Save card: complete 3DS
        • List saved cards
        • Remove saved card
        • Pay by card token
        • Pay out to card token
        • Get payment status
    • Async API
      • Overview
      • Create
        • Create payment
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
        • Cancel payment (reverse)
        • Refund payment
  • 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
        POST
      • Create payment with any amount
        POST
      • Create recurring payment
        POST
      • Cancel payment
        POST
      • Capture payment (clearing)
        POST
      • Refund payment
        POST
      • Get payment status
        POST
      • Create payment with a payment page template
        POST
      • Create payment in a payment frame
        POST
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Recurring profile
        • Overview
        • Create
        • Cancel
        • Info
        • Notify
      • Tips
        • Overview
        • Create
      • Create
      • Execute
      • Info
      • Refund
      • Status
      • Cancel
    • SDK
      • JS SDK
      • Merchant SDK
        • Google Pay
        • Android
        • IOS
    • 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
    • Installment
      • Overview
      • Status
        • Application Status
        • Application Callback Status
        • Application Change Status
      • Get partners
      • Create application
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Client request status
      • Create terminal
      • Update terminal limits
      • Product request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Device ID
      • Android SDK
      • iOS SDK
    • Implement SuperApp
      • Overview
      • Pay
      • Refund
      • Status
    • Account
      • Overview
      • Create payment
      • Payment status
      • Batch statuses
      • Statement
      • Statement status
      • Balance
      • Balance status
    • Invoices
      • Info
  1. Purchase

Create payment with any amount

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/any_amount.php
Creates a payment without an amount and returns the link to the amount entry page: pg_redirect_url. Redirect the client to it: the client enters the amount and then pays on the standard payment page.
On the amount entry page the client also enters the order ID, phone number and email if they are not passed in the request.
To limit the amount, pass pg_amount_interval_from and pg_amount_interval_to: the page does not accept an amount outside the interval.
Until the client enters the amount, Get payment status returns pg_payment_status = new and pg_amount = 0.
The result of the payment comes to pg_result_url, see Result notify. After the payment the client is returned to pg_success_url or pg_failure_url, see Redirect back.
If the payment result is not received, get it with Get payment status.
Parameters without the pg_ prefix are passed back to pg_check_url and pg_result_url unchanged. Give them unique names that do not start with pg_.
Test cards: see Merchant API Overview.

Payment flow#

Result#

pg_statusMeaningNext step
okThe payment is created.Redirect the client to pg_redirect_url and wait for the result at pg_result_url.
errorThe request is rejected.See «Errors» below.

Errors#

The HTTP status is always 200; the error is returned in pg_error_code and pg_error_description. Error responses are not signed.
See Error codes.

Request example#

Required fields only. pg_sig is calculated with the secret key test_secret_key.
Line breaks in the body are added for readability: send the body as one line.

Request

Body Params multipart/form-data

Responses

🟢200Success
application/xml
Bodyapplication/xml

Examples
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>1023122203578</pg_payment_id>
    <pg_redirect_url>https://customer.freedompay.kz/any_amount?customer=01a169fc-e14c-72ad-be40-85c47b2d3bd6</pg_redirect_url>
    <pg_redirect_url_type>need data</pg_redirect_url_type>
    <pg_salt>Ew1MSJgyBSFKdLMr</pg_salt>
    <pg_sig>45b24a599f962ed4fa6149d2611359ba</pg_sig>
</response>
🟢200Error
Previous
Create payment
Next
Create recurring payment