Freedom Pay
  1. Purchase
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
          POST
        • Any amount
          POST
        • Card
          POST
        • 3DSecure
          POST
        • Cancel
          POST
        • Clearing
          POST
        • Refund
          POST
        • Status
          POST
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • 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
      • 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 by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
    • 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
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Payment Cards
      • Overview
      • Dictionaries
      • Bulk issue
      • Issue card
      • Issue plastic card
      • Activate card
      • Block card
      • Unblock card
      • Set PIN
      • Reset PIN counter
      • Close card
      • Update client
      • Card info
      • Balance
      • Secret data
      • Secret data (version 2)
      • Statement
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction request' status
      • Transaction info
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Overview
      • Design
      • iOS SDK
      • Android SDK
      • OAuth2
        • Authorization link
        • Token exchange
        • Token refresh
        • User info
        • Request profile
        • Get profile status
        • Create user
        • Update user
      • OIDC
        • Authorization endpoint
        • Token exchange
        • Userinfo
      • Error codes
      • Examples
        • Keycloak
    • Transfer
      • Overview
      • Get token
      • Refresh token
      • Get agents
      • Fees
      • Create person
      • Create business
      • Create transfer
      • Print application
      • Confirm
      • Search
      • Payout
      • Payout confirm
      • Cancel
      • Get person info
      • Get business info
      • Status
      • Info
    • Device ID
      • Android SDK
      • iOS SDK
  1. Purchase

Card

POST
https://api.freedompay.kz/g2g/payment
This method is used for processing payments using a card
At this stage, the payer provides card details to execute the transaction
The payment can follow two scenarios: with 3D Secure (3DS) or without it

Interaction diagram for non3ds payment#

Status: success/error/pending
error Payment non3DS.drawio.png

Interaction diagram for 3ds payment#

Status: success/error
error Payment  3DS.drawio.png
Status: pending
G2G_API_V3-pending Payment  3DS. case 2.drawio.png

Request

Body Params multipart/form-data
pg_merchant_id
number 
required
Merchant ID in {{project}}
Issued upon connection
pg_order_id
string 
required
Payment ID in the merchant system
It is recommended to keep this field unique
pg_amount
number 
required
Payment amount in pg_currency
>= 0.01
pg_currency
string 
optional
Currency in which the amount is specified
pg_description
string 
required
Payment description
(These parameters may include parameters from other sections. For the effective operation of SecureBox, it is recommended to follow the validation guidelines and field examples from this section)
pg_testing_mode
integer 
optional
Payment mode
0 - production, 1 - test. If the mode is not specified, then the mode set in the shop settings is taken
>= 0<= 1
pg_user_id
string 
optional
User ID in the merchant's system
(These parameters may include parameters from other sections. For the effective operation of SecureBox, it is recommended to follow the validation guidelines and field examples from this section)
Example:
No65GFR755789T
pg_user_email
string <email>
optional
Payer's email or email linked (specified during registration) to the personal account ID or wallet number of the payer.
(These parameters may include parameters from other sections. For the effective operation of SecureBox, it is recommended to follow the validation guidelines and field examples from this section)
Example:
example@site.com.
pg_user_phone
string 
optional
Payer's phone number or phone number linked (specified during registration) to the personal account ID or wallet number of the payer.
Digits without spaces, plus signs, or parentheses
(These parameters may include parameters from other sections. For the effective operation of SecureBox, it is recommended to follow the validation guidelines and field examples from this section)
pg_card_pan
string 
required
Card number
>= 13 characters<= 20 characters
pg_card_cvc
integer 
required
CVC/CVC2/CVV card password
pg_card_year
integer 
required
Card expiration year
pg_card_month
integer 
required
Card expiration month
pg_card_name
string 
required
Name and surname of card holders
Example:
John Doe
pg_auto_clearing
boolean 
optional
Clearing type (0 or 1)
1 - automatic write-off after successful authorization, 0 - write-off by launching the clearing method
pg_3ds_challenge
boolean 
optional
Determines the need to complete the Challenge Flow
(1 - it is mandatory to conduct the Challenge Requested, 0 or empty - the method is determined by the issuer) the issuing bank can ignore this parameter and make a payment according to its own Challenge Flow
pg_exchange_params
object 
optional
Exchange rate parameters passed when a fixed rate needs to be used
rate
string 
optional
The exchange rate provided by the merchant. Payments will be converted using this exact rate.
rates_code
string 
optional
Unique currency rate source identifier. Contact your account manager to obtain this code.
ex_date
string 
optional
Historical date for applying the exchange rate. If empty, current date applies.
pg_param1
string 
optional
Additional parameter 1
pg_param2
string 
optional
Additional parameter 2
pg_param3
string 
optional
Additional parameter 3
pg_salt
string 
required
Random string consisting of arbitrary numbers and Latin letters
pg_sig
string 
required
Request signature

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.freedompay.kz/g2g/payment' \
--form 'pg_merchant_id=""' \
--form 'pg_order_id=""' \
--form 'pg_amount=""' \
--form 'pg_currency=""' \
--form 'pg_description=""' \
--form 'pg_testing_mode=""' \
--form 'pg_user_id=""' \
--form 'pg_user_email=""' \
--form 'pg_user_phone=""' \
--form 'pg_card_pan=""' \
--form 'pg_card_cvc=""' \
--form 'pg_card_year=""' \
--form 'pg_card_month=""' \
--form 'pg_card_name="John Doe"' \
--form 'pg_auto_clearing=""' \
--form 'pg_3ds_challenge=""' \
--form 'pg_exchange_params=""' \
--form 'pg_param1=""' \
--form 'pg_param2=""' \
--form 'pg_param3=""' \
--form 'pg_salt=""' \
--form 'pg_sig=""'

Responses

🟢200Success
application/xml
Body
pg_payment_id
string 
required
Transaction ID
pg_status
string 
required
Request status
pg_3ds
boolean 
required
Flag indicating the need for a 3DS request.
1 – 3DS is required, 0 - not required
pg_3d_md
string 
optional
Card Issuer Bank Url for 3ds Validation
pg_3d_acsurl
string 
optional
Parameter for request 3ds
pg_3d_pareq
string 
optional
Parameter for request 3ds
pg_auth_code
string 
required
Payment authorization code from the bank
pg_reference
string 
required
Transaction reference
pg_datetime
string 
required
Date and time of the request
pg_salt
string 
required
Random string
pg_sig
string 
required
Request digital signature
pg_card_id
integer 
optional
Saved card ID for next payments (Deprecated)
pg_card_token_to
string 
optional
Saved card token for next payments
pg_recurring_profile
integer 
optional
Recurring profile ID (if the payment request parameter pg_recurring_start = 1 was specified)
Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>7777777777</pg_payment_id>
    <pg_status>ok</pg_status>
    <pg_3ds>0</pg_3ds>
    <pg_auth_code/>
    <pg_reference/>
    <pg_datetime>2024-09-02T12:19:01+00:00</pg_datetime>
    <pg_salt>YtfwCGiBHsFLpYGk</pg_salt>
    <pg_sig>ccee466c01c2332d8a065d6108fd686b</pg_sig>
</response>
🟢200Process
🟢200Error
🟢200Invalid Signature
Previous
Any amount
Next
3DSecure