Freedom Pay
  1. Merchant API
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • 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. Merchant API

Redirect back

POST
https://api.freedompay.kz{{success_url}} or {{failure_url}}
After completing the payment in the online payment system, the buyer is redirected to the merchant page Success URL or Failure URL, depending on the result of the payment
Redirection occurs using the Success URL Method or Failure URL Method specified during payment initialization
If at GET request Success URL or Failure URL already contain parameters in query string, then additional parameters pg_order_id, pg_payment_id and custom variables of the merchant are appended to the end of query string. The merchant must ensure that the names of additional parameters do not match the names of existing parameters
The difference between Result URL and Success URL must be clearly understood
Result URL is called directly from the {{project}} server, while Success URL is called by the user's browser when {{project}} redirects the user back to the store site
It is wrong to use Success URL as the only way to find out about the completion of the payment, because the user may for various reasons (for example, when the connection is broken) not to reach the Success URL after the payment
The most reliable way to find out about the completion of the payment is to implement a Result URL, which {{project}} undertakes to call again every half an hour within 2 hours after the payment, if the first attempt for any reason failed

Request

Header Params
Content-Type
string 
optional
Example:
application/x-www-form-urlencoded
Body Params multipart/form-data
pg_order_id
string 
required
Order ID in the merchant system.
Example:
123456789
pg_payment_id
integer 
required
Internal payment identifier in the system {{project}}.
Example:
12345
Merchant parameters
string 
optional
All fields passed from the merchant's website that do not have the pg_
pg_salt
string 
required
Random string.
Example:
some random string
pg_sig
string 
required
Request signature.
pg_error_code
string 
optional
Error code. In case of error
Example:
1000
pg_error_description
string 
optional
Description of the error. In case of error
Example:
Internal service error

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 -g --request POST '{{success_url}} or {{failure_url}}' \
--form 'pg_order_id="123456789"' \
--form 'pg_payment_id="12345"' \
--form 'Merchant parameters="";type=* All fields passed from the merchant's website that do not have the pg_ prefix.' \
--form 'pg_salt="some random string"' \
--form 'pg_sig=""' \
--form 'pg_error_code="1000"' \
--form 'pg_error_description="Internal service error"'

Responses

🟢200Success
text/html
Body
object {0}
Previous
Live payments
Next
Result notify