{"_id":"5cb42aa4922aeb006335397d","githubsync":"","parentDoc":null,"sync_unique":"","user":"56a1c959842b650d0088899c","__v":31,"createdAt":"2016-04-04T08:58:43.574Z","hidden":false,"isReference":false,"link_external":false,"order":0,"slug":"overview-and-setup","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"","auth":"required","params":[]},"body":"##How Instamojo works\n\nInstamojo works by creating payment requests.\n\nFor example: _Superstore_ wants to accept payments, they create a payment request which looks like this: \n\n`https://www.instamojo.com/@SuperStore/2f89f6a267ad4543a0906ff762481563`\n\nThey can share this link with their customers and receive payments online. \n\nThe Instamojo Marketplace flow is an extension of the above. You can create payment requests on behalf of a merchant in your marketplace/system, facilitate payments and payouts to them. \n\nThe Marketplace API can also be used to debit your commission from your merchants. While creating payment requests on behalf of merchants in your marketplace/system, you can receive a certain commission from each sale, while automatically transferring the rest of the amount to your merchant’s bank account. \n\n##Marketplace API use cases\n\n*Marketplace Model*\n\nThe marketplace API is used by aggregators where sellers are charged a certain commission for each product sold on the platform. This split of commission is automatically done with the marketplace API.\n\n> Eg: _Superstore_ registers on the marketplace _Mojocart_. _Mojocart_ uses the Instamojo marketplace API to create an account for _Superstore_ on Instamojo. _Mojocart_ then proceeds to use Instamojo for all payments, compliance, payouts, security, risk and fraud-protection for _Superstore_.\n\n*Vendor Model*\n\nThe API can also be used by an agency to collect commissions from payments collected by a product/software that was customized and built for a client.\n\n> Eg: _InvoiceWrite_ has an invoicing solution where they would like to integrate online payments and also collect a small percentage of each transaction processed.","category":"5cb42aa4922aeb0063353975","type":"basic","version":"5cb42aa4922aeb00633539a6","excerpt":"An introduction","link_url":"","title":"Marketplace API","project":"56a1c9c13845200d0066d6fe","updates":[],"next":{"description":"","pages":[]},"childrenPages":[]}

Marketplace API

An introduction

##How Instamojo works Instamojo works by creating payment requests. For example: _Superstore_ wants to accept payments, they create a payment request which looks like this: `https://www.instamojo.com/@SuperStore/2f89f6a267ad4543a0906ff762481563` They can share this link with their customers and receive payments online. The Instamojo Marketplace flow is an extension of the above. You can create payment requests on behalf of a merchant in your marketplace/system, facilitate payments and payouts to them. The Marketplace API can also be used to debit your commission from your merchants. While creating payment requests on behalf of merchants in your marketplace/system, you can receive a certain commission from each sale, while automatically transferring the rest of the amount to your merchant’s bank account. ##Marketplace API use cases *Marketplace Model* The marketplace API is used by aggregators where sellers are charged a certain commission for each product sold on the platform. This split of commission is automatically done with the marketplace API. > Eg: _Superstore_ registers on the marketplace _Mojocart_. _Mojocart_ uses the Instamojo marketplace API to create an account for _Superstore_ on Instamojo. _Mojocart_ then proceeds to use Instamojo for all payments, compliance, payouts, security, risk and fraud-protection for _Superstore_. *Vendor Model* The API can also be used by an agency to collect commissions from payments collected by a product/software that was customized and built for a client. > Eg: _InvoiceWrite_ has an invoicing solution where they would like to integrate online payments and also collect a small percentage of each transaction processed.
##How Instamojo works Instamojo works by creating payment requests. For example: _Superstore_ wants to accept payments, they create a payment request which looks like this: `https://www.instamojo.com/@SuperStore/2f89f6a267ad4543a0906ff762481563` They can share this link with their customers and receive payments online. The Instamojo Marketplace flow is an extension of the above. You can create payment requests on behalf of a merchant in your marketplace/system, facilitate payments and payouts to them. The Marketplace API can also be used to debit your commission from your merchants. While creating payment requests on behalf of merchants in your marketplace/system, you can receive a certain commission from each sale, while automatically transferring the rest of the amount to your merchant’s bank account. ##Marketplace API use cases *Marketplace Model* The marketplace API is used by aggregators where sellers are charged a certain commission for each product sold on the platform. This split of commission is automatically done with the marketplace API. > Eg: _Superstore_ registers on the marketplace _Mojocart_. _Mojocart_ uses the Instamojo marketplace API to create an account for _Superstore_ on Instamojo. _Mojocart_ then proceeds to use Instamojo for all payments, compliance, payouts, security, risk and fraud-protection for _Superstore_. *Vendor Model* The API can also be used by an agency to collect commissions from payments collected by a product/software that was customized and built for a client. > Eg: _InvoiceWrite_ has an invoicing solution where they would like to integrate online payments and also collect a small percentage of each transaction processed.
{"_id":"5cb42aa4922aeb0063353985","excerpt":"","githubsync":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"slug":"overview-and-setup-3","body":"##Basic integration flow\n\n\n1.\tCreate an account for your marketplace on Instamojo\n\n2.\tUse the [Merchant Signup API](doc:signup) to create accounts for your merchants on your marketplace. \n\n3.\tGet access tokens for your merchants.\n\n4.     Add their bank information.\n\n5.\tCreate payment links for your merchants and share them with buyers, or redirect the buyers to these payment links to receive payments. \n\n6.\tOnce the Payment is received in the Master merchant account, the Master merchant needs to settle the respective amount with the sub-merchants(s) using our Settlement API call. \n\n7.\tOnce a Settlement is made, it takes 3 business days to transfer the funds into your merchant’s bank account. \n\n##Setup\n\n1.\tIt’s recommended to test your integration in our sandbox environment. Sign up on https://test.instamojo.com and write to us at support@instamojo.com stating your username for us to send your `client_id`, `client_secret` and `referrer`. Note that in the base API endpoint for our sandbox environment is **https://test.instamojo.com/** not **https://api.instamojo.com/**.\n\n2.\tOnce you’re done with testing the API, please signup on https://www.instamojo.com and complete your KYC verification. Please allow our compliance team 48 hours to verify your account. \n3.\tOnce your account has been approved, please get in touch with support@instamojo.com for your `client_id`, `client_secret` and `referrer`. Please note that you must take precautions to safeguard this information, because if exposed, it can be misused.","createdAt":"2016-04-22T11:46:54.995Z","title":"Overview and Setup","category":"5cb42aa4922aeb0063353975","hidden":false,"__v":15,"sync_unique":"","updates":[],"user":"56a1c959842b650d0088899c","api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]}},"link_url":"","project":"56a1c9c13845200d0066d6fe","type":"basic","version":"5cb42aa4922aeb00633539a6","isReference":false,"link_external":false,"childrenPages":[]}

Overview and Setup


##Basic integration flow 1. Create an account for your marketplace on Instamojo 2. Use the [Merchant Signup API](doc:signup) to create accounts for your merchants on your marketplace. 3. Get access tokens for your merchants. 4. Add their bank information. 5. Create payment links for your merchants and share them with buyers, or redirect the buyers to these payment links to receive payments. 6. Once the Payment is received in the Master merchant account, the Master merchant needs to settle the respective amount with the sub-merchants(s) using our Settlement API call. 7. Once a Settlement is made, it takes 3 business days to transfer the funds into your merchant’s bank account. ##Setup 1. It’s recommended to test your integration in our sandbox environment. Sign up on https://test.instamojo.com and write to us at support@instamojo.com stating your username for us to send your `client_id`, `client_secret` and `referrer`. Note that in the base API endpoint for our sandbox environment is **https://test.instamojo.com/** not **https://api.instamojo.com/**. 2. Once you’re done with testing the API, please signup on https://www.instamojo.com and complete your KYC verification. Please allow our compliance team 48 hours to verify your account. 3. Once your account has been approved, please get in touch with support@instamojo.com for your `client_id`, `client_secret` and `referrer`. Please note that you must take precautions to safeguard this information, because if exposed, it can be misused.
##Basic integration flow 1. Create an account for your marketplace on Instamojo 2. Use the [Merchant Signup API](doc:signup) to create accounts for your merchants on your marketplace. 3. Get access tokens for your merchants. 4. Add their bank information. 5. Create payment links for your merchants and share them with buyers, or redirect the buyers to these payment links to receive payments. 6. Once the Payment is received in the Master merchant account, the Master merchant needs to settle the respective amount with the sub-merchants(s) using our Settlement API call. 7. Once a Settlement is made, it takes 3 business days to transfer the funds into your merchant’s bank account. ##Setup 1. It’s recommended to test your integration in our sandbox environment. Sign up on https://test.instamojo.com and write to us at support@instamojo.com stating your username for us to send your `client_id`, `client_secret` and `referrer`. Note that in the base API endpoint for our sandbox environment is **https://test.instamojo.com/** not **https://api.instamojo.com/**. 2. Once you’re done with testing the API, please signup on https://www.instamojo.com and complete your KYC verification. Please allow our compliance team 48 hours to verify your account. 3. Once your account has been approved, please get in touch with support@instamojo.com for your `client_id`, `client_secret` and `referrer`. Please note that you must take precautions to safeguard this information, because if exposed, it can be misused.
{"_id":"5cb42aa4922aeb006335397e","__v":34,"createdAt":"2016-04-04T10:53:29.247Z","hidden":false,"title":"Integration Guide","type":"basic","user":"56a1c959842b650d0088899c","excerpt":"","category":"5cb42aa4922aeb0063353975","isReference":false,"link_url":"","parentDoc":null,"project":"56a1c9c13845200d0066d6fe","sync_unique":"","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"name":"","code":"{}","language":"json"},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":""},"body":"##Integration Steps\n\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Restricted Access\",\n  \"body\": \"The Marketplace API is available only to select customers based on their business needs.\\nRegular Instamojo API credentials will not work for the Marketplace API.\\n\\nFor credentials related to Marketplace API contact support@instamojo.com and specify your platform (production/sandbox).\"\n}\n[/block]\n##Authentication Flow\n\nAll API interactions required you to have a authentication credentials. Use the `client_id` and `client_secret` to authenticate yourself against the API. There are three kinds of authentication:\n\n1. [Application Based](doc:application-based-authentication) - This gives you extra privileges like creating an account on Instamojo.\n\n2. [User Based](doc:user-based-authentication) - This gives you privileges for performing actions on a user's account. For eg: updating their name and location, creating payment links on their behalf, etc.\n\n3. [Refresh Token Based](doc:refresh-token-based-authentication) - An `access_token` obtained via the User Based authentication will expire in `36000` seconds. But it also gives a `refresh_token`, which can be used to obtain a new pair of `access_token` and `refresh_token` without the need for the `username` and `password`.\n\n\n\n## Signup Flow\n\n1. Use **Application Based Authentication** to get an `access_token`.\n\n2. Use this `access_token` to create a user on Instamojo. Here you should use a valid email id and a  password. Ensure that you are not storing the password in your system. On signup, you will receive a unique `id` for the user, which will be used henceforth to identify the user.\n\n3. Use **User Based Authentication** to get an `access_token`. You will need the password for the first time when you are requesting an `access_token` in this step. Going forward, you must store the `access_token` and `refresh_token` safely in your database, and discard the password that you had used. If the current `access_token` expires, you should use the **Refresh Token Based** authentication to get a new pair of `access_token` and `refresh_token`.\n\n4. Use this `access_token` to update the bank account details of the user.\n\n\n\n## Payment flow\n\n1. Use **User Based Authentication** to get an `access_token`.\n\n2. Use this `access_token` to create a payment link.\n\n3. Send the payment link to the buyer.\n\n4. When the payment is complete, we will send you a `webhook` request or redirect the buyer to your `redirect_url` depending on the mode chosen by you while creating the payment link.\n\n\n\n## Additional Features\n\n1. Refunds - Use this feature if you want to refund the complete or partial amount for a payment. Multiple refund is allowed as well. \n\n2. Debit amount - The Master merchant will be able to debit the amount from a sub-merchant account for any reasons. In this case, the amount is taken from the sub-merchant account and passed to the Master merchant account.","githubsync":"","link_external":false,"next":{"description":"","pages":[]},"order":2,"slug":"integration-guide","updates":["58412f6e426cf70f006f5054"],"version":"5cb42aa4922aeb00633539a6","childrenPages":[]}

Integration Guide


##Integration Steps [block:callout] { "type": "danger", "title": "Restricted Access", "body": "The Marketplace API is available only to select customers based on their business needs.\nRegular Instamojo API credentials will not work for the Marketplace API.\n\nFor credentials related to Marketplace API contact support@instamojo.com and specify your platform (production/sandbox)." } [/block] ##Authentication Flow All API interactions required you to have a authentication credentials. Use the `client_id` and `client_secret` to authenticate yourself against the API. There are three kinds of authentication: 1. [Application Based](doc:application-based-authentication) - This gives you extra privileges like creating an account on Instamojo. 2. [User Based](doc:user-based-authentication) - This gives you privileges for performing actions on a user's account. For eg: updating their name and location, creating payment links on their behalf, etc. 3. [Refresh Token Based](doc:refresh-token-based-authentication) - An `access_token` obtained via the User Based authentication will expire in `36000` seconds. But it also gives a `refresh_token`, which can be used to obtain a new pair of `access_token` and `refresh_token` without the need for the `username` and `password`. ## Signup Flow 1. Use **Application Based Authentication** to get an `access_token`. 2. Use this `access_token` to create a user on Instamojo. Here you should use a valid email id and a password. Ensure that you are not storing the password in your system. On signup, you will receive a unique `id` for the user, which will be used henceforth to identify the user. 3. Use **User Based Authentication** to get an `access_token`. You will need the password for the first time when you are requesting an `access_token` in this step. Going forward, you must store the `access_token` and `refresh_token` safely in your database, and discard the password that you had used. If the current `access_token` expires, you should use the **Refresh Token Based** authentication to get a new pair of `access_token` and `refresh_token`. 4. Use this `access_token` to update the bank account details of the user. ## Payment flow 1. Use **User Based Authentication** to get an `access_token`. 2. Use this `access_token` to create a payment link. 3. Send the payment link to the buyer. 4. When the payment is complete, we will send you a `webhook` request or redirect the buyer to your `redirect_url` depending on the mode chosen by you while creating the payment link. ## Additional Features 1. Refunds - Use this feature if you want to refund the complete or partial amount for a payment. Multiple refund is allowed as well. 2. Debit amount - The Master merchant will be able to debit the amount from a sub-merchant account for any reasons. In this case, the amount is taken from the sub-merchant account and passed to the Master merchant account.
##Integration Steps [block:callout] { "type": "danger", "title": "Restricted Access", "body": "The Marketplace API is available only to select customers based on their business needs.\nRegular Instamojo API credentials will not work for the Marketplace API.\n\nFor credentials related to Marketplace API contact support@instamojo.com and specify your platform (production/sandbox)." } [/block] ##Authentication Flow All API interactions required you to have a authentication credentials. Use the `client_id` and `client_secret` to authenticate yourself against the API. There are three kinds of authentication: 1. [Application Based](doc:application-based-authentication) - This gives you extra privileges like creating an account on Instamojo. 2. [User Based](doc:user-based-authentication) - This gives you privileges for performing actions on a user's account. For eg: updating their name and location, creating payment links on their behalf, etc. 3. [Refresh Token Based](doc:refresh-token-based-authentication) - An `access_token` obtained via the User Based authentication will expire in `36000` seconds. But it also gives a `refresh_token`, which can be used to obtain a new pair of `access_token` and `refresh_token` without the need for the `username` and `password`. ## Signup Flow 1. Use **Application Based Authentication** to get an `access_token`. 2. Use this `access_token` to create a user on Instamojo. Here you should use a valid email id and a password. Ensure that you are not storing the password in your system. On signup, you will receive a unique `id` for the user, which will be used henceforth to identify the user. 3. Use **User Based Authentication** to get an `access_token`. You will need the password for the first time when you are requesting an `access_token` in this step. Going forward, you must store the `access_token` and `refresh_token` safely in your database, and discard the password that you had used. If the current `access_token` expires, you should use the **Refresh Token Based** authentication to get a new pair of `access_token` and `refresh_token`. 4. Use this `access_token` to update the bank account details of the user. ## Payment flow 1. Use **User Based Authentication** to get an `access_token`. 2. Use this `access_token` to create a payment link. 3. Send the payment link to the buyer. 4. When the payment is complete, we will send you a `webhook` request or redirect the buyer to your `redirect_url` depending on the mode chosen by you while creating the payment link. ## Additional Features 1. Refunds - Use this feature if you want to refund the complete or partial amount for a payment. Multiple refund is allowed as well. 2. Debit amount - The Master merchant will be able to debit the amount from a sub-merchant account for any reasons. In this case, the amount is taken from the sub-merchant account and passed to the Master merchant account.
{"_id":"5cb42aa4922aeb0063353986","title":"Application Based Authentication","user":"56a1c959842b650d0088899c","githubsync":"","link_url":"","sync_unique":"","editedParams2":true,"isReference":true,"project":"56a1c9c13845200d0066d6fe","slug":"application-based-authentication","createdAt":"2016-05-04T13:21:53.476Z","editedParams":true,"parentDoc":null,"type":"post","updates":["5926ecfd6c729e0f005963be","59a50906192dba000fc9c932","5a3e2ba8d757ef00120e963e"],"body":"","category":"5cb42aa4922aeb0063353976","order":0,"hidden":false,"link_external":false,"version":"5cb42aa4922aeb00633539a6","__v":4,"api":{"auth":"never","examples":{"codes":[{"code":"import requests\nrequests.post('https://api.instamojo.com/oauth2/token/', data={\n    \t'grant_type': 'client_credentials',\n  \t\t'client_id': '21fe14a60057ece6c76496175cb0238a2ffd87be',\n    \t'client_secret': '-KWPoDO!_l?MZQ-DsZeQ0TXXcvuDn;mxmAtGho8Xijn=iH6F'\n})\n              ","language":"python"}]},"method":"post","params":[{"desc":"This describes the type of authentication.","name":"grant_type","ref":"","required":true,"type":"string","in":"body","_id":"5729f771fcecb90e00b0a9c7","default":"client_credentials"},{"ref":"","required":true,"type":"string","in":"body","_id":"5729f771fcecb90e00b0a9c6","default":"","desc":"The client_id that is provided to you.","name":"client_id"},{"_id":"5729fe10fcecb90e00b0a9e3","default":"","desc":"The client_secret that is provided to you.","name":"client_secret","ref":"","required":true,"type":"string","in":"body"}],"results":{"codes":[{"code":"{\n  \"access_token\": \"y70kak2K0Rg7J4PAL8sdW0MutnGJEl\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 36000,\n  \"scope\": \"read write\"\n}","language":"json","status":200,"name":""},{"name":"","code":"{\n  \"error\": \"unsupported_grant_type\"\n}","language":"json","status":400},{"status":401,"language":"json","code":"{\n  \"error\": \"invalid_client\"\n}"}]},"settings":"5729f56e7f34182900ce9d55","url":"/oauth2/token/"},"excerpt":"","next":{"pages":[]},"childrenPages":[]}

postApplication Based Authentication


Body Params

grant_type:
required
stringclient_credentials
This describes the type of authentication.
client_id:
required
string
The client_id that is provided to you.
client_secret:
required
string
The client_secret that is provided to you.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb0063353987","excerpt":"","link_url":"","sync_unique":"","title":"User Based Authentication","updates":["579eefa0bf088a0e00b8cfbf"],"body":"","editedParams2":true,"user":"56a1c959842b650d0088899c","type":"post","githubsync":"","link_external":false,"order":1,"category":"5cb42aa4922aeb0063353976","hidden":false,"version":"5cb42aa4922aeb00633539a6","editedParams":true,"isReference":true,"parentDoc":null,"project":"56a1c9c13845200d0066d6fe","slug":"user-based-authentication","__v":4,"api":{"method":"post","params":[{"_id":"5729f771fcecb90e00b0a9c7","ref":"","in":"body","required":true,"desc":"This describes the type of authentication","default":"password","type":"string","name":"grant_type"},{"_id":"5729f771fcecb90e00b0a9c6","ref":"","in":"body","required":true,"desc":"The client_id that is provided to you.","default":"","type":"string","name":"client_id"},{"_id":"5729fe10fcecb90e00b0a9e3","ref":"","in":"body","required":true,"desc":"The client_secret that is provided to you.","default":"","type":"string","name":"client_secret"},{"_id":"57309f96b16ed73200ddd191","ref":"","in":"body","required":true,"desc":"Email or Username of the user.","default":"","type":"string","name":"username"},{"_id":"57309f96b16ed73200ddd190","ref":"","in":"body","required":true,"desc":"Password of the user.","default":"","type":"string","name":"password"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"access_token\": \"zsUhiZ9aiV1nG9nLRFPSXPS3smDREX\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 36000,\n  \"refresh_token\": \"oPorohVcpY5n7v7cS8biUKQZcvV5fT\",\n  \"scope\": \"read write\"\n}","name":""},{"language":"json","code":"{\n  \"error\": \"unsupported_grant_type\"\n}","name":"","status":400},{"code":"{\n  \"error_description\": \"Invalid credentials given.\",\n  \"error\": \"invalid_grant\"\n}","language":"json","status":401}]},"settings":"5729f56e7f34182900ce9d55","url":"/oauth2/token/","auth":"never","examples":{"codes":[{"language":"python","code":"import requests\nrequests.post('https://api.instamojo.com/oauth2/token/', data={\n    \t'grant_type': 'password',\n  \t\t'client_id': '21fe14a60057ece6c76496175cb0238a2ffd87be',\n    \t'client_secret': '-KWPoDO!_l?MZQ-DsZeQ0TXXcvuDn;mxmAtGho8Xijn=iH6F',\n      'username': 'foo@example.com',\n      'password': 'bar',\n})\n              "}]}},"createdAt":"2016-05-09T14:32:13.236Z","next":{"description":"","pages":[]},"childrenPages":[]}

postUser Based Authentication


Body Params

grant_type:
required
stringpassword
This describes the type of authentication
client_id:
required
string
The client_id that is provided to you.
client_secret:
required
string
The client_secret that is provided to you.
username:
required
string
Email or Username of the user.
password:
required
string
Password of the user.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb0063353988","editedParams":true,"excerpt":"","next":{"description":"","pages":[]},"type":"post","updates":[],"user":"56a1c959842b650d0088899c","sync_unique":"","__v":1,"createdAt":"2016-05-09T14:37:12.755Z","editedParams2":true,"hidden":false,"isReference":true,"parentDoc":null,"body":"","githubsync":"","project":"56a1c9c13845200d0066d6fe","title":"Refresh Token Based Authentication","version":"5cb42aa4922aeb00633539a6","slug":"refresh-token-based-authentication","api":{"examples":{"codes":[{"code":"import requests\nrequests.post('https://api.instamojo.com/oauth2/token/', data={\n    \t'grant_type': 'refresh_token',\n  \t\t'client_id': '21fe14a60057ece6c76496175cb0238a2ffd87be',\n    \t'client_secret': '-KWPoDO!_l?MZQ-DsZeQ0TXXcvuDn;mxmAtGho8Xijn=iH6F',\n      'refresh_token': 'oPorohVcpY5n7v7cS8biUKQZcvV5fT',\n})\n              ","language":"python"}]},"method":"post","params":[{"in":"body","_id":"5729f771fcecb90e00b0a9c7","default":"refresh_token","desc":"This describes the type of authentication.","name":"grant_type","ref":"","required":true,"type":"string"},{"default":"","desc":"The client_id that is provided to you.","name":"client_id","ref":"","required":true,"type":"string","in":"body","_id":"5729f771fcecb90e00b0a9c6"},{"required":true,"type":"string","in":"body","_id":"5729fe10fcecb90e00b0a9e3","default":"","desc":"The client_secret that is provided to you.","name":"client_secret","ref":""},{"required":true,"type":"string","in":"body","_id":"5730a09864726a2000043189","default":"","desc":"The refresh_token obtained from User Based Authentication.","name":"refresh_token","ref":""}],"results":{"codes":[{"code":"{\n  \"access_token\": \"9692b5d5279143058062e0ea6547ee\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 36000,\n  \"refresh_token\": \"6bf39817411b4102bff65ab85ef5ea\",\n  \"scope\": \"read write\"\n}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{\n  \"error\": \"unsupported_grant_type\"\n}"},{"language":"json","status":401,"code":"{\n  \"error\": \"invalid_grant\"\n}"}]},"settings":"5729f56e7f34182900ce9d55","url":"/oauth2/token/","auth":"never"},"category":"5cb42aa4922aeb0063353976","link_external":false,"link_url":"","order":2,"childrenPages":[]}

postRefresh Token Based Authentication


Body Params

grant_type:
required
stringrefresh_token
This describes the type of authentication.
client_id:
required
string
The client_id that is provided to you.
client_secret:
required
string
The client_secret that is provided to you.
refresh_token:
required
string
The refresh_token obtained from User Based Authentication.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb0063353989","createdAt":"2016-05-09T14:42:48.103Z","editedParams":true,"type":"post","user":"56a1c959842b650d0088899c","hidden":false,"parentDoc":null,"body":"","editedParams2":true,"githubsync":"","slug":"signup","updates":["58bb805920e8822300b0194a"],"api":{"params":[{"ref":"","in":"body","required":true,"desc":"Email id for the account.","default":"","type":"string","name":"email","_id":"5730a7346b55e93400b329ea"},{"in":"body","required":true,"desc":"The password for the account.","default":"","type":"string","name":"password","_id":"5730a22864726a200004318d","ref":""},{"required":true,"desc":"Phone number for the account","default":"","type":"string","name":"phone","_id":"5730a7346b55e93400b329e9","ref":"","in":"body"},{"ref":"","in":"body","required":true,"desc":"The referrer provided to you.","default":"","type":"string","name":"referrer","_id":"5730a7346b55e93400b329e8"}],"results":{"codes":[{"code":"{\n  \"id\": \"90f01dfdacbe4fe7892fc27dbdc30906\",\n  \"username\": \"foo\",\n  \"email\": \"foo@example.com\",\n  \"phone\": \"+919988776655\",\n  \"resource_uri\": \"https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/\",\n  \"promo_code\": null\n}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{\n  \"username\": [\n    \"Username is not available.\"\n  ],\n  \"email\": [\n    \"Email already exists.\"\n  ]\n}","name":""},{"code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}","language":"json","status":401}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/users/","auth":"required","examples":{"codes":[{"code":"import requests\nrequests.post(\n  'https://api.instamojo.com/v2/users/', \n  data={\n      'email': 'foo@example.com',\n      'password': 'bar',\n      'phone': '+919988776655',\n      'referrer': 'value-provided-to-you-by-instamojo',\n  },\n  headers={\n \t\t\t'Authorization': 'Bearer y70kak2K0Rg7J4PAL8sdW0MutnGJEl' \n  }\n)\n              ","language":"python"}]},"method":"post"},"excerpt":"This will create an account on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","link_external":false,"project":"56a1c9c13845200d0066d6fe","order":3,"sync_unique":"","title":"Signup","version":"5cb42aa4922aeb00633539a6","__v":5,"category":"5cb42aa4922aeb0063353976","isReference":true,"link_url":"","childrenPages":[]}

postSignup

This will create an account on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Body Params

email:
required
string
Email id for the account.
password:
required
string
The password for the account.
phone:
required
string
Phone number for the account
referrer:
required
string
The referrer provided to you.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398a","type":"patch","user":"56a1c959842b650d0088899c","__v":3,"excerpt":"This will updated the details of an account on Instamojo. You need to use a token that is obtained using the User Based Authentication.","githubsync":"","order":4,"project":"56a1c9c13845200d0066d6fe","sync_unique":"","version":"5cb42aa4922aeb00633539a6","link_external":false,"parentDoc":null,"slug":"update-details-of-a-user","title":"Update details of a user","updates":[],"link_url":"","api":{"method":"patch","params":[{"desc":"First name of the account.","default":"","type":"string","name":"first_name","_id":"5730a1e826bd5a3600d337a0","ref":"","in":"body","required":false},{"name":"last_name","_id":"5730a22864726a200004318d","ref":"","in":"body","required":false,"desc":"Last name of the account.","default":"","type":"string"},{"type":"string","name":"location","_id":"5730a7346b55e93400b329ea","ref":"","in":"body","required":false,"desc":"Location of the user.","default":""},{"desc":"Phone number of the user.","default":"","type":"string","name":"phone","_id":"5730af1219c1e00e006d209f","ref":"","in":"body","required":false},{"name":"id","_id":"58007494456c950f000e57f6","ref":"","in":"path","required":false,"desc":"","default":"","type":"string"}],"results":{"codes":[{"name":"","code":"{\n  \"id\": \"90f01dfdacbe4fe7892fc27dbdc30906\",\n  \"username\": \"foo\",\n  \"first_name\": \"Foo\",\n  \"last_name\": \"Bar\",\n  \"phone\": \"+919988776655\",\n  \"email\": \"foo@example.com\",\n  \"date_joined\": \"2016-05-09T15:08:29.060Z\",\n  \"is_email_verified\": false,\n  \"is_phone_verified\": false,\n  \"bio\": \"\",\n  \"location\": \"India\",\n  \"public_phone\": null,\n  \"public_email\": null,\n  \"public_website\": null,\n  \"avatar_image_url\": null,\n  \"profile_image_url\": null,\n  \"tags\": [],\n  \"resource_uri\": \"https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/\"\n}","language":"json","status":200},{"name":"","code":"{\n  \"phone\": [\n    \"Enter a valid phone number\"\n  ]\n}","language":"json","status":400},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"},{"code":"{\n  \"success\": false,\n  \"message\": \"Not found\"\n}","language":"json","status":404}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/users/:id/","auth":"required","examples":{"codes":[{"code":"import requests\nrequests.patch(\n  'https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/', \n  data={\n    \t'first_name': 'Foo',\n      'last_name': 'Bar',\n      'location': 'India'\n    \t'phone': '+919988776655'\n  },\n  headers={\n \t\t\t'Authorization': 'Bearer n9kmKzF0DzbP5jIKZk8gJO0mOr4W0t' \n  }\n)\n              ","language":"python"}]}},"body":"","category":"5cb42aa4922aeb0063353976","createdAt":"2016-05-09T15:19:23.549Z","editedParams":true,"editedParams2":true,"hidden":false,"isReference":true,"childrenPages":[]}

patchUpdate details of a user

This will updated the details of an account on Instamojo. You need to use a token that is obtained using the User Based Authentication.

Path Params

id:
string

Body Params

first_name:
string
First name of the account.
last_name:
string
Last name of the account.
location:
string
Location of the user.
phone:
string
Phone number of the user.

User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398b","link_external":false,"order":5,"parentDoc":null,"slug":"update-bank-details-of-a-user","title":"Update bank details of a user","user":"56a1c959842b650d0088899c","body":"","editedParams":true,"hidden":false,"link_url":"","project":"56a1c9c13845200d0066d6fe","sync_unique":"","type":"put","version":"5cb42aa4922aeb00633539a6","api":{"auth":"required","examples":{"codes":[{"code":"import requests\nrequests.put(\n  'https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/inrbankaccount/', \n  data={\n    \t'account_holder_name': 'Foo Bar',\n      'account_number': '123456789',\n      'ifsc_code': 'SBIN0000111'\n  },\n  headers={\n \t\t\t'Authorization': 'Bearer n9kmKzF0DzbP5jIKZk8gJO0mOr4W0t' \n  }\n)\n              ","language":"python"}]},"method":"put","params":[{"default":"","type":"string","name":"account_holder_name","_id":"5730a1e826bd5a3600d337a0","ref":"","in":"body","required":true,"desc":"Name of account holder."},{"default":"","type":"string","name":"account_number","_id":"5730a22864726a200004318d","ref":"","in":"body","required":true,"desc":"Bank account number."},{"in":"body","required":true,"desc":"IFSC code of the branch.","default":"","type":"string","name":"ifsc_code","_id":"5730a7346b55e93400b329ea","ref":""},{"required":false,"desc":"","default":"","type":"string","name":"id","_id":"58007520704ea60f0044acda","ref":"","in":"path"}],"results":{"codes":[{"name":"","code":"{\n  \"user\": \"https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/\",\n  \"account_holder_name\": \"Foo Bar\",\n  \"bank_name\": \"\",\n  \"account_number\": \"123456789\",\n  \"ifsc_code\": \"SBIN0000111\",\n  \"updated_at\": \"2016-05-09T15:40:50.715Z\"\n}","language":"json","status":200},{"name":"","code":"{\n  \"ifsc_code\": [\n    \"This field is required.\"\n  ],\n  \"account_holder_name\": [\n    \"This field is required.\"\n  ],\n  \"account_number\": [\n    \"This field is required.\"\n  ]\n}","language":"json","status":400},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"},{"code":"{\n  \"success\": false,\n  \"message\": \"Not found\"\n}","language":"json","status":404}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/users/:id/inrbankaccount/"},"excerpt":"This will update the bank account details of an account on Instamojo. You need to use a token that is obtained using the User Based Authentication.","createdAt":"2016-05-09T15:42:09.464Z","updates":[],"__v":1,"githubsync":"","isReference":true,"category":"5cb42aa4922aeb0063353976","editedParams2":true,"childrenPages":[]}

putUpdate bank details of a user

This will update the bank account details of an account on Instamojo. You need to use a token that is obtained using the User Based Authentication.

Path Params

id:
string

Body Params

account_holder_name:
required
string
Name of account holder.
account_number:
required
string
Bank account number.
ifsc_code:
required
string
IFSC code of the branch.

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398c","order":6,"title":"Create a Payment Request","type":"post","link_external":false,"isReference":true,"next":{"description":"","pages":[]},"project":"56a1c9c13845200d0066d6fe","sync_unique":"","parentDoc":null,"slug":"create-a-payment-request","updates":[],"user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","editedParams2":true,"api":{"auth":"required","examples":{"codes":[{"code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\npayload = {\n  'purpose': 'FIFA 16',\n  'amount': '2500',\n  'buyer_name': 'John Doe',\n  'email': 'foo@example.com',\n  'phone': '9999999999',\n  'redirect_url': 'http://www.example.com/redirect/',\n  'send_email': 'True',\n  'send_sms': 'True',\n  'webhook': 'http://www.example.com/webhook/',\n  'allow_repeated_payments': 'False',\n}\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/payment_requests/\", \n  data=payload, \n  headers=headers\n)              ","language":"python"}]},"method":"post","params":[{"_id":"5730b6f626bd5a3600d337e8","ref":"","in":"body","required":true,"desc":"The amount for the request. The minimum amount is 9. And the maximum is 200000.","default":"","type":"double","name":"amount"},{"_id":"5730b6f626bd5a3600d337e7","ref":"","in":"body","required":true,"desc":"Purpose of the payment request.","default":"","type":"string","name":"purpose"},{"_id":"5730b6f626bd5a3600d337e6","ref":"","in":"body","required":false,"desc":"Name of payer","default":"","type":"string","name":"buyer_name"},{"_id":"5730b6f626bd5a3600d337e5","ref":"","in":"body","required":false,"desc":"Email of payer","default":"","type":"string","name":"email"},{"_id":"5730b6f626bd5a3600d337e4","ref":"","in":"body","required":false,"desc":"Phone number of payer","default":"","type":"string","name":"phone"},{"_id":"5730b6f626bd5a3600d337e3","ref":"","in":"body","required":false,"desc":"URL where we redirect the user after a payment. If provided, we will redirect the user to `redirect_url` immediately after the payment has been processed. Three additional query arguments `payment_request_id`, `payment_status` and `payment_id` are also sent with the redirect URL.","default":"","type":"string","name":"redirect_url"},{"_id":"5730b6f626bd5a3600d337e2","ref":"","in":"body","required":false,"desc":"URL where our server do POST request after a payment  If provided, we will do a the POST request to the webhook (url) with full details of the payment","default":"","type":"string","name":"webhook"},{"_id":"5730b6f626bd5a3600d337e1","ref":"","in":"body","required":false,"desc":"If `allow_repeated_payments` is `false`, only one payment can be paid on a payment request link. `allow_repeated_payments` is `true` by default.","default":"True","type":"boolean","name":"allow_repeated_payments"},{"_id":"5730b6f626bd5a3600d337df","ref":"","in":"body","required":false,"desc":"Flag to send request link via email.  If `send_email` is `true`, a request email will be sent to the email supplied. If `send_email` is `true` but no email is supplied, request creation will throw an error.","default":"False","type":"boolean","name":"send_email"},{"_id":"5730b6f626bd5a3600d337de","ref":"","in":"body","required":false,"desc":"Flag to send request link via SMS.  If `send_sms` is `true`, a request SMS will be sent to the phone number supplied. If `send_sms` is `true` but no phone number is supplied, request creation will throw an error.","default":"False","type":"boolean","name":"send_sms"},{"_id":"58fdf14fc1e51e19004127ca","ref":"","in":"body","required":false,"desc":"Time after which the payment request will be expired in UTC timestamp. Max value is 600 seconds. Default is Null","default":"","type":"datetime","name":"expires_at"}],"results":{"codes":[{"name":"","code":"{\n  \"id\": \"05f317448ad84649aa1a9c7328edb015\",\n  \"user\": \"https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/\",\n  \"phone\": \"+919999999999\",\n  \"email\": \"foo@example.com\",\n  \"buyer_name\": \"John Doe\",\n  \"amount\": \"2500\",\n  \"purpose\": \"FIFA 16\",\n  \"status\": \"Pending\",\n  \"payments\": [],\n  \"send_sms\": true,\n  \"send_email\": true,\n  \"sms_status\": \"Pending\",\n  \"email_status\": \"Pending\",\n  \"shorturl\": null,\n  \"longurl\": \"https://www.instamojo.com/@foo/05f317448ad84649aa1a9c7328edb015\",\n  \"redirect_url\": \"http://www.example.com/redirect/\",\n  \"webhook\": \"http://www.example.com/webhook/\",\n  \"created_at\": \"2016-05-09T16:10:13.786Z\",\n  \"modified_at\": \"2016-05-09T16:10:13.786Z\",\n  \"resource_uri\": \"https://api.instamojo.com/v2/payment_requests/05f317448ad84649aa1a9c7328edb015/\",\n  \"allow_repeated_payments\": false,\n  \"mark_fulfilled\": true\n}","language":"json","status":200},{"name":"","code":"{\n  \"purpose\": [\n    \"This field is required.\"\n  ],\n  \"amount\": [\n    \"This field is required.\"\n  ]\n}","language":"json","status":400},{"code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}","status":401,"language":"json"}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/payment_requests/"},"body":"","category":"5cb42aa4922aeb0063353976","createdAt":"2016-05-09T16:12:38.478Z","editedParams":true,"excerpt":"This will create a payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","githubsync":"","__v":7,"link_url":"","hidden":false,"childrenPages":[]}

postCreate a Payment Request

This will create a payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Body Params

amount:
required
double
The amount for the request. The minimum amount is 9. And the maximum is 200000.
purpose:
required
string
Purpose of the payment request.
buyer_name:
string
Name of payer
email:
string
Email of payer
phone:
string
Phone number of payer
redirect_url:
string
URL where we redirect the user after a payment. If provided, we will redirect the user to `redirect_url` immediately after the payment has been processed. Three additional query arguments `payment_request_id`, `payment_status` and `payment_id` are also sent with the redirect URL.
webhook:
string
URL where our server do POST request after a payment If provided, we will do a the POST request to the webhook (url) with full details of the payment
allow_repeated_payments:
booleanTrue
If `allow_repeated_payments` is `false`, only one payment can be paid on a payment request link. `allow_repeated_payments` is `true` by default.
send_email:
booleanFalse
Flag to send request link via email. If `send_email` is `true`, a request email will be sent to the email supplied. If `send_email` is `true` but no email is supplied, request creation will throw an error.
send_sms:
booleanFalse
Flag to send request link via SMS. If `send_sms` is `true`, a request SMS will be sent to the phone number supplied. If `send_sms` is `true` but no phone number is supplied, request creation will throw an error.
expires_at:
datetime
Time after which the payment request will be expired in UTC timestamp. Max value is 600 seconds. Default is Null

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398d","api":{"method":"get","params":[{"_id":"5800752e039bda2300152195","ref":"","in":"path","required":false,"desc":"","default":"","type":"string","name":"id"}],"results":{"codes":[{"name":"","code":"{\n  \"id\": \"05f317448ad84649aa1a9c7328edb015\",\n  \"user\": \"https://api.instamojo.com/v2/users/90f01dfdacbe4fe7892fc27dbdc30906/\",\n  \"phone\": \"+919999999999\",\n  \"email\": \"foo@example.com\",\n  \"buyer_name\": \"John Doe\",\n  \"amount\": \"2500\",\n  \"purpose\": \"FIFA 16\",\n  \"status\": \"Pending\",\n  \"payments\": [],\n  \"send_sms\": true,\n  \"send_email\": true,\n  \"sms_status\": \"Pending\",\n  \"email_status\": \"Pending\",\n  \"shorturl\": null,\n  \"longurl\": \"https://www.instamojo.com/@foo/05f317448ad84649aa1a9c7328edb015\",\n  \"redirect_url\": \"http://www.example.com/redirect/\",\n  \"webhook\": \"http://www.example.com/webhook/\",\n  \"created_at\": \"2016-05-09T16:10:13.786Z\",\n  \"modified_at\": \"2016-05-09T16:10:13.786Z\",\n  \"resource_uri\": \"https://api.instamojo.com/v2/payment_requests/05f317448ad84649aa1a9c7328edb015/\",\n  \"allow_repeated_payments\": false,\n  \"mark_fulfilled\": true\n}","language":"json","status":200},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/payment_requests/:id/","auth":"required","examples":{"codes":[{"code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\n\nresponse = requests.get(\n  \"https://api.instamojo.com/v2/payment_requests/9ef9b530ff8e440dbbc29f2157bc69ad/\", \n  headers=headers\n)              ","language":"python"}]}},"githubsync":"","isReference":true,"order":7,"project":"56a1c9c13845200d0066d6fe","sync_unique":"","body":"","link_external":false,"parentDoc":null,"type":"get","user":"56a1c959842b650d0088899c","category":"5cb42aa4922aeb0063353976","excerpt":"This will fetch the details of a payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","link_url":"","slug":"get-a-payment-request","updates":[],"version":"5cb42aa4922aeb00633539a6","__v":7,"createdAt":"2016-05-09T16:16:00.073Z","hidden":false,"next":{"description":"","pages":[]},"title":"Get a Payment Request","childrenPages":[]}

getGet a Payment Request

This will fetch the details of a payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

id:
string

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb00633539a1","project":"56a1c9c13845200d0066d6fe","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353976","user":"56a1c959842b650d0088899c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-03T07:47:24.158Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\n\nresponse = requests.get(\n  \"https://api.instamojo.com/v2/payments/MOJO7726005A06926769/\", \n  headers=headers\n)","language":"python"}]},"settings":"5729f56e7f34182900ce9d55","results":{"codes":[{"name":"","code":"{\n    \"id\": \"MOJO7726005A06926769\",\n    \"status\": true,\n    \"seller\": \"https://api.instamojo.com/v2/users/5b75694e1c1b498c9ceabed9cd5719cf/\",\n    \"currency\": \"INR\",\n    \"amount\": \"50.00\",\n    \"name\": \"Buyer Name\",\n    \"email\": \"buyer@instamojo.com\",\n    \"phone\": \"+919595959595\",\n    \"fees\": \"5.00\",\n    \"total_taxes\": \"0.50\",\n    \"instrument_type\": \"CARD\",\n\t\t\"billing_instrument\": \"Domestic Regular Credit Card (Visa/Mastercard)\",\n\t\t\n    \"payout\": {\n\t\t\"id\": \"MOJO8425001M94982125\",\n\t\t\"paid_out_at\": \"2017-07-30T09:24:45.987364Z\"\n\t\t},\n    \n    \"failure\": null,\n    \"created_at\": \"2017-07-26T12:45:23.431453Z\",\n    \"updated_at\": \"2017-07-26T23:31:39.020180Z\",\n    \"resource_uri\": \"https://api.instamojo.com/v2/payments/MOJO7726005A06926769/\"\n}","language":"json","status":200},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"}]},"method":"get","auth":"required","params":[{"_id":"5800752e039bda2300152195","ref":"","in":"path","required":false,"desc":"Payment ID","default":"","type":"string","name":"id"}],"url":"/v:version/payments/:id/"},"isReference":true,"order":8,"body":"[block:api-header]\n{\n  \"title\": \"Response Fields\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field Name\",\n    \"h-1\": \"Possible Values\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"status\",\n    \"0-1\": \"* true\\n* false\\n* null\",\n    \"0-2\": \"Indicates the status of the payment.\\n\\n* **true** => Successful\\n* **false** => Failed\\n* **null** => Initiated\",\n    \"1-0\": \"instrument_type\",\n    \"1-1\": \"* CARD \\n* EMI\\n* NETBANKING\\n* UPI\\n* WALLET\",\n    \"1-2\": \"Indicates the instrument type used for the payment.\",\n    \"2-0\": \"failure\",\n    \"2-1\": \"* null\\n* Object:\\n  * reason\\n  * message\",\n    \"2-2\": \"Gives the failure reason of why the payment failed. This will have non-null values for failed payments only.\\n\\nreason => Type of failure.\\nmessage => Failure message returned by upstream provider.\",\n    \"3-0\": \"billing_instrument\",\n    \"3-1\": \"* null\\n* Unknown card\\n* Domestic Regular Credit Card (Visa/Mastercard)\\n* Domestic Premium Credit/Charge Card (Amex/Diners)\\n* Domestic Regular Debit Card (Visa/Mastercard)\\n* International Regular Credit Card (Visa/Mastercard)\\n* International Premium Credit/Charge Card (Amex/Diners)\\n* International Regular Debit Card\\n* Domestic Netbanking Category A (HDFC/ICICI)\\n* Domestic Netbanking Category B (Other banks)\\n* Wallet\\n* UPI\\n* Unknown netbanking choice\\n* EMI Payment\\n* Bank Transfer\",\n    \"3-2\": \"Gives the subcategory of the 'instrument_type' that was used to make the Payment.\",\n    \"4-0\": \"payout\",\n    \"4-1\": \"* null\\n* Object:\\n  * id\\n  * paid_out_at\",\n    \"4-2\": \"Gives you the Payout details once the Payout has been processed. \\n\\nThe response will be 'null' for the cases where the Payout has not been processed yet.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]","excerpt":"This will fetch the details of a payment on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","slug":"get-payment-details","type":"get","title":"Get Payment Details","__v":4,"parentDoc":null,"childrenPages":[]}

getGet Payment Details

This will fetch the details of a payment on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

id:
string
Payment ID
[block:api-header] { "title": "Response Fields" } [/block] [block:parameters] { "data": { "h-0": "Field Name", "h-1": "Possible Values", "h-2": "Description", "0-0": "status", "0-1": "* true\n* false\n* null", "0-2": "Indicates the status of the payment.\n\n* **true** => Successful\n* **false** => Failed\n* **null** => Initiated", "1-0": "instrument_type", "1-1": "* CARD \n* EMI\n* NETBANKING\n* UPI\n* WALLET", "1-2": "Indicates the instrument type used for the payment.", "2-0": "failure", "2-1": "* null\n* Object:\n * reason\n * message", "2-2": "Gives the failure reason of why the payment failed. This will have non-null values for failed payments only.\n\nreason => Type of failure.\nmessage => Failure message returned by upstream provider.", "3-0": "billing_instrument", "3-1": "* null\n* Unknown card\n* Domestic Regular Credit Card (Visa/Mastercard)\n* Domestic Premium Credit/Charge Card (Amex/Diners)\n* Domestic Regular Debit Card (Visa/Mastercard)\n* International Regular Credit Card (Visa/Mastercard)\n* International Premium Credit/Charge Card (Amex/Diners)\n* International Regular Debit Card\n* Domestic Netbanking Category A (HDFC/ICICI)\n* Domestic Netbanking Category B (Other banks)\n* Wallet\n* UPI\n* Unknown netbanking choice\n* EMI Payment\n* Bank Transfer", "3-2": "Gives the subcategory of the 'instrument_type' that was used to make the Payment.", "4-0": "payout", "4-1": "* null\n* Object:\n * id\n * paid_out_at", "4-2": "Gives you the Payout details once the Payout has been processed. \n\nThe response will be 'null' for the cases where the Payout has not been processed yet." }, "cols": 3, "rows": 5 } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:api-header] { "title": "Response Fields" } [/block] [block:parameters] { "data": { "h-0": "Field Name", "h-1": "Possible Values", "h-2": "Description", "0-0": "status", "0-1": "* true\n* false\n* null", "0-2": "Indicates the status of the payment.\n\n* **true** => Successful\n* **false** => Failed\n* **null** => Initiated", "1-0": "instrument_type", "1-1": "* CARD \n* EMI\n* NETBANKING\n* UPI\n* WALLET", "1-2": "Indicates the instrument type used for the payment.", "2-0": "failure", "2-1": "* null\n* Object:\n * reason\n * message", "2-2": "Gives the failure reason of why the payment failed. This will have non-null values for failed payments only.\n\nreason => Type of failure.\nmessage => Failure message returned by upstream provider.", "3-0": "billing_instrument", "3-1": "* null\n* Unknown card\n* Domestic Regular Credit Card (Visa/Mastercard)\n* Domestic Premium Credit/Charge Card (Amex/Diners)\n* Domestic Regular Debit Card (Visa/Mastercard)\n* International Regular Credit Card (Visa/Mastercard)\n* International Premium Credit/Charge Card (Amex/Diners)\n* International Regular Debit Card\n* Domestic Netbanking Category A (HDFC/ICICI)\n* Domestic Netbanking Category B (Other banks)\n* Wallet\n* UPI\n* Unknown netbanking choice\n* EMI Payment\n* Bank Transfer", "3-2": "Gives the subcategory of the 'instrument_type' that was used to make the Payment.", "4-0": "payout", "4-1": "* null\n* Object:\n * id\n * paid_out_at", "4-2": "Gives you the Payout details once the Payout has been processed. \n\nThe response will be 'null' for the cases where the Payout has not been processed yet." }, "cols": 3, "rows": 5 } [/block]
{"_id":"5cb42aa4922aeb00633539a2","project":"56a1c9c13845200d0066d6fe","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353976","user":"56a1c959842b650d0088899c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-21T08:45:07.979Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n  \"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\npayload = {\n  settlement_id='1234',\n  submerchant='1b0a9c20bb0b99cdef3',\n  amount='100',\n  type='CREDIT',\n}\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/payments/MOJO1234/settlements\", \n  data=payload, \n  headers=headers\n)              "}]},"results":{"codes":[{"name":"","code":"{\n  'settlement_id': \"1234\", \n  'submerchant': \"e1d62744e68a4a8bb49abfc72878b661\", \n  'created': \"2018-06-22T07:58:11.193837Z\", \n  'amount': \"10\",\n  'type': \"CREDIT\", \n  'success': True,\n  'message': \"Settlement created\"\n}","language":"json","status":200},{"name":"","code":"{\n  \"amount\": [\n    \"A valid number is required.\"\n  ]\n}\n","language":"json","status":400},{"code":"{\"success\": false,\n \"message\": \"Duplicate settlement id\"}","language":"json","status":409},{"code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}","language":"json","status":401},{"code":"","language":"text","status":404}]},"settings":"5729f56e7f34182900ce9d55","auth":"required","params":[{"_id":"5b2b6a6107db260003fa6fb1","ref":"","in":"path","required":false,"desc":"Payment ID","default":"","type":"string","name":"payment_id"},{"_id":"5b2b6a6107db260003fa6fb0","ref":"","in":"header","required":false,"desc":"","default":"","type":"string","name":"Authorization"},{"_id":"5b2b6a6107db260003fa6faf","ref":"","in":"body","required":false,"desc":"Unique settlement id for each payment","default":"","type":"string","name":"settlement_id"},{"_id":"5b2b6a6107db260003fa6fae","ref":"","in":"body","required":false,"desc":"Can be 'CREDIT' or 'DEBIT'. Credit transfers the amount from one's own account to user's and debit transfers amount from user's account to one's own.","default":"","type":"string","name":"type"},{"_id":"5b2b6a6107db260003fa6fad","ref":"","in":"body","required":false,"desc":"The Instamojo account id of the user from/to money is to be transferred. It was obtained on registering a merchant using Signup API.","default":"","type":"string","name":"submerchant"},{"_id":"5b2b6a6107db260003fa6fac","ref":"","in":"body","required":false,"desc":"Must be a positive number.","default":"","type":"double","name":"amount"}],"url":"/v2/payments/:payment_id/settlements/","method":"post"},"isReference":true,"order":9,"body":"","excerpt":"This will create a settlement request on Instamojo. You need to use a token that is obtained using the Application Based Authentication. This allows marketplaces to transfer money to merchants on whose behalf they have accepted payments. Money can also be transferred from merchants to marketplace accounts in case of refunds.","slug":"settlement-api","type":"post","title":"Create a Settlement","__v":15,"parentDoc":null,"childrenPages":[]}

postCreate a Settlement

This will create a settlement request on Instamojo. You need to use a token that is obtained using the Application Based Authentication. This allows marketplaces to transfer money to merchants on whose behalf they have accepted payments. Money can also be transferred from merchants to marketplace accounts in case of refunds.

Path Params

payment_id:
string
Payment ID

Body Params

settlement_id:
string
Unique settlement id for each payment
type:
string
Can be 'CREDIT' or 'DEBIT'. Credit transfers the amount from one's own account to user's and debit transfers amount from user's account to one's own.
submerchant:
string
The Instamojo account id of the user from/to money is to be transferred. It was obtained on registering a merchant using Signup API.
amount:
double
Must be a positive number.

Headers

Authorization:
string

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398f","__v":2,"body":"","category":"5cb42aa4922aeb0063353976","title":"Fulfil a Payment","type":"post","version":"5cb42aa4922aeb00633539a6","updates":[],"githubsync":"","isReference":true,"link_url":"","order":10,"parentDoc":null,"project":"56a1c9c13845200d0066d6fe","api":{"method":"post","params":[{"_id":"58007542704ea60f0044acdb","ref":"","in":"path","required":false,"desc":"","default":"","type":"string","name":"payment_id"}],"results":{"codes":[{"code":"{\n  \"fulfil\": true,\n  \"success\": true\n}","language":"json","status":200,"name":""},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"}]},"settings":"5729f56e7f34182900ce9d55","url":"/v2/payments/:payment_id/fulfil/","auth":"required","examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer y70kak2K0Rg7J4PAL8sdW0MutnGJEl\"\n}\n\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/payments/MOJO5c04000J30502939/fulfil/\", \n  headers=headers\n)              "}]}},"excerpt":"This will transfer the remaining payment amount to your account. You need to use a token that is obtained using the Application Based Authentication.","hidden":false,"link_external":false,"sync_unique":"","createdAt":"2016-08-29T12:26:13.853Z","slug":"fulfil-a-payment","user":"56a1c959842b650d0088899c","next":{"description":"","pages":[]},"childrenPages":[]}

postFulfil a Payment

This will transfer the remaining payment amount to your account. You need to use a token that is obtained using the Application Based Authentication.

Path Params

payment_id:
string

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb00633539a3","project":"56a1c9c13845200d0066d6fe","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353976","user":"56a1c959842b650d0088899c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-21T09:10:21.619Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{'count': 200, 'next': 'http://testserver/v2/payments/MOJO8625000M09751351/settlements/?page=2', 'previous': None, 'settlements': [{'settlement_id': '0', 'created': '2018-06-25T11:02:37.274722Z', 'submerchant': 'dd330bc4126a4111828b79e0c0521113', 'amount': '1.00', 'type': 'CREDIT'}, {'settlement_id': '200', 'created': '2018-06-25T11:02:37.290488Z', 'submerchant': 'dd330bc4126a4111828b79e0c0521113', 'amount': '0.50', 'type': 'DEBIT'},  {'settlement_id': '24', 'created': '2018-06-25T11:02:37.928937Z', 'submerchant': 'dd330bc4126a4111828b79e0c0521113', 'amount': '1.00', 'type': 'CREDIT'}, {'settlement_id': '224', 'created': '2018-06-25T11:02:37.942256Z', 'submerchant': 'dd330bc4126a4111828b79e0c0521113', 'amount': '0.50', 'type': 'DEBIT'}]}","name":""},{"status":400,"language":"json","code":"{}","name":""},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"},{"status":404,"language":"json","code":""}]},"settings":"5729f56e7f34182900ce9d55","auth":"required","params":[{"_id":"5b2b6c25091c340003723f02","ref":"","in":"path","required":false,"desc":"Payment ID","default":"","type":"string","name":"payment_id"}],"url":"/v2/payments/:payment_id/settlements/","examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n  \"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\n\nresponse = requests.get(\n  \"https://api.instamojo.com/v2/payments/MOJO1234/settlements/9ef9b530ff8e440dbbc29f2157bc69ad/\", \n  headers=headers\n)              "}]},"method":"get"},"isReference":true,"order":11,"body":"","excerpt":"This will fetch the details of settlements for a payment on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","slug":"get-settlements-for-a-payment","type":"get","title":"Get settlements for a Payment","__v":7,"parentDoc":null,"childrenPages":[]}

getGet settlements for a Payment

This will fetch the details of settlements for a payment on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

payment_id:
string
Payment ID

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335398e","editedParams":true,"excerpt":"This will refund a payment made on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","hidden":false,"link_url":"","order":12,"parentDoc":null,"type":"post","editedParams2":true,"isReference":true,"updates":[],"__v":2,"api":{"settings":"5729f56e7f34182900ce9d55","url":"/v2/payments/:payment_id/refund/","auth":"required","examples":{"codes":[{"code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\n\npayload = {\n\t'type': 'TNR',\n  'body': 'Need to refund to the buyer.',\n  'refund_amount': '100'\n}\n\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/payments/MOJO5c04000J30502939/refund/\", \n  headers=headers,\n  data=payload\n)              ","language":"python"}]},"method":"post","params":[{"_id":"5730b9f7053a062b00cf464a","ref":"","in":"body","required":true,"desc":"A three letter short-code identifying the reason for this case.","default":"","type":"string","name":"type"},{"_id":"5730b9f7053a062b00cf4649","ref":"","in":"body","required":true,"desc":"Additonal text explaining the refund.","default":"","type":"string","name":"body"},{"_id":"5730b9f7053a062b00cf4648","ref":"","in":"body","required":true,"desc":"This field can be used to specify the refund amount. For instance, you may want to issue a refund for an amount lesser than what was paid.","default":"","type":"string","name":"refund_amount"},{"_id":"58007538456c950f000e57f7","ref":"","in":"path","required":false,"desc":"","default":"","type":"string","name":"payment_id"}],"results":{"codes":[{"name":"","code":"{\n    \"refund\": {\n        \"id\": \"C5c0751269\",\n        \"payment_id\": \"MOJO5c04000J30502939\",\n        \"status\": \"Refunded\",\n        \"type\": \"QFL\",\n        \"body\": \"Customer isn't satisfied with the quality\",\n        \"refund_amount\": \"100\",\n        \"total_amount\": \"100.00\",\n        \"created_at\": \"2015-12-07T11:01:37.640Z\"\n    },\n    \"success\": true\n}","language":"json","status":200},{"status":401,"language":"json","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"}]}},"link_external":false,"project":"56a1c9c13845200d0066d6fe","slug":"create-a-refund","title":"Create a Refund","version":"5cb42aa4922aeb00633539a6","body":"Valid values for type are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"RFD\",\n    \"0-1\": \"Duplicate/delayed payment.\",\n    \"1-1\": \"Product/service no longer available.\",\n    \"2-1\": \"Customer not satisfied.\",\n    \"3-1\": \"Product lost/damaged.\",\n    \"4-1\": \"Digital download issue.\",\n    \"5-1\": \"Event was canceled/changed.\",\n    \"6-1\": \"Problem not described above.\",\n    \"1-0\": \"TNR\",\n    \"2-0\": \"QFL\",\n    \"6-0\": \"PTH\",\n    \"5-0\": \"TAN\",\n    \"4-0\": \"EWN\",\n    \"3-0\": \"QNR\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]","category":"5cb42aa4922aeb0063353976","createdAt":"2016-05-09T16:25:27.295Z","githubsync":"","sync_unique":"","user":"56a1c959842b650d0088899c","next":{"description":"","pages":[]},"childrenPages":[]}

postCreate a Refund

This will refund a payment made on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

payment_id:
string

Body Params

type:
required
string
A three letter short-code identifying the reason for this case.
body:
required
string
Additonal text explaining the refund.
refund_amount:
required
string
This field can be used to specify the refund amount. For instance, you may want to issue a refund for an amount lesser than what was paid.
Valid values for type are: [block:parameters] { "data": { "h-0": "Type", "h-1": "Description", "0-0": "RFD", "0-1": "Duplicate/delayed payment.", "1-1": "Product/service no longer available.", "2-1": "Customer not satisfied.", "3-1": "Product lost/damaged.", "4-1": "Digital download issue.", "5-1": "Event was canceled/changed.", "6-1": "Problem not described above.", "1-0": "TNR", "2-0": "QFL", "6-0": "PTH", "5-0": "TAN", "4-0": "EWN", "3-0": "QNR" }, "cols": 2, "rows": 7 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Valid values for type are: [block:parameters] { "data": { "h-0": "Type", "h-1": "Description", "0-0": "RFD", "0-1": "Duplicate/delayed payment.", "1-1": "Product/service no longer available.", "2-1": "Customer not satisfied.", "3-1": "Product lost/damaged.", "4-1": "Digital download issue.", "5-1": "Event was canceled/changed.", "6-1": "Problem not described above.", "1-0": "TNR", "2-0": "QFL", "6-0": "PTH", "5-0": "TAN", "4-0": "EWN", "3-0": "QNR" }, "cols": 2, "rows": 7 } [/block]
{"_id":"5cb42aa4922aeb006335399f","body":"","excerpt":"This will enable the payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","link_external":false,"slug":"enable-a-request","type":"post","__v":1,"hidden":false,"sync_unique":"","api":{"settings":"5729f56e7f34182900ce9d55","url":"/v2/payment_requests/:id/enable/","auth":"required","examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer fRPB9REdsmD7C2qX9uJolWPhsIu4Tc\"\n}\nresponse = requests.post(\n \"https://api.instamojo.com/v2/payment_requests/6a04501b03964ce4874711566e84fabb/enable/\", headers=headers\n) "}]},"method":"post","params":[{"_id":"590b2e39c0161e1900953777","ref":"","in":"path","required":true,"desc":"","default":"","type":"string","name":"id"}],"results":{"codes":[{"code":"{\n    \"success\": true\n}","name":"","status":200,"language":"json"}]}},"githubsync":"","order":13,"project":"56a1c9c13845200d0066d6fe","updates":[],"createdAt":"2017-05-04T13:35:53.608Z","isReference":true,"link_url":"","next":{"pages":[],"description":""},"title":"Enable a Request","user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353976","parentDoc":null,"childrenPages":[]}

postEnable a Request

This will enable the payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

id:
required
string

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335399e","api":{"url":"/v2/payment_requests/:id/disable/","auth":"required","examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer fRPB9REdsmD7C2qX9uJolWPhsIu4Tc\"\n}\nresponse = requests.post(\n \"https://api.instamojo.com/v2/payment_requests/6a04501b03964ce4874711566e84fabb/disable/\", headers=headers\n) "}]},"method":"post","params":[{"_id":"590b2d5ed0a41e23001aade6","ref":"","in":"path","required":true,"desc":"","default":"","type":"string","name":"id"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"success\": true\n}","name":""}]},"settings":"5729f56e7f34182900ce9d55"},"body":"","next":{"pages":[],"description":""},"sync_unique":"","user":"56a1c959842b650d0088899c","category":"5cb42aa4922aeb0063353976","createdAt":"2017-05-04T13:32:14.473Z","hidden":false,"isReference":true,"slug":"disable-a-request","title":"Disable a Request","type":"post","version":"5cb42aa4922aeb00633539a6","__v":1,"excerpt":"This will disable the payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","link_external":false,"link_url":"","order":14,"project":"56a1c9c13845200d0066d6fe","updates":[],"githubsync":"","parentDoc":null,"childrenPages":[]}

postDisable a Request

This will disable the payment request on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Path Params

id:
required
string

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb0063353990","type":"post","user":"56a1c959842b650d0088899c","body":"","githubsync":"","hidden":false,"isReference":true,"link_url":"","next":{"description":"","pages":[]},"version":"5cb42aa4922aeb00633539a6","__v":1,"excerpt":"This will create a Order on Instamojo. You need to use a token that is obtained using the Application Based Authentication.","parentDoc":null,"project":"56a1c9c13845200d0066d6fe","sync_unique":"","slug":"create-an-order-using-payment-request-id","title":"Create an Order using Payment Request ID","updates":[],"api":{"settings":"5729f56e7f34182900ce9d55","url":"/v2/gateway/orders/payment-request/","auth":"required","examples":{"codes":[{"language":"python","code":"import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer n9kmKzFODibP5jIKVk8gJO0NOr4W0t\"\n}\npayload = {\n  'id': '9c337d3c5e3242fca818937366b915b4',\n}\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/gateway/orders/payment-request/\", \n  data=payload, \n  headers=headers\n)      "}]},"method":"post","params":[{"_id":"583803120bd5ea190004b72d","ref":"","in":"body","required":false,"desc":"Payment Request ID","default":"","type":"string","name":"id"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"order_id\": \"3b56d216-74c2-4189-83f3-9c2e93bad1be\",\n  \"name\": \"Vedhavyas\",\n  \"email\": \"vedhavyas@instamojo.com\",\n  \"phone\": \"+919663445546\",\n  \"amount\": \"100.00\"\n}"},{"status":400,"language":"json","code":"{\n  \"id\": [\n    \"This field is required.\"\n  ]\n}","name":""},{"status":401,"language":"text","code":"{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"}]}},"category":"5cb42aa4922aeb0063353976","createdAt":"2016-11-25T09:23:30.720Z","link_external":false,"order":15,"childrenPages":[]}

postCreate an Order using Payment Request ID

This will create a Order on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

Body Params

id:
string
Payment Request ID

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5cb42aa4922aeb006335399c","sync_unique":"","isReference":false,"next":{"pages":[],"description":""},"category":"5cb42aa4922aeb0063353977","githubsync":"","link_external":false,"parentDoc":null,"title":"Common API Response codes","type":"basic","api":{"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"body":"* `200` : The API request was successful and you can find the API response in the body. \n\n* `201` : The API request successfully created a resource on our server. You will see this response when you create a new signup or a new payment request.\n\n* `301` : The API responded with a redirect request. You are most likely missing a trailing slash at the end of your request URL.\n\n* `400` : The API request you sent failed the validation requirements. You should look into the response body for more details about the error(s).\n\n* `401` : The API request you are sending does not have authentication headers or has incorrect authentication header names or the authentication token is expired or invalid. Also if you are using https://test.instamojo.com as your base URL, ensure that you are using the authentication credentials from https://test.instamojo.com/integrations. Similarly, if you are using https://www.instamojo.com as your base URL, use the authentication credentials from https://www.instamojo.com/integrations\n\n* `403` : You are using incorrect tokens or your token does not have the necessary permissions for performing the action. Check if you are using a [User Based Authentication](doc:user-based-authentication) on an API that requires you to use an [Application Based Authentication](doc:application-based-authentication)\n\n* `404` : The request URL is incorrect or does not exist.\n\n* `500` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com)\n\n* `502` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com)\n\n* `504` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com)\n\n\nYou can also find a more comprehensive list of HTTP response codes here: http://httpstatuses.com/","updates":[],"createdAt":"2017-02-09T13:36:31.669Z","excerpt":"","hidden":false,"link_url":"","order":0,"project":"56a1c9c13845200d0066d6fe","__v":0,"version":"5cb42aa4922aeb00633539a6","slug":"common-api-response-codes","user":"56a1c959842b650d0088899c","childrenPages":[]}

Common API Response codes


* `200` : The API request was successful and you can find the API response in the body. * `201` : The API request successfully created a resource on our server. You will see this response when you create a new signup or a new payment request. * `301` : The API responded with a redirect request. You are most likely missing a trailing slash at the end of your request URL. * `400` : The API request you sent failed the validation requirements. You should look into the response body for more details about the error(s). * `401` : The API request you are sending does not have authentication headers or has incorrect authentication header names or the authentication token is expired or invalid. Also if you are using https://test.instamojo.com as your base URL, ensure that you are using the authentication credentials from https://test.instamojo.com/integrations. Similarly, if you are using https://www.instamojo.com as your base URL, use the authentication credentials from https://www.instamojo.com/integrations * `403` : You are using incorrect tokens or your token does not have the necessary permissions for performing the action. Check if you are using a [User Based Authentication](doc:user-based-authentication) on an API that requires you to use an [Application Based Authentication](doc:application-based-authentication) * `404` : The request URL is incorrect or does not exist. * `500` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) * `502` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) * `504` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) You can also find a more comprehensive list of HTTP response codes here: http://httpstatuses.com/
* `200` : The API request was successful and you can find the API response in the body. * `201` : The API request successfully created a resource on our server. You will see this response when you create a new signup or a new payment request. * `301` : The API responded with a redirect request. You are most likely missing a trailing slash at the end of your request URL. * `400` : The API request you sent failed the validation requirements. You should look into the response body for more details about the error(s). * `401` : The API request you are sending does not have authentication headers or has incorrect authentication header names or the authentication token is expired or invalid. Also if you are using https://test.instamojo.com as your base URL, ensure that you are using the authentication credentials from https://test.instamojo.com/integrations. Similarly, if you are using https://www.instamojo.com as your base URL, use the authentication credentials from https://www.instamojo.com/integrations * `403` : You are using incorrect tokens or your token does not have the necessary permissions for performing the action. Check if you are using a [User Based Authentication](doc:user-based-authentication) on an API that requires you to use an [Application Based Authentication](doc:application-based-authentication) * `404` : The request URL is incorrect or does not exist. * `500` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) * `502` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) * `504` : There was an error on one of our servers with your request. Please reach out to us via [support@instamojo.com](mailto:support@instamojo.com) You can also find a more comprehensive list of HTTP response codes here: http://httpstatuses.com/
{"_id":"5cb42aa4922aeb0063353991","__v":0,"body":"1. [Create a Payment Request](doc:create-a-payment-request) with the buyer's name, email, and phone number. \n2. Fetch the `longurl` from the response body of the API request.\n3. Redirect the user to the `longurl` to complete the payment.\n4. If you are using Light Checkout, append `?embed=form` to the `longurl` before rendering the URL.","sync_unique":"","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"excerpt":"","githubsync":"","isReference":false,"link_external":false,"link_url":"","next":{"pages":[],"description":""},"parentDoc":null,"slug":"how-can-i-prefill-buyer-details-on-payment-forms","updates":[],"user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353977","order":1,"project":"56a1c9c13845200d0066d6fe","title":"How can I prefill buyer details on payment forms?","type":"basic","createdAt":"2017-02-09T11:17:34.229Z","hidden":false,"childrenPages":[]}

How can I prefill buyer details on payment forms?


1. [Create a Payment Request](doc:create-a-payment-request) with the buyer's name, email, and phone number. 2. Fetch the `longurl` from the response body of the API request. 3. Redirect the user to the `longurl` to complete the payment. 4. If you are using Light Checkout, append `?embed=form` to the `longurl` before rendering the URL.
1. [Create a Payment Request](doc:create-a-payment-request) with the buyer's name, email, and phone number. 2. Fetch the `longurl` from the response body of the API request. 3. Redirect the user to the `longurl` to complete the payment. 4. If you are using Light Checkout, append `?embed=form` to the `longurl` before rendering the URL.
{"_id":"5cb42aa4922aeb0063353992","order":2,"project":"56a1c9c13845200d0066d6fe","slug":"can-instamojo-save-the-creditdebit-card-numbers-of-my-customers","sync_unique":"","api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"No. Not yet.","isReference":false,"link_url":"","type":"basic","updates":[],"version":"5cb42aa4922aeb00633539a6","title":"Can Instamojo save the credit/debit card numbers of my customers?","createdAt":"2017-02-09T11:25:09.801Z","githubsync":"","hidden":false,"parentDoc":null,"category":"5cb42aa4922aeb0063353977","user":"56a1c959842b650d0088899c","__v":0,"excerpt":"","link_external":false,"next":{"pages":[],"description":""},"childrenPages":[]}

Can Instamojo save the credit/debit card numbers of my customers?


No. Not yet.
{"_id":"5cb42aa4922aeb0063353993","updates":["5c7d5ee0bd57e9002a7f4386"],"excerpt":"","hidden":false,"slug":"what-is-a-webhook","title":"What is a webhook?","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"Webhooks allow you to get notified of events that happen on Instamojo.\n\nFor example, when a buyer makes payment, Instamojo can send an HTTP POST request to your server. This avoids the need to keep polling Instamojo servers for updates.\n\nA webhook is not a redirect. The buyer or the browser will never see it. Its a communication channel between Instamojo servers and your servers.\n\nHere are some use cases where a webhook might be useful:\n\n1. Sending a custom email from your server at the end of every transaction\n2. Activation of a user's account on your service\n3. Sending a user the license key to your software\n4. Adding a user to your CRM software\n5. Adding the transaction to your accounting software\n\nBy default, a webhook is sent only on successful payments, but can be enabled\nfor failures too. Please get in touch with [support@instamojo.com](mailto:support@instamojo.com) for the same.\n\nA webhook URL should be an internet facing publicly accessible URL on your server, which accepts a POST request from instamojo.com. CSRF checks should be disabled and if the server is hosted over HTTPS, the SSL certificate should be valid and not expired. The URL should not have any kind of authentication.\n\nWe have a handy [https://www.instamojo.com/webhook-testing-tool/](webhook testing tool) which can be used to test your server. [https://requestb.in/](Request bin) is a useful service to explore the request sent by the server.\n\nThe webhook request is request with content-type `application/www-form-urlencoded`. Don't try to handle it like a JSON request.\n\nThe parameters for Payment requests are\n\n| Key                | Description                                                     |\n|--------------------|-----------------------------------------------------------------|\n| amount             | Amount related to the payment                                   |\n| buyer              | Buyer's email                                                   |\n| buyer_name         | Buyer's name                                                    |\n| buyer_phone        | Buyer's phone number                                            |\n| currency           | Currency related to the payment                                 |\n| fees               | Fees charged by Instamojo                                       |\n| longurl            | URL related to the payment request                              |\n| mac                | Message Authentication code of this webhook request             |\n| payment_id         | ID of the payment                                               |\n| payment_request_id | ID of the payment request                                       |\n| purpose            | Purpose of the Payment request                                  |\n| shorturl           | Short URL of the payment request                                |\n| status             | Status of the Payment. This can be either \"Credit\" or \"Failed\". |\n\nNOTE: This list of keys will get updated over time. So when you are integrating,\nwe recommend you to account for new keys that will be added to this.","next":{"pages":[],"description":""},"version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353977","isReference":false,"link_external":false,"link_url":"","project":"56a1c9c13845200d0066d6fe","sync_unique":"","type":"basic","user":"56a1c959842b650d0088899c","__v":1,"createdAt":"2017-02-09T11:31:10.579Z","githubsync":"","order":3,"parentDoc":null,"childrenPages":[]}

What is a webhook?


Webhooks allow you to get notified of events that happen on Instamojo. For example, when a buyer makes payment, Instamojo can send an HTTP POST request to your server. This avoids the need to keep polling Instamojo servers for updates. A webhook is not a redirect. The buyer or the browser will never see it. Its a communication channel between Instamojo servers and your servers. Here are some use cases where a webhook might be useful: 1. Sending a custom email from your server at the end of every transaction 2. Activation of a user's account on your service 3. Sending a user the license key to your software 4. Adding a user to your CRM software 5. Adding the transaction to your accounting software By default, a webhook is sent only on successful payments, but can be enabled for failures too. Please get in touch with [support@instamojo.com](mailto:support@instamojo.com) for the same. A webhook URL should be an internet facing publicly accessible URL on your server, which accepts a POST request from instamojo.com. CSRF checks should be disabled and if the server is hosted over HTTPS, the SSL certificate should be valid and not expired. The URL should not have any kind of authentication. We have a handy [https://www.instamojo.com/webhook-testing-tool/](webhook testing tool) which can be used to test your server. [https://requestb.in/](Request bin) is a useful service to explore the request sent by the server. The webhook request is request with content-type `application/www-form-urlencoded`. Don't try to handle it like a JSON request. The parameters for Payment requests are | Key | Description | |--------------------|-----------------------------------------------------------------| | amount | Amount related to the payment | | buyer | Buyer's email | | buyer_name | Buyer's name | | buyer_phone | Buyer's phone number | | currency | Currency related to the payment | | fees | Fees charged by Instamojo | | longurl | URL related to the payment request | | mac | Message Authentication code of this webhook request | | payment_id | ID of the payment | | payment_request_id | ID of the payment request | | purpose | Purpose of the Payment request | | shorturl | Short URL of the payment request | | status | Status of the Payment. This can be either "Credit" or "Failed". | NOTE: This list of keys will get updated over time. So when you are integrating, we recommend you to account for new keys that will be added to this.
Webhooks allow you to get notified of events that happen on Instamojo. For example, when a buyer makes payment, Instamojo can send an HTTP POST request to your server. This avoids the need to keep polling Instamojo servers for updates. A webhook is not a redirect. The buyer or the browser will never see it. Its a communication channel between Instamojo servers and your servers. Here are some use cases where a webhook might be useful: 1. Sending a custom email from your server at the end of every transaction 2. Activation of a user's account on your service 3. Sending a user the license key to your software 4. Adding a user to your CRM software 5. Adding the transaction to your accounting software By default, a webhook is sent only on successful payments, but can be enabled for failures too. Please get in touch with [support@instamojo.com](mailto:support@instamojo.com) for the same. A webhook URL should be an internet facing publicly accessible URL on your server, which accepts a POST request from instamojo.com. CSRF checks should be disabled and if the server is hosted over HTTPS, the SSL certificate should be valid and not expired. The URL should not have any kind of authentication. We have a handy [https://www.instamojo.com/webhook-testing-tool/](webhook testing tool) which can be used to test your server. [https://requestb.in/](Request bin) is a useful service to explore the request sent by the server. The webhook request is request with content-type `application/www-form-urlencoded`. Don't try to handle it like a JSON request. The parameters for Payment requests are | Key | Description | |--------------------|-----------------------------------------------------------------| | amount | Amount related to the payment | | buyer | Buyer's email | | buyer_name | Buyer's name | | buyer_phone | Buyer's phone number | | currency | Currency related to the payment | | fees | Fees charged by Instamojo | | longurl | URL related to the payment request | | mac | Message Authentication code of this webhook request | | payment_id | ID of the payment | | payment_request_id | ID of the payment request | | purpose | Purpose of the Payment request | | shorturl | Short URL of the payment request | | status | Status of the Payment. This can be either "Credit" or "Failed". | NOTE: This list of keys will get updated over time. So when you are integrating, we recommend you to account for new keys that will be added to this.
{"_id":"5cb42aa4922aeb006335399d","hidden":false,"sync_unique":"","title":"What if the webhook fails?","user":"56a1c959842b650d0088899c","body":"In case your server is down and fails to return an HTTP response or returns a 4xx or 5xx response to our server, we will attempt 4 retries.\n\nThe first retry is attempted after `15 minutes` since the original webhook attempt.\nThe second retry is attempted after `30 minutes` after the first retry.\nThe third retry is attempted after `60 minutes` after the second retry.\nThe fourth retry is attempted after `2 hours` after the third retry.\n\nThis is the last and final attempt, after which the webhook will not be sent anymore.\n\nWebhook retries is disabled by default. In case you want this to be enabled for your account, please send us an email to support@instamojo.com regarding this.","category":"5cb42aa4922aeb0063353977","excerpt":"","githubsync":"","link_url":"","order":4,"parentDoc":null,"project":"56a1c9c13845200d0066d6fe","api":{"auth":"required","params":[],"url":"","settings":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"createdAt":"2017-03-10T06:48:23.236Z","isReference":false,"next":{"description":"","pages":[]},"version":"5cb42aa4922aeb00633539a6","__v":0,"type":"basic","updates":[],"link_external":false,"slug":"what-if-the-webhook-fails","childrenPages":[]}

What if the webhook fails?


In case your server is down and fails to return an HTTP response or returns a 4xx or 5xx response to our server, we will attempt 4 retries. The first retry is attempted after `15 minutes` since the original webhook attempt. The second retry is attempted after `30 minutes` after the first retry. The third retry is attempted after `60 minutes` after the second retry. The fourth retry is attempted after `2 hours` after the third retry. This is the last and final attempt, after which the webhook will not be sent anymore. Webhook retries is disabled by default. In case you want this to be enabled for your account, please send us an email to support@instamojo.com regarding this.
In case your server is down and fails to return an HTTP response or returns a 4xx or 5xx response to our server, we will attempt 4 retries. The first retry is attempted after `15 minutes` since the original webhook attempt. The second retry is attempted after `30 minutes` after the first retry. The third retry is attempted after `60 minutes` after the second retry. The fourth retry is attempted after `2 hours` after the third retry. This is the last and final attempt, after which the webhook will not be sent anymore. Webhook retries is disabled by default. In case you want this to be enabled for your account, please send us an email to support@instamojo.com regarding this.
{"_id":"5cb42aa4922aeb0063353994","user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"githubsync":"","isReference":false,"title":"What are the values of status of a payment?","next":{"pages":[],"description":""},"order":5,"parentDoc":null,"type":"basic","category":"5cb42aa4922aeb0063353977","createdAt":"2017-02-09T11:46:16.178Z","hidden":false,"link_url":"","updates":[],"body":"Status of a payment describes the final state of the payment made by the customer. The value of Status can be:\n1. `Credit` : The payment made was successful.\n2. `Failed` : The payment made was not successful.","project":"56a1c9c13845200d0066d6fe","sync_unique":"","__v":0,"excerpt":"","link_external":false,"slug":"what-are-the-values-of-status-of-a-payment","childrenPages":[]}

What are the values of status of a payment?


Status of a payment describes the final state of the payment made by the customer. The value of Status can be: 1. `Credit` : The payment made was successful. 2. `Failed` : The payment made was not successful.
Status of a payment describes the final state of the payment made by the customer. The value of Status can be: 1. `Credit` : The payment made was successful. 2. `Failed` : The payment made was not successful.
{"_id":"5cb42aa4922aeb0063353995","createdAt":"2017-02-09T11:51:14.877Z","githubsync":"","order":6,"title":"What are the values of status of a payment request?","body":"Status of a payment request describes the state of a payment request. \n\n1. `Pending` : This is the default status. The email and/or sms (whichever is applicable) have not been sent out yet.\n2. `Sent` : The email and/or sms (whichever is applicable) has been sent.\n3. `Failed` : The email and/or sms (whichever is applicable) were not sent successfully.\n4. `Completed` : Payment was made by a customer.","link_url":"","project":"56a1c9c13845200d0066d6fe","slug":"what-are-the-values-of-status-of-a-payment-request","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"category":"5cb42aa4922aeb0063353977","hidden":false,"link_external":false,"parentDoc":null,"__v":0,"excerpt":"","isReference":false,"next":{"pages":[],"description":""},"sync_unique":"","type":"basic","updates":[],"user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","childrenPages":[]}

What are the values of status of a payment request?


Status of a payment request describes the state of a payment request. 1. `Pending` : This is the default status. The email and/or sms (whichever is applicable) have not been sent out yet. 2. `Sent` : The email and/or sms (whichever is applicable) has been sent. 3. `Failed` : The email and/or sms (whichever is applicable) were not sent successfully. 4. `Completed` : Payment was made by a customer.
Status of a payment request describes the state of a payment request. 1. `Pending` : This is the default status. The email and/or sms (whichever is applicable) have not been sent out yet. 2. `Sent` : The email and/or sms (whichever is applicable) has been sent. 3. `Failed` : The email and/or sms (whichever is applicable) were not sent successfully. 4. `Completed` : Payment was made by a customer.
{"_id":"5cb42aa4922aeb0063353996","category":"5cb42aa4922aeb0063353977","link_external":false,"link_url":"","parentDoc":null,"sync_unique":"","api":{"auth":"required","params":[],"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"next":{"pages":[],"description":""},"user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","githubsync":"","body":"1. Specify a webhook url while [creating the payment request](doc:create-a-request).\n2. Save the payment request ID in your database when the payment request is created.\n3. On successful payment completion, a webhook is sent which includes the payment request ID and  the payment ID. You can then map the payment request ID and the payment ID in your database accordingly.","slug":"how-do-i-fetch-the-payment-request-for-a-payment","title":"How do I verify the status of a payment?","updates":[],"__v":0,"createdAt":"2017-02-09T12:02:16.677Z","excerpt":"","hidden":false,"isReference":false,"order":7,"project":"56a1c9c13845200d0066d6fe","type":"basic","childrenPages":[]}

How do I verify the status of a payment?


1. Specify a webhook url while [creating the payment request](doc:create-a-request). 2. Save the payment request ID in your database when the payment request is created. 3. On successful payment completion, a webhook is sent which includes the payment request ID and the payment ID. You can then map the payment request ID and the payment ID in your database accordingly.
1. Specify a webhook url while [creating the payment request](doc:create-a-request). 2. Save the payment request ID in your database when the payment request is created. 3. On successful payment completion, a webhook is sent which includes the payment request ID and the payment ID. You can then map the payment request ID and the payment ID in your database accordingly.
{"_id":"5cb42aa4922aeb0063353997","body":"Instamojo provides you with an option to create a sandbox account to test your integration before you go live on your website or application. \n\nYou do not have to submit documents or go through the regular onboarding flow when you create an account on the sandbox environment. You can sign up on the sandbox environment here: [https://test.instamojo.com](https://test.instamojo.com)\n\nThe base URL for all your API requests to the sandbox environment should be:\n`https://test.instamojo.com/`\n\nAll the credentials like API key, Auth Token and Private Salt will be \navailable at: [https://test.instamojo.com/integrations/](https://test.instamojo.com/integrations)\n\nTo test transaction, you can use the test card details, which are:\n```\nCard Number: 4242 4242 4242 4242\nExp MM/YY: 01/20\nCVV: 111\nSecond Factor Authentication code: 1221\n```\n\nThe production environment is the live Instamojo environment where you cannot use the test card details and need to use a valid card to make a transaction. The developer credentials for this environment are will be available at [https://www.instamojo.com/integrations/](https://www.instamojo.com/integrations/)\n\nThe base URL for all your API requests to the sandbox environment should be:\n`https://www.instamojo.com/`","category":"5cb42aa4922aeb0063353977","hidden":false,"link_external":false,"createdAt":"2017-02-09T13:12:53.618Z","githubsync":"","parentDoc":null,"type":"basic","updates":[],"version":"5cb42aa4922aeb00633539a6","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"link_url":"","slug":"what-is-the-difference-between-the-sandbox-and-production-environment","title":"What is the difference between the sandbox and production environment?","user":"56a1c959842b650d0088899c","__v":0,"excerpt":"","isReference":false,"next":{"pages":[],"description":""},"order":8,"project":"56a1c9c13845200d0066d6fe","sync_unique":"","childrenPages":[]}

What is the difference between the sandbox and production environment?


Instamojo provides you with an option to create a sandbox account to test your integration before you go live on your website or application. You do not have to submit documents or go through the regular onboarding flow when you create an account on the sandbox environment. You can sign up on the sandbox environment here: [https://test.instamojo.com](https://test.instamojo.com) The base URL for all your API requests to the sandbox environment should be: `https://test.instamojo.com/` All the credentials like API key, Auth Token and Private Salt will be available at: [https://test.instamojo.com/integrations/](https://test.instamojo.com/integrations) To test transaction, you can use the test card details, which are: ``` Card Number: 4242 4242 4242 4242 Exp MM/YY: 01/20 CVV: 111 Second Factor Authentication code: 1221 ``` The production environment is the live Instamojo environment where you cannot use the test card details and need to use a valid card to make a transaction. The developer credentials for this environment are will be available at [https://www.instamojo.com/integrations/](https://www.instamojo.com/integrations/) The base URL for all your API requests to the sandbox environment should be: `https://www.instamojo.com/`
Instamojo provides you with an option to create a sandbox account to test your integration before you go live on your website or application. You do not have to submit documents or go through the regular onboarding flow when you create an account on the sandbox environment. You can sign up on the sandbox environment here: [https://test.instamojo.com](https://test.instamojo.com) The base URL for all your API requests to the sandbox environment should be: `https://test.instamojo.com/` All the credentials like API key, Auth Token and Private Salt will be available at: [https://test.instamojo.com/integrations/](https://test.instamojo.com/integrations) To test transaction, you can use the test card details, which are: ``` Card Number: 4242 4242 4242 4242 Exp MM/YY: 01/20 CVV: 111 Second Factor Authentication code: 1221 ``` The production environment is the live Instamojo environment where you cannot use the test card details and need to use a valid card to make a transaction. The developer credentials for this environment are will be available at [https://www.instamojo.com/integrations/](https://www.instamojo.com/integrations/) The base URL for all your API requests to the sandbox environment should be: `https://www.instamojo.com/`
{"_id":"5cb42aa4922aeb0063353998","version":"5cb42aa4922aeb00633539a6","body":"No. We do not allow API calls over AJAX because it exposes your API credentials which can be easily misused.\n\nThe recommended way is to send a request to your server with the required data and from\nthere you should make a request to our API instead with the credentials being stored on your server. Once the API returns a response, you may then forward the result to your frontend.","isReference":false,"slug":"can-i-make-api-calls-using-ajax","link_external":false,"next":{"pages":[],"description":""},"parentDoc":null,"updates":[],"user":"56a1c959842b650d0088899c","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"githubsync":"","project":"56a1c9c13845200d0066d6fe","title":"Can I make API calls using AJAX?","category":"5cb42aa4922aeb0063353977","hidden":false,"link_url":"","order":9,"sync_unique":"","type":"basic","__v":0,"createdAt":"2017-02-09T13:19:42.560Z","excerpt":"","childrenPages":[]}

Can I make API calls using AJAX?


No. We do not allow API calls over AJAX because it exposes your API credentials which can be easily misused. The recommended way is to send a request to your server with the required data and from there you should make a request to our API instead with the credentials being stored on your server. Once the API returns a response, you may then forward the result to your frontend.
No. We do not allow API calls over AJAX because it exposes your API credentials which can be easily misused. The recommended way is to send a request to your server with the required data and from there you should make a request to our API instead with the credentials being stored on your server. Once the API returns a response, you may then forward the result to your frontend.
{"_id":"5cb42aa4922aeb0063353999","version":"5cb42aa4922aeb00633539a6","excerpt":"","parentDoc":null,"slug":"can-i-issue-multiple-partial-refunds-for-a-payment","sync_unique":"","title":"Can I issue multiple partial refunds for a payment?","updates":[],"githubsync":"","link_external":false,"link_url":"","next":{"description":"","pages":[]},"project":"56a1c9c13845200d0066d6fe","__v":0,"createdAt":"2017-02-09T13:27:30.355Z","order":10,"type":"basic","user":"56a1c959842b650d0088899c","isReference":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"No. This is not supported at the moment. You can only [create one refund](doc:create-a-refund)  per payment.","category":"5cb42aa4922aeb0063353977","hidden":false,"childrenPages":[]}

Can I issue multiple partial refunds for a payment?


No. This is not supported at the moment. You can only [create one refund](doc:create-a-refund) per payment.
No. This is not supported at the moment. You can only [create one refund](doc:create-a-refund) per payment.
{"_id":"5cb42aa4922aeb006335399a","createdAt":"2017-02-09T13:29:08.507Z","link_url":"","title":"Can I add custom fields to a payment request?","sync_unique":"","type":"basic","updates":[],"category":"5cb42aa4922aeb0063353977","hidden":false,"parentDoc":null,"project":"56a1c9c13845200d0066d6fe","user":"56a1c959842b650d0088899c","version":"5cb42aa4922aeb00633539a6","__v":0,"body":"No. This is not supported yet.\n\nHowever, you can use the `purpose` field for any information upto 30 characters regarding the payment request. We recommend you store and maintain any custom fields for a payment request at your end.","order":11,"slug":"can-i-add-custom-fields-to-a-payment-request","isReference":false,"link_external":false,"next":{"pages":[],"description":""},"api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]}},"excerpt":"","githubsync":"","childrenPages":[]}

Can I add custom fields to a payment request?


No. This is not supported yet. However, you can use the `purpose` field for any information upto 30 characters regarding the payment request. We recommend you store and maintain any custom fields for a payment request at your end.
No. This is not supported yet. However, you can use the `purpose` field for any information upto 30 characters regarding the payment request. We recommend you store and maintain any custom fields for a payment request at your end.
{"_id":"5cb42aa4922aeb006335399b","parentDoc":null,"sync_unique":"","__v":0,"createdAt":"2017-02-09T13:31:42.803Z","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":12,"project":"56a1c9c13845200d0066d6fe","slug":"i-get-a-failed-to-connect-to-wwwinstamojocom-port-443-connection-timed-out-error-what-is-wrong","category":"5cb42aa4922aeb0063353977","githubsync":"","next":{"pages":[],"description":""},"updates":[],"version":"5cb42aa4922aeb00633539a6","api":{"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"This indicates that the port 443 is blocked on your server. This port should be open for our API to work as we communicate with our servers only over HTTPS.\n\nYou would have to get in touch with your server admin and ask them to open this port.","excerpt":"","title":"I get a \"Failed to connect to www.instamojo.com port 443: Connection timed out\" error. What is wrong?","type":"basic","user":"56a1c959842b650d0088899c","childrenPages":[]}

I get a "Failed to connect to www.instamojo.com port 443: Connection timed out" error. What is wrong?


This indicates that the port 443 is blocked on your server. This port should be open for our API to work as we communicate with our servers only over HTTPS. You would have to get in touch with your server admin and ask them to open this port.
This indicates that the port 443 is blocked on your server. This port should be open for our API to work as we communicate with our servers only over HTTPS. You would have to get in touch with your server admin and ask them to open this port.
{"_id":"5cb42aa4922aeb00633539a0","project":"56a1c9c13845200d0066d6fe","version":"5cb42aa4922aeb00633539a6","category":"5cb42aa4922aeb0063353978","user":"56a1c959842b650d0088899c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-13T11:13:39.581Z","link_external":false,"link_url":"https://docs.instamojo.com/docs/sdk","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Read more about Javascript SDK [here](https://docs.instamojo.com/docs/sdk).","excerpt":"Render Instamojo checkout form and collect payments on your webpage with just the instamojo-payment-url.","slug":"javascript-sdk","type":"basic","title":"Javascript SDK","__v":0,"parentDoc":null,"childrenPages":[]}

Javascript SDK

Render Instamojo checkout form and collect payments on your webpage with just the instamojo-payment-url.

Read more about Javascript SDK [here](https://docs.instamojo.com/docs/sdk).
Read more about Javascript SDK [here](https://docs.instamojo.com/docs/sdk).