Freedom Pay
  1. Card token
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • 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
          POST
        • Delete token
          POST
        • Card token list
          POST
        • Create payment (with CVC)
          POST
        • Confirm payment (with CVC)
          POST
        • Create payment
          POST
        • Confirm payment
          POST
      • Create payment
        POST
      • Any amount
        POST
      • Cancel payment
        POST
      • Clearing
        POST
      • Refund payment
        POST
      • Status
        POST
    • 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. Card token

Create payment

POST
https://api.freedompay.kz/v1/merchant/{{merchant_id}}/card/init
In this method, we initialize non-acceptance payment using a previously saved card
At this stage, the existence of the pg_card_token sent by the merchant is verified. If everything is correct, Freedom Pay Gateway responds with a payment_id

Interaction diagram#

Status: success/error/pending
Merchant_API_V3-Non-acceptance payments.drawio.png

Request

Body Params multipart/form-data
pg_merchant_id
integer 
required
Merchant ID in the system {{project}}
pg_order_id
string 
required
Order ID in the merchant system
Example:
550e8400-e29b-41d4-a716-446655440000
pg_amount
number 
required
Payment amount
>= 0.01<= 99999999
pg_description
string 
required
Order description
pg_user_id
string 
required
User ID in the merchant system
<= 50 characters
Example:
No65GFR755789T
Match pattern:
^[a-zA-Z0-9_-]+$
pg_user_ip
string 
optional
Client's IP address. Necessary for the analysis of disputable situations in case of suspected fraud
Example:
127.0.0.1
pg_user_phone
number 
optional
The user's phone number (starting with the country code). If not specified
Example:
77777777777
pg_user_email
string <email>
optional
Customer's email (specified during payment initialization)
pg_card_token
string 
required
Card token
<= 255 characters
Example:
ef741cfc-f85e-41a0-84e6-2ba964912182
pg_result_url
string 
optional
URL for message about payment result
<= 255 characters
Example:
https://site.com/result
pg_success_url
string 
optional
URL to which the user is sent in case of successful payment. Required if not set in the store settings
<= 255 characters
Example:
https://site.com/success
pg_failure_url
string 
optional
URL to which the user is sent in case of unsuccessful payment. Required if not set in the store settings
<= 255 characters
Example:
https://site.com/failure
pg_receipt_positions[0][count]
integer 
optional
Product quantity
>= 1
Example:
2
pg_receipt_positions[0][name]
string 
optional
Product name
>= 1 characters
Example:
Mouse pad
pg_receipt_positions[0][tax_type]
enum<integer> 
optional
Tax type. Possible values:
0 - Without tax,
1 - VAT 0%,
2 - VAT 12%,
3 - VAT 12/112,
4 - VAT 18%,
5 - VAT 18/118
6 - VAT 10%,
7 - VAT 10/110,
8 - VAT 20%,
9 - VAT 20/120.
Allowed values:
0123456789
pg_receipt_positions[0][price]
number 
optional
Price per unit product
>= 0.01<= 9999999
pg_param1
string 
optional
Additional parameter 1
<= 255 characters
Example:
Additional Information
pg_param2
string 
optional
Additional parameter 2
<= 255 characters
Example:
Additional Information
pg_param3
string 
optional
Additional parameter 3
<= 255 characters
Example:
Additional Information
pg_idempotency_key
string 
optional
Idempotency key. Used to prevent duplicate request creation. A unique value within the merchant's scope; the same key cannot be used for different operations
<= 255 characters
Example:
550e8400-e29b-41d4-a716-446655440000
pg_loyalty_id
number 
optional
Identifier in the loyalty system
pg_loyalty_amount
number 
optional
Amount of accrued units in the loyalty system
pg_freedom_id
string 
optional
User identifier in the Freedom ecosystem
pg_salt
string 
required
A 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 -g --request POST 'https://api.freedompay.kz/v1/merchant/{{merchant_id}}/card/init' \
--form 'pg_merchant_id=""' \
--form 'pg_order_id="550e8400-e29b-41d4-a716-446655440000"' \
--form 'pg_amount=""' \
--form 'pg_description=""' \
--form 'pg_user_id="No65GFR755789T"' \
--form 'pg_user_ip="127.0.0.1"' \
--form 'pg_user_phone="77777777777"' \
--form 'pg_user_email=""' \
--form 'pg_card_token="ef741cfc-f85e-41a0-84e6-2ba964912182"' \
--form 'pg_result_url="https://site.com/result"' \
--form 'pg_success_url="https://site.com/success"' \
--form 'pg_failure_url="https://site.com/failure"' \
--form 'pg_receipt_positions[0][count]="2"' \
--form 'pg_receipt_positions[0][name]="Mouse pad"' \
--form 'pg_receipt_positions[0][tax_type]=""' \
--form 'pg_receipt_positions[0][price]=""' \
--form 'pg_param1="Additional Information"' \
--form 'pg_param2="Additional Information"' \
--form 'pg_param3="Additional Information"' \
--form 'pg_idempotency_key="550e8400-e29b-41d4-a716-446655440000"' \
--form 'pg_loyalty_id=""' \
--form 'pg_loyalty_amount=""' \
--form 'pg_freedom_id=""' \
--form 'pg_salt=""' \
--form 'pg_sig=""'

Responses

🟢200Success
application/xml
Body
pg_status
string 
required
Shows the result of the query
Status Description
ok — Request was successful,
error — Request was successful
pg_payment_id
integer 
required
The unique identifier of the payment transaction in {{project}}; serves as the key for all further work with the transaction.
pg_merchant_id
integer 
required
Merchant ID in the system {{project}}
pg_order_id
string 
required
Order ID in the merchant system
pg_salt
string 
required
Random string.
pg_sig
string 
required
Request signature.
Example
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_payment_id>7999007883</pg_payment_id>
    <pg_merchant_id>9970</pg_merchant_id>
    <pg_order_id>12345</pg_order_id>
    <pg_status>ok</pg_status>
    <pg_salt>V9UG2EPB</pg_salt>
    <pg_sig>8f2e720a6b6f61c0575b6abbdcbcb567</pg_sig>
</response>
🟢200Error
🟢200Invalid Signature
Previous
Confirm payment (with CVC)
Next
Confirm payment