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

Result notify

POST
https://api.freedompay.kz{{result_url}}
After receiving a payment from a client or if it is impossible to make a payment, {{project}} calls the Result URL of the store and sends information about the payment result to it using the Request Method method
Upon receipt of this request, the merchant must take the necessary actions to transfer the goods or services to the buyer, if the payment was successful. If pg_can_reject is equal to 1 and the merchant cannot accept the payment (for example, the ticket reservation has expired), it must respond with a rejected status, and {{project}} will reject the payment. In this case, the pg_description field from the merchant response is shown to the user as the reason for the refusal
Result URL on the merchant side must be public, without authorization.
If the merchant's server is not available at the time the Result URL is called, or if the response from the server was not 200, {{project}} will make repeated attempts to call it every half an hour for 2 hours, even if the pg_lifetime account expires
If the first attempt to call Result URL is unsuccessful, then the payment is not canceled, and in subsequent calls Result URL does not allow the merchant to refuse the payment
The store must be prepared for the Result URL to be called repeatedly for the same payment
Retry responses must match the original response, even if the pg_lifetime transaction has expired
Merchant response to result_url:
ok - payment accepted
rejected - payment refusal if pg_can_reject is equal to 1
error - error in data interpretation
The rejected status can be returned by the merchant only if the pg_can_reject parameter equal to 1 was specified in the incoming request from the gate, otherwise, regardless of the merchant's response, the payment will be considered completed
If the merchant refused the payment (rejected answered), the buyer is redirected to Failure URL, otherwise - to Success URL

Request

Body Params multipart/form-data
pg_order_id
string 
required
Order ID in the merchant system.
<= 50 characters
Example:
123456789
pg_payment_id
integer 
required
Internal payment identifier in the FreedomPay system.
Example:
12345
pg_amount
number 
required
Amount of invoice in pg_currency currency.
>= 0.01<= 99999999
Example:
500
pg_currency
string 
required
Currency of the invoice
<= 3 characters
Example:
KZT
pg_net_amount
number 
required
Amount of invoice (in pg_ps_currency)
>= 0.01<= 99999999
Example:
482.5
pg_ps_amount
number 
required
Total amount (in pg_ps_currency currency)
>= 0.01<= 99999999
Example:
500
pg_ps_full_amount
number 
required
Full amount (in pg_ps_currency currency)
>= 0.01<= 99999999
Example:
500
pg_ps_currency
string 
required
The currency in which the payment was made in the payment system. The field may be absent in case of unsuccessful payment.
<= 3 characters
Example:
KZT
pg_description
string 
required
Payment description.
Example:
Purchase in the online store Site.kz
pg_result
integer 
required
Payment result. 2 - Not completed. 1 - success, 0 - failure.
>= 0<= 2
Example:
1
pg_payment_date
string <date-time>
required
Date and time of the payment in YYYY-MM-DD HH:MM:SS format.
Example:
2019-01-01 12:00:00
pg_can_reject
integer 
required
Indicates if the payment can be rolled back: 1 – Payment can be rolled back
>= 0<= 1
Example:
1
pg_user_phone
string 
optional
Customer phone number (specified during payment initialization).
Example:
7077777777777
pg_user_contact_email
string <email>
optional
Customer's email (specified during payment initialization).
Example:
mail@customer.kz
pg_testing_mode
integer  | null 
required
Testing mode: 1 - Test
>= 0<= 1
Example:
1
pg_captured
integer 
optional
Indicates whether clearing was performed at the time of authorization for bank card payments.
>= 0<= 1
Example:
0
pg_card_id
string 
optional
Optional parameter: Card ID for paying with saved card (Deprecated).
Example:
1234
pg_card_token
string 
optional
Optional parameter: Card token for paying with saved card.
Example:
ef741cfc-f85e-41a0-84e6-2ba964912182
pg_card_pan
string 
optional
Masked card number (part of the digits of the card number are hidden).
Example:
5483-18XX-XXXX-0293
Merchant parameters
string 
optional
All fields passed from the merchant's website that do not have the pg_
pg_discount_percent
number 
optional
Discount percentage information (sent if there is a discount).
Example:
1.0
pg_discount_amount
number 
optional
Discount amount information (sent if there is a discount).
Example:
5
pg_payment_method
string 
optional
Payment method: wallet
Example:
bankcard
pg_card_exp
string 
optional
Card expiration date.
Example:
03/23
pg_card_owner
string 
optional
Cardholder name.
Example:
Ivan Ivanov
pg_card_brand
string 
optional
Card brand code.
Example:
VI
pg_salt
string 
required
Random string.
Example:
some random string
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 -g --request POST '{{result_url}}' \
--form 'pg_order_id="123456789"' \
--form 'pg_payment_id="12345"' \
--form 'pg_amount="500"' \
--form 'pg_currency="KZT"' \
--form 'pg_net_amount="482.5"' \
--form 'pg_ps_amount="500"' \
--form 'pg_ps_full_amount="500"' \
--form 'pg_ps_currency="KZT"' \
--form 'pg_description="Purchase in the online store Site.kz"' \
--form 'pg_result="1"' \
--form 'pg_payment_date="2019-01-01 12:00:00"' \
--form 'pg_can_reject="1"' \
--form 'pg_user_phone="7077777777777"' \
--form 'pg_user_contact_email="mail@customer.kz"' \
--form 'pg_testing_mode="1"' \
--form 'pg_captured="0"' \
--form 'pg_card_id="1234"' \
--form 'pg_card_token="ef741cfc-f85e-41a0-84e6-2ba964912182"' \
--form 'pg_card_pan="5483-18XX-XXXX-0293"' \
--form 'Merchant parameters="";type=* All fields passed from the merchant's website that do not have the pg_ prefix.' \
--form 'pg_discount_percent="1.0"' \
--form 'pg_discount_amount="5"' \
--form 'pg_payment_method="bankcard"' \
--form 'pg_card_exp="03/23"' \
--form 'pg_card_owner="Ivan Ivanov"' \
--form 'pg_card_brand="VI"' \
--form 'pg_salt="some random string"' \
--form 'pg_sig=""'

Responses

🟢200Success
application/xml
Body
pg_status
string 
optional
pg_description
string 
optional
pg_salt
string 
optional
pg_sig
string 
optional
Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_description>Order paid</pg_description>
    <pg_salt>random string</pg_salt>
    <pg_sig>ksdjrimzjedkljsujjemnjsuj</pg_sig>
</response>
🟢200Canceled
Previous
Redirect back
Next
Payout notify