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

Redirect back

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
{{success_url}} or {{failure_url}}
After the payment the browser of the client returns to your site: to pg_success_url after a successful payment, to pg_failure_url after a failed one.
URL: from the payment request, or from the merchant settings.
This is a redirect of the browser, not a notification: the client may close the page and never return. Give out the order only by Result notify.
Common rules for all callbacks: see Callbacks Overview.

Return to the site flow#

The notification to pg_result_url and the return of the client are independent: either can come first.

Parameters by payment page#

PageParameters
Payment page (Create payment)pg_order_id, pg_payment_id, pg_salt, pg_sig: after a successful and after a failed payment.
Payment page with a template (pg_template)No parameters: identify the order by your URL, for example https://merchant.example.com/order/1001/success.
Payment frame (Create payment in a payment frame)After a success: pg_order_id, pg_payment_id, pg_salt, pg_sig. After a failure: pg_order_id, pg_failure_code, pg_failure_description and your parameters without the pg_ prefix, without a signature.
Method: pg_success_url_method / pg_failure_url_method of the payment request, or the method from the merchant settings, GET by default.
The parameters of the query string of your URL are kept and take part in the signature.
The URL may have other parameters: ignore the ones you do not know.

Result#

What the client opensMeaningNext step
pg_success_urlThe payment is successful.Show the order with the status that you know from Result notify. If the notification has not come yet, show «payment is being processed» and request Get payment status.
pg_failure_urlThe payment failed.Show the order and offer to pay again with a new payment.

Request example#

Return after a successful payment (pg_success_url = https://merchant.example.com/payment/success):
GET https://merchant.example.com/payment/success?pg_order_id=order-1001&pg_payment_id=1022123804618&pg_salt=m8Tz2Qw5Lx1Rk7Vb&pg_sig=d905ad1f9466fff09015ccc3530b27d9

Request

Header Params

Body Params application/x-www-form-urlencoded

Responses

🟢200Order page
text/html
Example
<!DOCTYPE html>
<html>
<body>Order 1001 is paid.</body>
</html>
Previous
Payout notify
Next
Overview