1. Callbacks
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
      • Payouts
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfers
        • 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
        • Save card without a charge
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
        • Cancel payment (reverse)
        • Refund payment
  • Merchant API
    • Overview
    • Payments
      • Overview
      • Checkout
      • Pay by saved card
        • Overview
        • Create payment
        • Confirm payment with CVC
        • Confirm payment without the client
      • Create payment
      • Create payment with a payment page template
      • Create payment in a payment frame
      • Create payment with any amount
      • Create recurring payment
      • Capture payment (clearing)
      • Cancel payment
      • Refund payment
      • Get payment status
    • Payouts
      • Overview
      • Create payout page
      • Pay out to saved card
      • Pay out to IBAN
      • Get payout status
      • Get payout balance
    • Saved cards
      • Get saved cards
      • Save card
      • Save card for payouts
      • Delete saved card
      • Save card without a charge
    • Mobile balance
      • Overview
      • Create mobile balance payment
      • Charge mobile balance
      • Get mobile balance payment status
      • Confirm payment with SMS code
      • Resend SMS code
    • Invoices
      • Overview
      • Recurring payments
        • Overview
        • Create recurring profile
        • Get recurring profile
        • Charge by recurring profile
        • Cancel recurring profile
        • Recurring profile notification
      • Tips
        • Overview
        • Create
      • Create invoice
      • Get invoice status
      • Get invoice details
      • Cancel invoice
      • Refund invoice
    • SDK
      • JS SDK
      • Merchant SDK
        • Android
        • iOS
        • Migration guide
    • 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
      • CS-Cart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Installment
      • Overview
      • Status
        • Get application status
        • Application status notification
        • Change application status
      • Get partners
      • Create application
    • Callbacks
      • Overview
      • Result notify
        POST
      • Check request
        POST
      • Payout notify
        POST
      • Redirect back
        POST
  • Partner API
    • Overview
    • 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. Callbacks

Result notify

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
{{result_url}}
Freedom Pay sends the result of the payment to pg_result_url of the payment request, or to the Result URL from the merchant settings.
Sent once the payment is final: successful (pg_result = 1) or failed (pg_result = 0).
On the payment page with a template (pg_template) a declined card does not finish the payment: the client can try again. The notification comes after a successful attempt, or with pg_result = 0 when pg_lifetime expires.
Signed with the payment secret key: check the signature before you act on the notification.
Use this notification to give the client the goods or the service: the client may not return to pg_success_url.
Common rules for all callbacks (method, signature, delivery, retries): see Callbacks Overview.

Result notification flow#

The notification goes from the Freedom Pay server to your server: it does not depend on the browser of the client.

Result#

Answer with HTTP 200 and an XML or JSON body with pg_status:
pg_status in your answerMeaningNext step
okYou accepted the notification.Nothing else is needed.
rejectedYou refuse the successful payment, for example the order is already cancelled.If pg_can_reject = 1, Freedom Pay refunds the payment to the client; if the payment system declines the refund, the payment stays successful, so check the result with Get payment status. If pg_can_reject = 0, the answer is ignored: the payment stays successful.
Any answer with HTTP 2xx means that the notification is delivered: a body without pg_status = rejected is not processed.
No answer within 30 seconds or an HTTP code other than 2xx: Freedom Pay repeats the notification after 15 minutes, then twice more every 30 minutes (4 attempts in total).
The same notification can come more than once: process it by pg_payment_id only once.
If the notifications do not come, request the result with Get payment status.

Request example#

Successful payment, pg_result_url = https://merchant.example.com/payment/result.
One field per line for reading: in the POST body the fields are joined with & and the values are URL-encoded.
pg_order_id=order-1001
pg_payment_id=1022123804618
pg_amount=1000
pg_currency=KZT
pg_net_amount=970
pg_ps_amount=1000
pg_ps_full_amount=1000
pg_ps_currency=KZT
pg_description=Order 1001
pg_result=1
pg_payment_date=2026-11-01 12:30:15
pg_can_reject=1
pg_user_phone=77001234567
pg_need_phone_notification=0
pg_user_contact_email=client@example.com
pg_need_email_notification=0
pg_payment_method=bankcard
pg_reference=430512345678
pg_user_ip=192.0.2.10
pg_captured=1
pg_card_pan=4400-44XX-XXXX-4440
pg_card_exp=12/27
pg_card_owner=IVAN IVANOV
pg_card_brand=VI
pg_auth_code=123456
pg_salt=bR5xQ2mL8nT4vW1z
pg_sig=d3215040b6f972efd0946cb4f4efcebd
Failed payment:
pg_order_id=order-1002
pg_payment_id=1022123804619
pg_amount=1000
pg_currency=KZT
pg_net_amount=970
pg_ps_amount=1000
pg_ps_full_amount=1000
pg_ps_currency=KZT
pg_description=Order 1002
pg_result=0
pg_can_reject=0
pg_need_phone_notification=0
pg_need_email_notification=0
pg_payment_method=bankcard
pg_user_ip=192.0.2.10
pg_captured=0
pg_failure_code=99999
pg_failure_description=Неизвестная ошибка платежной системы
pg_salt=Kp3sW9dQ1xZ7mN2c
pg_sig=6264f93bdc6aca08be65ebe8b5a6141e

Request

Body Params application/x-www-form-urlencoded

Responses

🟢200Accepted
application/xml
Bodyapplication/xml

Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
</response>
🟢200Refund the payment
Previous
Overview
Next
Check request