Payouts

This section describes the mechanics when FreedomPay pays money to the user's bank card

Attention!

Payments will be available for the store only after the permission of the personal manager and the application of the appropriate settings on the FreedomPay side

Payments cannot be test. Testing is carried out only by paying a certain amount to a real card
Payment page

This method generates a page where the recipient enters the pan of their card. Then FreedomPay makes a payout to this card

Payout to unsaved card

To use these requests, you should contact your manager.

For payment as secret_key is used
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};
$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_amount' => 10,
    'pg_order_id'=> 1234,
    'pg_description' => 'Payment description',
    'pg_post_link' => 'http://site.kz/post',
    'pg_back_link' => 'http://site.kz/back',
    'pg_order_time_limit' => '2020-12-31 12:00:00',
    'pg_salt' => 'some random string',
];
//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'reg2nonreg');
array_push($request, $secret_key);
$request['pg_sig'] = md5(implode(';', $request)); // signature
unset($request[0], $request[1]);


If the response is successful, the user should be redirected to the URL specified in the pg_redirect_url parameter. A page will be displayed for entering card data on which you need to make a payment

Request URL

POST https://api.freedompay.uz/api/reg2nonreg

Headers

Request fields
Response parameters
Post link request for merchant

In case of successful payment, the URL specified in pg_post_link will be called

Merchant server should respond with status 200

Post link on the merchant side must be public, without authorization.

Request URL

POST {{post_link}}

Headers


Request fields
Get payment status by order_id

Partial - Payment created
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567617;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>4567617</pg_payment_id>
    <pg_transaction_status>partial</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_testing_mode>1</pg_testing_mode>
    <pg_captured>0</pg_captured>
    <pg_create_date>2020-05-21 18:44:21</pg_create_date>
    <pg_salt>u1aHmP4QyTxUqzXz</pg_salt>
    <pg_sig>574a9d2e4783cb3d5ea443e1cc4f9434</pg_sig>
</response>

Ok - Payment successful
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Pending - Payment in progress
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Failed - Payment failed
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511180</pg_payment_id>
    <pg_transaction_status>failed</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>0</pg_captured>
    <pg_create_date>2021-08-26 11:53:12</pg_create_date>
    <pg_failure_code>5</pg_failure_code>
    <pg_failure_description>Transaction declined</pg_failure_description>
    <pg_salt>VeJEycvwsTn74VEA</pg_salt>
    <pg_sig>aa65c7786f5cba0cd9e6a452bfbcc7a2</pg_sig>
</response>

Failed - Payment not found
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>error</pg_status>
    <pg_error_code>340</pg_error_code>
    <pg_error_description>Transaction not found</pg_error_description>
</response>

The merchant can request the FreedomPay status of any payment initiated by the merchant. This can be useful, for example, if the Post link call was not received by the merchant due to a temporary connection failure, and the buyer has already been transferred to the Back URL, but the status of the transaction is not yet known to the merchant.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_order_id' => 12345,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'get_status2.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/get_status2.php

Request fields

Response parameters
Get payment status by pg_payment_id

Request URL

POST https://api.freedompay.uz/api/payment_status

Request fields

Response parameters
Response parameters for a successful request:

Get payment status by pg_payment_id v2

Request URL

POST https://api.freedompay.uz/api/payment_status2

Request fields


Response parameters
Response parameters for a successful request:

Token payout

For this method to work, the merchant must first save the user's card (see the "Saving cards" section).

After the merchant makes a payment to this card using this method

Payout to saved card
To use these requests, you should contact your manager.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};
$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_amount' => 10,
    'pg_order_id'=> 1234,
    'pg_user_id' => 1234,
    'pg_card_id_to' => 1234,
    'pg_card_token_to' => 'c92741d9-ddd7-4bad-abd0-5594a79eea1a',
    'pg_description' => 'Payment description',
    'pg_post_link' => 'http://site.kz/post',
    'pg_back_link' => 'http://site.kz/back',
    'pg_order_time_limit' => '2020-12-31 12:00:00',
    'pg_salt' => 'some random string',
];
//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'reg2reg');
array_push($request, $secret_key);
$request['pg_sig'] = md5(implode(';', $request)); // signature
unset($request[0], $request[1]);


Request URL

POST https://api.freedompay.uz/api/reg2reg

Request fields
Response parameters
Post link request for merchant

In case of successful payment, the URL specified in pg_post_link will be called
Merchant server should respond with status 200

Post link on the merchant side must be public, without authorization.

Request URL

POST {{post_link}}

Headers

Request fields
Get payment status by order_id

Partial - Payment created
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567617;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>4567617</pg_payment_id>
    <pg_transaction_status>partial</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_testing_mode>1</pg_testing_mode>
    <pg_captured>0</pg_captured>
    <pg_create_date>2020-05-21 18:44:21</pg_create_date>
    <pg_salt>u1aHmP4QyTxUqzXz</pg_salt>
    <pg_sig>574a9d2e4783cb3d5ea443e1cc4f9434</pg_sig>
</response>

Ok - Payment successful
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Pending - Payment in progress
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Failed - Payment failed
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511180</pg_payment_id>
    <pg_transaction_status>failed</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>0</pg_captured>
    <pg_create_date>2021-08-26 11:53:12</pg_create_date>
    <pg_failure_code>5</pg_failure_code>
    <pg_failure_description>Transaction declined</pg_failure_description>
    <pg_salt>VeJEycvwsTn74VEA</pg_salt>
    <pg_sig>aa65c7786f5cba0cd9e6a452bfbcc7a2</pg_sig>
</response>

Failed - Payment not found
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>error</pg_status>
    <pg_error_code>340</pg_error_code>
    <pg_error_description>Transaction not found</pg_error_description>
</response>

The merchant can request the FreedomPay status of any payment initiated by the merchant. This can be useful, for example, if the Post link call was not received by the merchant due to a temporary connection failure, and the buyer has already been transferred to the Back URL, but the status of the transaction is not yet known to the merchant.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_order_id' => 12345,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'get_status2.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/get_status2.php

Request fields

Response parameters
Get payment status by pg_payment_id

Request URL

POST https://api.freedompay.uz/api/payment_status

Request fields
Response parameters
Response parameters for a successful request:

Get payment status by pg_payment_id v2

Request URL

POST https://api.freedompay.uz/api/payment_status2

Request fields
Response parameters
Response parameters for a successful request:

To a bank account (IBAN)

Payout to bank account KZT

To use these requests, you should contact your manager.

Request URL

POST https://api.freedompay.uz/api/to_iban

Request fields
Response parameters
Post link request for merchant

Reply to post_link from merchant

<?xml version="1.0" encoding="UTF-8"?>
<pg_status>ok</pg_status>

Merchant server should respond with status 200

Post link on the merchant side must be public, without authorization.

Request URL

POST {{post_link}}

Headers
Request fields
Get payment status

Ok - Payment successful
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Pending - Payment in progress
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511194</pg_payment_id>
    <pg_transaction_status>ok</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>1</pg_captured>
    <pg_create_date>2021-08-26 11:52:25</pg_create_date>
    <pg_salt>41F5ZyqcOabTG5u7</pg_salt>
    <pg_sig>34484775bd62986753429d6af57e94eb</pg_sig>
</response>

Failed - Payment failed
Request

curl --location --request POST 'https://api.freedompay.uz/get_status2.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_order_id=00102' \
--form 'pg_salt=ijoi894j4ik39lo9' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status2.php;{{paybox_merchant_id}};4567775;00102;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>511180</pg_payment_id>
    <pg_transaction_status>failed</pg_transaction_status>
    <pg_can_reject>0</pg_can_reject>
    <pg_captured>0</pg_captured>
    <pg_create_date>2021-08-26 11:53:12</pg_create_date>
    <pg_failure_code>5</pg_failure_code>
    <pg_failure_description>Transaction declined</pg_failure_description>
    <pg_salt>VeJEycvwsTn74VEA</pg_salt>
    <pg_sig>aa65c7786f5cba0cd9e6a452bfbcc7a2</pg_sig>
</response>

The merchant can request the FreedomPay status of any payment initiated by the merchant. This can be useful, for example, if the Post link call was not received by the merchant due to a temporary connection failure, and the buyer has already been transferred to the Back URL, but the status of the transaction is not yet known to the merchant.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_order_id' => 12345,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'get_status2.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/get_status2.php

Request fields
Response parameters

To ATM

This method makes a special request, after which two SMS with passwords will be sent to the user's phone number.
To withdraw cash from an ATM, the user must enter the specified passwords, as well as the amount that he intends to withdraw.
The user has 24 hours to withdraw cash from an ATM, otherwise the operation will fail, after which the amount specified for withdrawal will return to the merchant's balance in the FreedomPay system.
The method does not contain any callbacks. Merchant should poll FreedomPay himself about the status of the operation. The recommended payment mechanics will be described below.
The first check of the transaction status (whether the user has withdrawn the amount from the ATM or not) will occur three hours later, after the payment is initiated. If the amount is not withdrawn from the ATM, the second attempt will happen another three hours later, this repeating process will occurs within 24 hours after the payment is initiated (total FreedomPay will be request status 8 times).

Based on the above, the merchant should not conduct a status poll no more than once every three hours.

Request for payment generation

Example of a successful request

Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/check' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_phone=7073175200' \
--form 'pg_amount=2000' \
--form 'pg_order_id=00102' \
--form 'pg_post_link=http://site.kz/post' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'check;2000;{{paybox_merchant_id}};00102;7073175200;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <pg_payment_id>765432</pg_payment_id>
    <pg_merchant_id>500001</pg_merchant_id>
    <pg_order_id>1234</pg_order_id>
    <pg_status>ok</pg_status>
    <pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
    <pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Example of unsuccessful request
Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/check' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_phone=7073175200' \
--form 'pg_amount=2000' \
--form 'pg_order_id=00102' \
--form 'pg_post_link=http://site.kz/post' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'check;2000;{{paybox_merchant_id}};00102;7073175200;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <pg_status>error</pg_status>
    <pg_error_code>101</pg_error_code>
    <pg_error_description>Empty merchant</pg_error_description>
    <pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
    <pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
'pg_merchant_id' => $pg_merchant_id,
'pg_phone' => '7073175200',
'pg_amount' => '2000',
'pg_order_id' => '00102',
'pg_post_link' => 'http://site.kz/post',
'pg_salt' => 'some random string'
];


//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'check');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/api/cbc/check

Request fields
Response parameters
Withdraw request

Example of a successful request
Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/exec' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=486456456' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'exec;{{paybox_merchant_id}};486456456;some random string;{{secret_key}}'


ОтвReplyет

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <pg_payment_id>765432</pg_payment_id>
    <pg_merchant_id>500001</pg_merchant_id>
    <pg_status>ok</pg_status>
    <pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
    <pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Example of unsuccessful request
Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/exec' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=486456456' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'exec;{{paybox_merchant_id}};486456456;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?>
<response>
<pg_status>error</pg_status>
<pg_error_code>101</pg_error_code>
<pg_error_description>Empty merchant</pg_error_description>
<pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
<pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
'pg_merchant_id' => $pg_merchant_id,
'pg_phone' => '7073175200',
'pg_amount' => '2000',
'pg_order_id' => '00102',
'pg_salt' => 'some random string'
];


//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'exec');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/api/cbc/exec

Request fields
Response parameters
Request for the status of the operation

Example of a successful request


Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/status' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=486456456' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'status;{{paybox_merchant_id}};486456456;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?> <response>
<pg_payment_id>765432</pg_payment_id>
<pg_merchant_id>500001</pg_merchant_id>
<pg_order_id>1234</pg_order_id>
<pg_status>success</pg_status>
<pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
<pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Indefinite query example
Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/status' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=486456456' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'status;{{paybox_merchant_id}};486456456;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?> <response>
<pg_payment_id>765432</pg_payment_id>
<pg_merchant_id>500001</pg_merchant_id>
<pg_order_id>1234</pg_order_id>
<pg_status>process</pg_status>
<pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
<pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Example of unsuccessful request
Request

curl --location --request POST 'https://api.freedompay.uz/api/cbc/status' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=486456456' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'status;{{paybox_merchant_id}};486456456;some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?>
<response>
<pg_status>error</pg_status>
<pg_error_code>75</pg_error_code>
 <pg_error_description> Transfer execution time expired, recipient did not withdraw money</pg_error_description>
 <pg_salt>yNSdZrM1pIA4NjRU5Csdm0L3NC92PZpo</pg_salt>
 <pg_sig>6304300d2a1d5d35cfbdc37ae8490c81</pg_sig>
</response>

Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
'pg_merchant_id' => $pg_merchant_id,
'pg_phone' => '7073175200',
'pg_amount' => '2000',
'pg_order_id' => '00102',
'pg_salt' => 'some random string'
];


//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'exec');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.uz/api/cbc/status

Request fields
Response parameters
Get balance

Example of a successful request
Request

curl --location --request POST 'https://api.freedompay.uz/api/balance_status' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'balance_status;{{paybox_merchant_id}};some random string;{{secret_key}}'


Reply

<?xml version="1.0" encoding="UTF-8"?>
<response>
 <pg_balance>0.00</pg_balance>
 <pg_status>ok</pg_status>
 <pg_salt>osWRT1FtWr</pg_salt>
 <pg_sig>9087fd0c7a26334f53f83f0bd61e6b80</pg_sig>
</response>

Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};
$request = [
    'pg_merchant_id' => $pg_merchant_id,
    'pg_salt' => 'some random string'
];
//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'balance_status');
array_push($request, $secret_key);
$request['pg_sig'] = md5(implode(';', $request)); // signature
unset($request[0], $request[1]);


Request URL

POST https://api.freedompay.uz/api/balance_status

Request fields
Response parameters
To mobile balance

FreedomPay offers the possibility to make payment to the mobile phone balance, if the payer's mobile operator supports this possibility tenderness. Available mobile operators:

Tele2
Altel

Payment initialization

Payment initialization
Request

curl --location --request POST 'https://api.freedompay.uz/init_payout.php' \
--form 'pg_order_id=23' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_amount=25' \
--form 'pg_description=test' \
--form 'pg_salt=molbulak' \
--form 'pg_sig={{paybox_signature}}' \
--form 'pg_order_time_limit=2020-12-31 12:00:00',
# Sign example:
'init_payout.php;25;test;{{paybox_merchant_id}};23;2020-12-31 12:00:00;molbulak;{{secret_key}}'


Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>4567788</pg_payment_id>
    <pg_merchant>{{paybox_merchant_id}}</pg_merchant>
    <pg_order_id>23</pg_order_id>
    <pg_salt>bdwLavL9lg6It91b</pg_salt>
    <pg_sig>709633e91387c56ac6fb7cb33d1e07d8</pg_sig>
</response>

If pg_status is equal to ok in the response, the merchant needs to send a request to continue the payment.

Request URL

POST https://api.freedompay.uz/mfs/payout

Request fields
Response parameters