Freedom Pay
  1. OIDC
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
          GET
        • Token exchange
          POST
        • Userinfo
          GET
      • 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. OIDC

Token exchange

POST
https://passport.freedompay.kz/api/v1oidc//token
After the user returns to the redirect_uri page, the code received in the request must be exchanged for an access_token. BasicAuth should be used as authentication data.
The received VVT will contain information of the following type:
{
  "iss": "https://passport.freedompay.kz",
  "sub": "41790bb3-62ba-461f-9bed-e232e30ad377",
  "aud": "b4b93cc5-3ca5-4ca1-aaaf-5aab2aac7584",
  "exp": 1741077405,
  "iat": 1740472605,
  "nonce": "opQnEJ5fvOt5JLbl8IBAcS82Yy6QXFFm"
}
Sub - user freedom_id, Aud - your client id.

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Body Params application/json
code
string 
required
Authorization code
redirect_uri
string <URL>
required
Redirection URI
grant_type
string 
required
Must be authorization_code
Example
{
  "code": "string",
  "redirect_uri": "string",
  "grant_type": "string"
}

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://passport.freedompay.kz/api/v1oidc//token' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
    "code": "string",
    "redirect_uri": "string",
    "grant_type": "string"
}'

Responses

🟢200Success
application/json
Body
access_token
string <[a-zA-Z0-9]{128}>
required
Access token
expires_in
integer 
required
Lifetime in seconds
refresh_token
string 
required
Refresh token
token_type
string 
required
Will be Bearer
id_token
string 
required
JWT
Example
{
  "access_token": "DZN0MZP726480hFLHBEmMqe2iLNIjt07OrUcsm5m1BimTiuiF9yUJ3EQmkGwKNC2LmrmU4C4yWF5V3iwSN4ngi1Q5CRkOBixjdma0mWxsGhC7RZldkwhxmpow1UtyQ6O",
  "expires_in": 604799,
  "refresh_token": "a16UDg4GEmLHZu85WPQzM6diJtrzRz1q2iomXZzZVkPqFbmVihz03mqwbJQcPVn2boISi7qbleq1VWNinMTFUbAnyc3XgbcOQ1DbZ5dkOPTWiMjiNky81bJNjKPmUY9d",
  "token_type": "Bearer",
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Bhc3Nwb3J0LmZyZWVkb21wYXkua3oiLCJzdWIiOiI0MTc5MGJiMy02MmJhLTQ2MWYtOWJlZC1lMjMyZTMwYWQzNzciLCJhdWQiOiJiNGI5M2NjNS0zY2E1LTRjYTEtYWFhZi01YWFiMmFhYzc1ODQiLCJleHAiOjE3NDEwNzc0MDUsImlhdCI6MTc0MDQ3MjYwNSwibm9uY2UiOiJvcFFuRUo1ZnZPdDVKTGJsOElCQWNTODJZeTZRWEZGbSJ9._7InjwY3Jh-9ZfKwtZpLR-AuXfgshSmIyHw-YL4Us7Q"
}
Previous
Authorization endpoint
Next
Userinfo