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 2 Features :
  • Version 2 is better than Version 1, but how exactly is it better? Let me explain...
  • In version 2, you can initialize the variable named "fp1" to call the function named "new Foloosipay(options)", after that call "fp1.open()" to open the widget and also call "fp1.close()" to close the widget. And also we improved some UI related parts.
  • 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 options = {
        "reference_token" : "REFERENCE_TOKEN", //which is get from step2
        "merchant_key" : "YOUR_MERCHANT_KEY"
    var fp1 = new Foloosipay(options);
<script type="text/javascript" src="https://www.foloosi.com/js/foloosipay.v2.js"></script>

Step 2(Initialize Payment Setup)

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


merchant_key : YOUR_MERCHANT_KEY

transaction_amount : YOUR_TRANSACTION_AMOUNT
customer_name : OPTIONAL /*note : auto render in payment popup*/
customer_email : OPTIONAL /*note : auto render in payment popup*/
customer_mobile : OPTIONAL /*note : auto render in payment popup*/
customer_address : OPTIONAL /*note : minimize form fields in card detail page*/
customer_city : OPTIONAL /*note : minimize form fields in card detail page*/
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 code to Open and Close the Payment Widget.

For Open a Widget, refer the code below.


For Close a Widget, refer the code below.


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 4000 0000 0000 0002
Expiry 12/24
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(Create QR code)

Post the following data's in below API link to requesting QR code.This option for foloosi customer can do scan and pay transaction


secret_key : YOUR_SECRET_KEY

description : DESCRIPTION
"message": "QR created successfully",
"data": {
Here, we are given QR code for your transaction amount. A we mentioned in above
For example:
In above the response, just take payment_qr_url and show in image tag
<img src ="payment_qr_url" width ="400px" height="400px">
width and height is depending on your requirement.

Step 8(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