1. Gateway API
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
      • Payouts
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfers
        • 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
        • Save card without a charge
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
        • Cancel payment (reverse)
        • Refund payment
  • Merchant API
    • Overview
    • Payments
      • Overview
      • Checkout
      • Pay by saved card
        • Overview
        • Create payment
        • Confirm payment with CVC
        • Confirm payment without the client
      • Create payment
      • Create payment with a payment page template
      • Create payment in a payment frame
      • Create payment with any amount
      • Create recurring payment
      • Capture payment (clearing)
      • Cancel payment
      • Refund payment
      • Get payment status
    • Payouts
      • Overview
      • Create payout page
      • Pay out to saved card
      • Pay out to IBAN
      • Get payout status
      • Get payout balance
    • Saved cards
      • Get saved cards
      • Save card
      • Save card for payouts
      • Delete saved card
      • Save card without a charge
    • Mobile balance
      • Overview
      • Create mobile balance payment
      • Charge mobile balance
      • Get mobile balance payment status
      • Confirm payment with SMS code
      • Resend SMS code
    • Invoices
      • Overview
      • Recurring payments
        • Overview
        • Create recurring profile
        • Get recurring profile
        • Charge by recurring profile
        • Cancel recurring profile
        • Recurring profile notification
      • Tips
        • Overview
        • Create
      • Create invoice
      • Get invoice status
      • Get invoice details
      • Cancel invoice
      • Refund invoice
    • SDK
      • JS SDK
      • Merchant SDK
        • Android
        • iOS
        • Migration guide
    • 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
      • CS-Cart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Installment
      • Overview
      • Status
        • Get application status
        • Application status notification
        • Change application status
      • Get partners
      • Create application
    • Callbacks
      • Overview
      • Result notify
      • Check request
      • Payout notify
      • Redirect back
  • Partner API
    • Overview
    • 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. Gateway API

Overview

Gateway API is a direct server-to-server connection between the merchant and Freedom Pay: the merchant collects card data on its side and sends it to the API, without the Freedom Pay payment page.
Gateway API has two independent APIs: Sync API and Async API.
Start with the Overview of the API you use: Sync API Overview or Async API Overview. It describes the request format, the signature and the errors.
Connection requires a PCI DSS certificate.

Sync API and Async API#

Sync API (API v3)Async API (API v5)
URL{domain}/g2g/<method>, a separate URL per operation{domain}/v5/g2g/create, /read, /edit; the operation is set by the X-Action header
Resultin the response to the requestthe request is accepted with status process; the result is available via the status request
Request and responseform data, JSON or XML; the response is XMLJSON
SignatureMD5 pg_sigJWS X-JWS-Signature (HS256)
Operationspayments by card and wallet token, 3DS, clearing, cancel, refund, recurrent payments, payouts, transfers, card storagepayments by card, saved card, wallet token and recurrent profile; 3DS; clearing, reverse, refund
Callbacksfor payouts and payment pages: see «Callbacks» in Sync API Overviewno: get the result with the status request

Test mode#

Sync API: to make a test payment, pass pg_testing_mode = 1 in the request.
Test cards work only in test mode and do not work for Apple Pay and Google Pay.
The results below were obtained with cardholder name IVAN IVANOV, CVC 123 and expiry date 12/30.

Which card to use#

What you testCard number3DS
Payment, clearing and refund4716047261941981No
Payment, clearing, reverse (cancel) and refund6224466455690681278No
Payment and reverse (cancel)4939770956154989No
Payment with 3DS and clearing4916307416334310Yes
Payment with 3DS and reverse (cancel)5367654276102126Yes
Declined payment: insufficient funds4400444400004443No
Declined payment: limit exceeded4400444400004442No
Declined payment: payment system error4400444400004441No
Declined payment: system error4400444400004445No
Declined payment: 3DS authentication failed4400444400004447Yes
Payout: success4400444444444440—
Payout: declined4400444444444441—
Payout: stays in status process4400444444444444—
The full lists are below.
— the operation succeeds, — the operation is declined.

Payment cards: successful payment#

Card numberBrand3DSClearingReverse (cancel)Refund
4400444400004440Visa
4400444400004444Visa
4458444400004448Visa
4716047261941981Visa
4916307416334310Visa
5367654276102126Mastercard
4939770956154989Visa
4799150896081734Visa
5218487962459752Mastercard
4446763125813623Visa
5200190005138652Mastercard
5269737320050521Mastercard
5377193762823307Mastercard
5200190059838710Mastercard
5163103002982563Mastercard
5486742060635314Mastercard
5200190011811433Mastercard
4090700100360047Visa
5167400000496745Mastercard
4256691944867646Visa
4284624140544525Visa
4985170000702810Visa
4356292313685179Visa
6200000000000013UnionPay
62000000000000018UnionPay
620000000000000013UnionPay
6200000000000000018UnionPay
6200000011111114UnionPay
62000000111111118UnionPay
620000001111111111UnionPay
6200000011111111115UnionPay
6224466455690681278UnionPay
62528733472390953UnionPay
623275279933273424UnionPay
4111111111111111Visa
5555555555555599Mastercard
4671593866478252Visa
For cards with 3DS the payment returns pg_3ds = 1: complete the 3DS step (/g2g/paymentAcs) to get the final result.
Save card saves a card from this table.
A card with 3DS is saved after Save card: complete 3DS.

Payment cards: declined payment#

Card numberBrand3DSResult
4400444400004441VisaPayment system error
4400444400004442VisaLimit exceeded
4400444400004443VisaInsufficient funds
4400444400004445VisaSystem error
4400444400004446VisaPayment system error
4400444400004447Visa3DS authentication failed
5335215945367703MastercardPayment system error
4916109830832246VisaLimit exceeded
5548398681700148MastercardInsufficient funds
5475102935853613MastercardSystem error
5484458131482832Mastercard3DS session error
6200000022222215UnionPayPayment system error
62000000222222226UnionPayPayment system error
620000002222222227UnionPayPayment system error
6200000022222222220UnionPayPayment system error
6200000033333316UnionPayLimit exceeded
62000000333333334UnionPayLimit exceeded
620000003333333333UnionPayLimit exceeded
6200000033333333335UnionPayLimit exceeded
6200000044444417UnionPayInsufficient funds
62000000444444442UnionPayInsufficient funds
620000004444444449UnionPayInsufficient funds
6200000044444444440UnionPayInsufficient funds
4444444444446666VisaPayment system error
4563960122001999VisaLimit exceeded
5555555555555557MastercardSystem error
4444444444444422VisaSystem error
4444444411111111VisaSystem error
4444444499999999VisaSystem error
Save card does not save a card from this table: the response contains pg_error_code.

Payout cards#

Card numberResult
4400444444444440Success
4671593866478252Success
4860515915886350Success
4860371715886350Success
4860169115886354Success
4860502915886358Success
4860041015886356Success
4860050615886351Success
4860518515886358Success
4860967315886359Success
4860862015886355Success
6204500338419360939Success
62861819783765929Success
629656013969216940Success
4400444400004440Success
4458444400004448Success
4400444444444441Declined
4400444444444442Declined
4400444444444443Declined
5325349472901311Declined
4556046085041740Declined
5543974702876045Declined
4400444444444444Stays in status process
4400444444444445Stays in status process
5507841999732294Stays in status process
4532676596620704Stays in status process

Error codes#

The error format of each API is described in its Overview.
Error code reference

Support#

If you find an inaccuracy in the documentation or need help with the integration, write to support@freedompay.kz.
For connection and merchant settings, contact your account manager.
Previous
Overview
Next
Overview