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

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

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
Modified at 2025-04-18 03:54:55
Previous
Redirect back
Next
Payout notify