Installment
Activation of the credit/installment service for merchants
Initialize
You initialize a payment page that displays the installment/loan products available to you by sending a request to installment/init

Initialization of installments

Request URL

POST https://api.freedompay.kz/v1/merchant/{{paybox_merchant_id}}/installment/init

Request fields
TitleDescriptionType
pg_merchant_id

required

Merchant ID
Numbers
integer
pg_order_id

required

Order ID in the shop system. A unique, monotonically increasing value is recommended

Example: 00102

string
pg_amount

required

Installment/loan amount.
Minimum 0.01

Example: 10000

number
pg_description

required

ОPayment description. Displayed to the buyer during the payment process.string
pg_salt

required

Random string
Random numbers and Latin letters

Example: some random string

string
pg_sig

required

Digital signature of the requeststring
Response parameters
TitleDescriptionType
pg_payment_idThe unique identifier of the payment transaction in FreedomPay, which serves as the key for all further work with the transactioninteger
pg_merchant_idMerchant IDstring
pg_order_idOrder ID in the shop system.string
pg_amountInstallment/loan amountnumber
pg_redirect_urlThe URL to which you want to redirect (redirect)string
pg_typeTransaction typestring
pg_saltRandom stringstring
pg_sigDigital signature of the requeststring
Example:
Request
curl --location --request POST 'https://api.freedompay.kz/v1/merchant/{{paybox_merchant_id}}/installment/init' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=12345' \
--form 'pg_amount=10000' \
--form 'pg_description=test' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'init;10000;test;{{paybox_merchant_id}};12345;some random string;{{secret_key}}'
Response
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>831338051</pg_payment_id>
    <pg_merchant_id>545084</pg_merchant_id>
    <pg_order_id>00004</pg_order_id>
    <pg_amount>10000</pg_amount>
    <pg_redirect_url>https://customer.freedompay.kz/pay.html?customer=your_customer_value</pg_redirect_url>
    <pg_status>ok</pg_status>
    <pg_type>init</pg_type>
    <pg_salt>salt</pg_salt>
    <pg_sig>sig</pg_sig>
</response>
Request status

Request URL

POST https://api.freedompay.kz/get_status3.php

Request fields
NameDescriptionType
pg_merchant_id

required

Merchant ID in FreedomPay. Issued upon connection.integer
pg_payment_id

required if empty pg_order_id

Internal payment identifier in the system FreedomPay if sent along with the pg_order_id field, the pg_order_id field will be ignored.

Example: 12345

integer
pg_order_id

required if empty pg_payment_id

Payment ID in the merchant system. Be careful, when requesting by order_id, the merchant must independently monitor the uniqueness of this parameter, otherwise information will be returned for the last payment with the given order_id for this merchant.

Example: 00102

string
pg_salt

required

Random string

Example: some random string

string
pg_sig

required

Request signaturestring
Response parameters
TitleDescriptionType
pg_statusShows the result of the query
Status Description
ok Request was successful
error Request was successful
string
pg_payment_idUnique identifier of the payment transaction in FreedomPay Serves as a key for all further work with the transactioninteger
pg_can_reject0 or 1 - whether the payment can be cancelled. The value 1 is possible only if the payment status is ok and the payment system provides the possibility to cancel the payment. In this case, the merchant can call revoke.php.bool
pg_payment_methodValue - Payment method
mobile_commerce - Mobile commerce

Example: mobile_commerce

string
pg_order_idOrder ID in the shop systemstring
pg_currencyThe currency in which the amount is specified.string
pg_payment_statusPayment statusstring
pg_amountPayment amountinteger
pg_clearing_amountAmount written off during payment clearinginteger
pg_revoke_amountRevoked amountinteger
pg_user_emailCustomer's emailstring
pg_card_nameCardholder namestring
pg_user_phoneCustomer's phonestring
pg_payment_dateDate and time of the payment in YYYY-MM-DD HH:MM:SS formatdatetime
pg_revoked_paymentsList of revokes for this paymentarray
pg_refund_paymentsList of refunds for this paymentarray
pg_referenceA unique bank transaction identifier assigned by the bank (RRN)integer
pg_failure_codeError codeinteger
pg_failure_descriptionDescription of the errorstring
pg_capturedEnum:0 1.
Transmitted only in case of successful payment with a bank card and indicates whether clearing was performed at the time of authorization (which depends only on the merchant settings). If the value of this field is equal to 0, the merchant must subsequently issue a clearing command or wait for FreedomPay to do it himself
bool
pg_auth_codeBank payment authorization codeinteger
pg_saltRandom stringstring
pg_sigRequest signaturestring
Array for pg_revoked_payments/pg_refund_payments
TitleDescriptionType
pg_payment_idUnique identifier of the payment transaction in FreedomPayinteger
pg_payment_statusPayment statusstring
pg_amountPayment amountinteger
pg_payment_dateDate and time of the payment in YYYY-MM-DD HH:MM:SS formatdatetime
pg_referenceA unique bank transaction identifier assigned by the bank (RRN)integer