Integrate Instamojo Payment gateway With PHP and MySQL.

Instamojo Banner

Most of the people prefer online shopping which made eCommerce to grow rapidly. But, what makes an excellent eCommerce site for Customers and the answer is the easy and fast checkout process. Now a days there are several payment option available in the market today like – PayPal Checkout System, Paytm etc. But Today the payment gateway we gonna talk about is the fast and easy to use payment gateway which is Instamojo. So the first question is.

Demo Download Subscribe on Youtube

Note – There is an updated verion of Instamojo Payment gateway here. But this version still works.

What is Instamojo?

So Basically, Instamojo is an online payment gateway just like PayPal other payment gateway which allow user’s to Send, Receive Payments through many online options like net banking, Credit-Card, Debit Card etc. So using Instamojo it is easier to send and receive payments online.

Instamojo allow us to integrate the checkout system in the website, Apps etc for faster and easier checkout.

As well as instamojo is fully secured and trusted website in all over the World.

You Can receive payment from any place and Send payments to anywhere in the world.

This Project includes.

Integration of instamojo in our website using the API Provided by Instamojo.

So before we get started, there are the couple of things you have to do.

  • Go to and create an account and fill in all the details they ask correctly to get your hands on their API.
  • Go To for creating the account on the test/sandbox website to test out the API before getting your code online.
  • then click on API & Plugins on the side bar and on the next page you will be provided with your Private key, Private Auth key, Private Salt.
  • Just save those things.

NOTE : instamojo doesn’t allow localhost or for testing their API so you need to have an online server, if you have one, cool enough and if you don’t have one the create one Here.

Instamojo has 2 different website

  1. For Live Production (i.e. When you are ready to upload it on your server and start your website.).
  2. For Testing purposes (i.e. When you are just testing the checkout system.).

Both of the website gives you

  • Private API Key
  • Private Auth Token
  • Private Salt

And these Credentials are different for live and testing versions.

So let’s get started.

First of all you can see the demo to see the live working checkout system

Here are the checkout Details for demo. which you can use for checkout.

Card Number – 4242 4242 4242 4242

Expiry Date – 01/20

CVV – 111

Second Factor Authentication Code – 1221

First Open Webhook.php and see Line 20 and replace YOUR_PRIVATE_SALT to your private salt and on line 28 Change YOUR_EMAIL_ADDRESS to your Email id.

Now open Pay.php and see line no.11 and change YOU_PRIVATE_API_KEY & YOUR_PRIVATE_AUTH_TOKEN to your credentials. And on line 24,25 change your path.

And now Open thankyou.php and do the same on line 39.

And The rest files need no change but you can change it as per your need as per your Project Demand.

Right now the Codes are written for the Testing Version only but if you wanted to use it on live version then your just have to find and Replace it with in every file.

If you need any Other Information About Instamojo API, You can check out their Documentations here – Instamojo Docs

So that’s it for this tutorial, hope you guys like it and if you did then share it out and subscribe to my blog for future updates Via email.

Thanks a lot for Reading.