API Documentation

Host Foloosi on your Website

This online integration method allows for the use of Foloosi advanced technological integrations of real-time processing of QR code payments online. It is backed by a secure PCI DSS compliant payment gateway provider, use of which does not require you to have your own PCI compliance as card details are held only within the payment gateway.

This integration method uses HTML messages to pass information between your site and the payment gateway. It is the simplest and easiest method of integration and will work on just about any platform.

Once you have registered your business with Foloosi and have completed the steps required to receive your login credentials, then you are ready to accept payments online.

To register your business with Foloosi please proceed to: https://www.foloosi.com/business-signup

Before start this integration check your site enabled https with proper SSL certificate.

Version 1 Features :
  • In version 1, you need to put this class name "FoloosiPayApi" in appropriate html element and need to trigger a same class name using Click function to open or close the widget.
  • And also we improved the Success and Error Handlers in both Version 1 and Version 2.

Note : Both are supported versions, so upgrade to version 2 is not necessary. If you want to upgrade you can.

Step 1

Just copy these HTML snippets and paste it before closing of <body> tag.

<script type="text/javascript">
var merchant_key = "YOUR_MERCHANT_KEY";
var reference_token = "REFERENCE_TOKEN"; //which is get from step2
<script type="text/javascript" src="https://www.foloosi.com/js/foloosipay.js"></script>

Step 2(Initialize Payment Setup)

Post the following data's in below API link to requesting token for accessing the payment gateway.


secret_key : YOUR_SECRET_KEY

transaction_amount : YOUR_TRANSACTION_AMOUNT
Supported Currencies areas follows : AED, USD, EUR, INR
If you need optional parameters, you can add it your own data option name and values in Body.
The above POST request returns the Response like below. In that response, you will get Reference Token. After that you need to assign this Reference token variable globally as mentioned in Step 1.
"message": "Application setup successfully",
"data": {

Step 3

Just paste the following Class name in your Place order tag 'FoloosiPayApi'.

For Example, refer the code below.

<a class="FoloosiPayApi">Place Order</a>

Step 4

When you click place order button our popup will be loaded so you can use below test card credentials to complete the order.

Use these details:

Card Number 4111 1111 1111 1111
Expiry 05/20
CVV 123

Card Number 4242 4242 4242 4242
Expiry 05/23
CVV 123

Step 5(Optional)

For Transaction List details, you can use the below Get request to get the transaction based on your merchant key.


secret_key : YOUR_SECRET_KEY

Step 6(Optional)

For Transaction Details, you can use the below Get request to get the transaction detail.


secret_key : YOUR_SECRET_KEY

Step 7(For Success and Error Handlers)

For Success and Error Handlers, you can use the below handler function to get the payment response.

foloosiHandler(response, function (e) {
   if(e.data.status == 'success'){
      //responde success code
   if(e.data.status == 'error'){
      //responde success code
   if(e.data.status == 'closed'){
      //Payment Popup Closed

Note: Site must be https with proper SSL certificate.
Get Started
1. Log in to your Merchant Panel
2. Click on My Account
3. Click on API Settings
API Settings
API Access Key Test
Once you have completed all the tests and is ready to go live, please submit the form and contact the designated support person to enable your live API account.
API Access Key Live