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/users/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>
<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.

POST API LINK :
https://foloosi.com/api/v1/api/initialize-setup

HEADERS:
secret_key : YOUR_SECRET_KEY

BODY:
redirect_url : YOUR_REDIRECT_URL
transaction_amount : YOUR_TRANSACTION_AMOUNT
currency : YOUR_CURRENCY_CODE
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.
Response
{
"message": "Application setup successfully",
"data": {
"reference_token":
"U0sjdGVzdF8kMnkkMTAkM21LRi0xZGliVDhldTV4NHlZSm9tZXZobnZxWTNEVnZmay1MdHNndTNFenNBTDU0clhWYkccVE4jRkxTQVBJNWM3Njk2ZDkwOWIzNxxSVCMkMnkkMTAkQXZ4ay9wdjlpTFlYLzRSZ2FjSkxpZWhHb2o0U0wvTFpZNXAyVjRGOVFycWNQZ2lHQ3VEZ08=",
"payment_qr_data":
"UEgjNTgcQU0jMTMwHE9GRiMcUFJPTU8jHERFUyNNYWRlIHBheW1lbnQgdG8gT00tTWVyY2hhbnQgKFRlc3QpHEFWX3YxOkZSTV9NHFBLIyQyeSQxMCR2RWRIMVZpSHBLV2lSNmxEdE9IUUFPM2RabTZheFlBLmQ2LWdXNUEubXNvQWJPLks1ZjduRxxJUCMcTUFDIxxTVUIjMBxDT0RFIw==",
"payment_qr_url":
"https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl=UEgjNTgcQU0jMTMwHE9GRiMcUFJPTU8jHERFUyNNYWRlIHBheW1lbnQgdG8gT00tTWVyY2hhbnQgKFRlc3QpHEFWX3YxOkZSTV9NHFBLIyQyeSQxMCR2RWRIMVZpSHBLV2lSNmxEdE9IUUFPM2RabTZheFlBLmQ2LWdXNUEubXNvQWJPLks1ZjduRxxJUCMcTUFDIxxTVUIjMBxDT0RFIw=="
}
}
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 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.

GET API LINK:
https://foloosi.com/api/v1/api/transaction-list

HEADERS:
secret_key : YOUR_SECRET_KEY

Step 6(Optional)

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

GET API LINK:
http://foloosi.com/api/v1/api/transaction-detail/YOUR_TRANSACTION_ID

HEADERS:
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
      //console.log(e.data.status);
      //console.log(e.data.data.transaction_no);
   }
   if(e.data.status == 'error'){
      //responde success code
      //console.log(e.data.status);
      //console.log(e.data.data.payment_status);
   }
});

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