1. Purchase
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
      • Payout
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfer
        • 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
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
        • Cancel payment (reverse)
        • Refund payment
  • 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
        POST
      • Create payment with any amount
        POST
      • Create recurring payment
        POST
      • Cancel payment
        POST
      • Capture payment (clearing)
        POST
      • Refund payment
        POST
      • Get payment status
        POST
      • Create payment with a payment page template
        POST
      • Create payment in a payment frame
        POST
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Recurring profile
        • Overview
        • Create
        • Cancel
        • Info
        • Notify
      • Tips
        • Overview
        • Create
      • Create
      • Execute
      • Info
      • Refund
      • Status
      • Cancel
    • SDK
      • JS SDK
      • Merchant SDK
        • Google Pay
        • Android
        • IOS
    • 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
    • Installment
      • Overview
      • Status
        • Application Status
        • Application Callback Status
        • Application Change Status
      • Get partners
      • Create application
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Partner API
    • 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. Purchase

Create recurring payment

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/make_recurring_payment
Charges the client's card saved in a recurring profile, without the client.
The profile is created by the first payment: pass pg_recurring_start = 1 and pg_recurring_lifetime in Create payment. Recurring payments are available after Freedom Pay enables them for the merchant: contact your account manager.
The amount can be different every time. The currency and the payment method are taken from the first payment.
Every request creates a new payment. If the response is lost, check the payment with Get payment status by pg_order_id before repeating the request.
The payment result is also sent to pg_result_url.
If the payment is declined, the response contains only the error: the declined payment is not returned in it.
Test cards: see Merchant API Overview.

Recurring payment flow#

Result#

pg_statusMeaningNext step
okThe payment is successful.To return the money, call Refund payment.
errorThe request is rejected or the payment is declined.See «Errors» below.

Errors#

The HTTP status is always 200; the error is returned in pg_error_code and pg_error_description. Error responses are not signed.
pg_error_codeWhenWhat to do
94031A parameter is missing or invalid, or a recurring profile with this ID does not exist.Fix the request.
11005pg_amount is missing, is not a number, is less than 0.01 or more than 99999999.Fix the amount.
1100The signature is missing or invalid.Check the signature: see Merchant API Overview.
340The recurring profile belongs to another merchant.Check pg_recurring_profile and pg_merchant_id.
10000The recurring profile has expired, or a temporary error occurred.If pg_recurring_profile_expiry_date has passed, create a new profile with the next payment through Create payment. Otherwise repeat the request later.
91011The first payment of the profile is refunded in full.Create a new profile with the next payment through Create payment.
Other codesThe payment system declined the payment.See Error codes.

Request example#

Required fields only. pg_sig is calculated with the secret key test_secret_key.
Line breaks in the body are added for readability: send the body as one line.

Request

Body Params multipart/form-data

Responses

🟢200Success
application/json
Upon success, the user is redirected to the payment page.
If parameters are missing (system, phone, etc.), the system requests them from the user.
Bodyapplication/json

Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>1023122203674</pg_payment_id>
    <pg_amount>50</pg_amount>
    <pg_currency>KZT</pg_currency>
    <pg_recurring_profile>58</pg_recurring_profile>
    <pg_recurring_profile_expiry_date>2027-10-23 00:00:00</pg_recurring_profile_expiry_date>
    <pg_salt>FgdkQAjIzET88Kt1</pg_salt>
    <pg_sig>333e0a6182010aa7cae9b0a431191047</pg_sig>
</response>
🟢200Error
Previous
Create payment with any amount
Next
Cancel payment