Freedom Pay
  1. Async API
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
        • 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. Async API

Overview

Introduction#

Request Type: POST
Request Format: application/json

Request Headers#

X-Action - The method being called.
X-Request-Id - Unique request ID (UUID).
Accept-Language - Response language of the system (currently not used).
X-JWS-Signature - Request signature (detailed explanation below).
Content-Type - Must be application/json.
Accept - Must be application/json.

Response Headers#

X-Action - The method.
X-Request-Id - Unique request ID (UUID).
X-Datetime - Date and time of request processing.
X-Request-Status - Request processing status.

The API has three main URLs#

{domain}/v5/g2g/create - Creates an object in the PG system.
{domain}/v5/g2g/read - Retrieves information about an object.
{domain}/v5/g2g/edit - Updates information about an object.
 An object in the payment system represents an entity or resource that the system interacts with to process payments and manage financial operations. This object can be a payment, card, account, etc.
 The object contains a set of attributes that define its properties, status, and transaction history. Interaction with the object is performed through the payment system's API, allowing various operations such as creation, retrieval, updating, and deletion of objects, as well as executing additional actions within the context of a specific object.

Generating the X-JWS-Signature#

 To send any request, a request signature must be generated using JWS technology.
 The JWS format must include the mandatory blocks header and signature and should be passed in the request header X-JWS-Signature.

Header Structure (all fields are required)#

{
    "uri": "/v5/g2g/create",
    "auth_id": "123456",
    "method": "POST",
    "params": "",
    "alg": "HS256"
}

Header Structure (all fields are required)#

FieldDescription
uriThe path to the API endpoint being called
auth_idUser ID for signature verification
methodRequest method
paramsReserved field
algEncryption algorithm

Payload Structure#

 The payload for generating JWS includes the HTTP request body.
 The supported signature encryption algorithm is HS256, and the merchant's secret_key should be used as the signing key.
Example of Signature Generation:
Header
{
    "uri": "/v5/g2g/create",
    "auth_id": "123456",
    "method": "POST",
    "params": "",
    "alg": "HS256"
}
Payload:
{
  "amount": 123.42,
  "currency": "KZT",
  "description": "description",
  "order_id": "order_id",
  "user_id": "user_id",
  "auto_clearing": true,
  "from": {
    "type": "card",
    "card": {
      "name": "CARD HOLDER",
      "pan": "1234567890123456",
      "cvc": "012",
      "year": 24,
      "month": 1
    },
    "save": true,
    "recurrent": {
      "lifetime": 3
    }
  },
  "device": {
    "user_ip": "123.123.123.123"
  },
  "urls": {
    "check_url": "https://webhook.site/2af177da-0d72-4651-a31e-a0ea56ccc8a4",
    "result_url": "https://webhook.site/2af177da-0d72-4651-a31e-a0ea56ccc8a4"
  }
}
Encryption Key: 123456
Generated JWS:
eyJ1cmkiOiIvdjUvZzJnL2NyZWF0ZSIsImF1dGhfaWQiOiIxMjM0NTYiLCJtZXRob2QiOiJQT1NUIiwicGFyYW1zIjoiIiwiYWxnIjoiSFMyNTYifQ..82NnkgrNjfYu2UnAajnVsJUn2AgJWsqnmCK4x5A7zt0
Modified at 2025-02-17 19:15:43
Previous
Status
Next
create payment