1. Mobile balance
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
    • Mobile balance
      • Overview
      • Create mobile balance payment
        POST
      • Charge mobile balance
        POST
      • Confirm payment with SMS code
        POST
      • Resend SMS code
        POST
      • Get mobile balance payment status
        POST
    • Invoice
      • 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
        • 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
        • Get application status
        • Application status notification
        • Change application status
      • Get partners
      • Create application
    • Saved cards
      • Get saved cards
      • Save card
      • Save card for payouts
      • Delete saved card
      • Save card without a charge
    • 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. Mobile balance

Charge mobile balance

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/mfs/pay
Charges the payment from the client's mobile balance.
Only for your own interface: the client enters the phone number and the SMS code on your page. With the Freedom Pay payment page this method is not needed: see Mobile balance.
Payments from the mobile balance must be enabled for the merchant: contact your account manager.
First create the payment with Create mobile balance payment and pass its pg_payment_id.
The mobile operator is detected by pg_abonent_phone.
If the operator sends the client an SMS code, pg_status = need_approve is returned: pass the code to Confirm payment with SMS code.
Call Pay once per payment: a repeated call fails the payment. To send the SMS code again, use Resend SMS code.
Responses are not signed: they contain no pg_salt and pg_sig.

Payment flow: own interface#

The code can be sent again with Resend SMS code.
The final result of the payment: Get payment status.

Result#

pg_statusMeaningNext step
okThe amount is charged from the mobile balance.—
need_approveThe client received an SMS code.Ask the client for the code and call Confirm payment with SMS code.
errorThe request is rejected or the payment failed.See «Errors» below.

Errors#

The HTTP status is always 200; the error is returned in pg_error_code and pg_error_description.
pg_error_codeWhenWhat to do
94031A parameter is missing or invalid, or pg_payment_id is not found.Fix the request.
9998The signature is missing or invalid.Check the signature: see Merchant API Overview.
9997pg_merchant_id is not found.Check the merchant ID.
1000The mobile operator of pg_abonent_phone is not detected, or an internal error occurred. The payment is not failed.Check the phone number and repeat the request.
9001The payment is already paid. pg_error_description is empty.Do not repeat the request: get the result with Get mobile balance payment status.
Other codesThe mobile operator declined the payment, or the charge was requested again for the same payment. The payment is failed.Create a new payment. See Error codes.

Request example#

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/xml
Bodyapplication/xml

Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>1234567890</pg_payment_id>
    <pg_status>need_approve</pg_status>
</response>
🟢200Error
Previous
Create mobile balance payment
Next
Confirm payment with SMS code