1. Pay by saved card
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
      • Pay by saved card
        • Overview
        • Create payment
          POST
        • Confirm payment with CVC
          POST
        • Confirm payment without the client
          POST
      • Create payment
        POST
      • Create payment with a payment page template
        POST
      • Create payment in a payment frame
        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
    • Payout
      • Overview
      • Create payment
      • IBAN
      • Balance status
      • Create payment
      • 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
    • 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. Pay by saved card

Create payment

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/v1/merchant/{merchant_id}/card/init
Creates a payment by a saved card and returns its pg_payment_id. No money is charged at this step.
Then confirm the payment in one of two ways:
Confirm payment with CVC: the client is on your site and enters the CVC; 3DS is passed if required.
Confirm payment without the client: the card is charged without CVC and 3DS. Available after Freedom Pay enables it for the merchant.
The payment result is also sent to pg_result_url.
Cards are saved by Save card and Save card without a charge. See also Pay by saved card: Overview.

Payment flow#

Result#

ResponseMeaningNext step
pg_status = okThe payment is created.Confirm it with CVC or without the client.
pg_status = errorThe request is rejected.See «Errors» below.

Errors#

The error is returned in pg_error_code and pg_error_description; the HTTP status depends on the error. Error responses are not signed.
HTTPpg_error_codeWhenWhat to do
2000A parameter is missing or invalid: pg_error_description names it.Fix the request.
4011100The signature is missing or invalid.Check the signature: see Merchant API Overview.
4001804The card with this token is not saved for pg_user_id, or it is deleted.Check the card with Get saved cards.
40054The card has expired.Ask the client to save a new card.
4001808pg_success_url or pg_failure_url is not passed and not set in the merchant settings.Pass both URLs.

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

Path Params

Body Params multipart/form-data

Responses

🟢200Success
application/xml
Bodyapplication/xml

Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>1023122203684</pg_payment_id>
    <pg_merchant_id>13991</pg_merchant_id>
    <pg_order_id>ct-init_direct-1792783335</pg_order_id>
    <pg_status>ok</pg_status>
    <pg_salt>trWpoPaC</pg_salt>
    <pg_sig>d01dc403a7bf0673b42c99482c896b73</pg_sig>
</response>
🟢200Error
🟠400Bad Request
🟠401Unauthorized
Previous
Overview
Next
Confirm payment with CVC