1. Saved cards
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
          POST
        • Save card: complete 3DS
          POST
        • List saved cards
          POST
        • Remove saved card
          POST
        • Pay by card token
          POST
        • Pay out to card token
          POST
        • Get payment status
          POST
    • 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
      • Any amount
      • Reccuring payment
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • 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. Saved cards

Pay by card token

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/g2g/payment
Creates a payment with a saved card by its token and returns the result in the same response.
The token is returned by Pay by card with pg_save_card = 1: pass it in pg_card_token together with the same pg_user_id.
If the card requires 3DS authentication, the response contains pg_3d_acsurl: redirect the client to it; the payment is completed with Pay by card: complete 3DS.
Uniqueness can be enabled for the merchant: then a repeated request with the same pg_order_id is rejected with an error.

Result#

pg_statuspg_3dsMeaningNext step
ok0The payment is authorized.One-step payment: nothing else is needed. Two-step payment (pg_auto_clearing = 0): capture the amount with clearing or release it with cancel.
ok13DS authentication is required.Redirect the client to pg_3d_acsurl and complete the payment with Pay by card: complete 3DS: see «3DS authentication» in Pay by card.
pending—The payment system has not returned the result yet.Request the status with status_v2 until it is final.
error—The request is rejected or the payment is declined.See «Errors» below.

Payment flow#

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 has an invalid value, for example pg_card_token is not found or pg_card_cvc is not passed.Fix the request.
1201pg_user_id is not passed or differs from the user the card was saved for.Pass the pg_user_id the card was saved for.
11005pg_amount is not a number, is less than 0.01 or more than 99999999.Fix the amount.
1380The amount is too small: the commission is greater than the amount. The payment is created with the error status, pg_payment_id is returned.Increase the amount or contact Freedom Pay.
1100The signature is missing or invalid.Check the signature: see Sync API Overview.
1101pg_merchant_id is not found. The response is not signed.Check the merchant ID.
99081A payment with this pg_order_id already exists: uniqueness of the order ID is enabled for the merchant.Pass a new pg_order_id.
10000The payment could not be performed.Repeat the request later.
Other codesThe payment is declined by the issuer or the payment system. pg_payment_id is returned.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/xml
Bodyapplication/xml

Examples
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>1020101501496</pg_payment_id>
    <pg_status>ok</pg_status>
    <pg_3ds>0</pg_3ds>
    <pg_secure_details>F</pg_secure_details>
    <pg_card_id>138</pg_card_id>
    <pg_card_token>1b1654e2-461a-41aa-9ece-57906fc9b686</pg_card_token>
    <pg_auth_code>100689</pg_auth_code>
    <pg_reference>261020115735</pg_reference>
    <pg_datetime>2026-10-20T11:57:36+00:00</pg_datetime>
    <pg_salt>6QFIRWo0ZvGU4yHK</pg_salt>
    <pg_sig>658c3d222ec598ca37746bc2634d9314</pg_sig>
</response>
🟢200Error
Previous
Remove saved card
Next
Pay out to card token