{"id":360,"date":"2021-09-07T09:02:32","date_gmt":"2021-09-07T09:02:32","guid":{"rendered":"https:\/\/zwitch.io\/blog\/?p=360"},"modified":"2025-05-27T02:47:37","modified_gmt":"2025-05-27T08:17:37","slug":"set-up-automated-transfers-with-transfers-api","status":"publish","type":"post","link":"https:\/\/www.zwitch.io\/blog\/set-up-automated-transfers-with-transfers-api\/","title":{"rendered":"Getting started with Zwitch Transfers API"},"content":{"rendered":"\n<p>Bank transfers are hard for businesses. Most of the businesses would\u2019ve experienced interruptions in doing transfers because of fixed banking hours.&nbsp;<\/p>\n\n\n\n<p>Delayed payments often lead to a stoppage in services. Automated payouts can help your business maintain a reliable cash flow in operation, enhance invoicing and the payments process, and save time and effort.&nbsp;<\/p>\n\n\n\n<p>At Zwitch, we make it easier for your business to solve all your payouts related problems in a matter of seconds. Zwitch Transfers API can be used for automated payouts from virtual accounts or an existing current account (currently supported for ICICI bank only and support for YES Bank, Axis Bank is coming soon).<\/p>\n\n\n\n<p>Let\u2019s get started.<\/p>\n\n\n\n<h2 id=\"setup-automated-transfers-using-transfers-api\" class=\"wp-block-heading\"><strong>Setup automated transfers using Transfers API<\/strong><\/h2>\n\n\n\n<p>Zwitch Transfers API helps you transfer money from a virtual account or an ICICI current account. These transfers can be made from:<\/p>\n\n\n\n<p>(i) a virtual account to a bank account, or <\/p>\n\n\n\n<p>(ii) from a virtual account to another <a href=\"https:\/\/zwitch.io\/blog\/virtual-accounts-apis-and-how-to-get-started-with-it\/\" target=\"_blank\" rel=\"noopener\">virtual account created as a wallet<\/a>, or <\/p>\n\n\n\n<p>(iii) from an existing ICICI bank current account linked using Zwitch APIs to any other bank account. <\/p>\n\n\n\n<p>However, before making payment, you need to make sure that a beneficiary is added to the account from where you are initiating the transfers.<\/p>\n\n\n\n<p>Before we discuss more about the Transfers API, let\u2019s first understand how to create a beneficiary on the debit account from where the transfer happens. As mentioned above, this debit account could be your primary virtual account or customers\u2019 virtual account (if you want to enable the \u201cwithdraw money to bank account\u201d facility for your customers) or your linked ICICI bank current account.<\/p>\n\n\n\n<h3 id=\"create-a-beneficiary\" class=\"wp-block-heading\"><strong>Create a beneficiary<\/strong><\/h3>\n\n\n\n<p>To initiate transactions from the virtual accounts, you need to add beneficiaries in the debit account. This is required only in case you are initiating transfers from a virtual account or from your linked ICICI bank current account to a bank account.&nbsp;<\/p>\n\n\n\n<p>If you are doing transfers from one virtual account to another virtual account created as a wallet, you can simply initiate the transfer via the Transfers API without adding beneficiaries.<\/p>\n\n\n\n<p>While creating beneficiaries using Zwitch APIs, you can either pass account <strong><code>type<\/code><\/strong> as <strong><code>account_number<\/code><\/strong> or <strong><code>vpa<\/code><\/strong> handle to which the amount needs to be transferred.&nbsp;<\/p>\n\n\n\n<p>The other mandatory parameters to be included in the request body are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>email<\/code><\/strong><\/li>\n\n\n\n<li><strong><code>phone<\/code><\/strong><\/li>\n\n\n\n<li><strong><code>name_of_account_holder<\/code><\/strong><\/li>\n<\/ul>\n\n\n\n<p>If you are passing the value of parameter <strong><code>type<\/code><\/strong> as <strong><code>account_number<\/code><\/strong>, then you need to pass the following additional parameters in the request body:-<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>bank_account_number<\/code> <\/strong>&#8211; Account number to which the amount needs to be transferred,<\/li>\n\n\n\n<li><strong><code>bank_name<\/code> <\/strong>&#8211; Name of the bank,<\/li>\n\n\n\n<li><strong><code>bank_ifsc_code<\/code> <\/strong>&#8211; IFSC code of the bank.<\/li>\n<\/ul>\n\n\n\n<p>If you are passing the value of parameter <strong><code>type<\/code><\/strong> as <strong><code>vpa<\/code><\/strong>, then VPA needs to be included as additional parameters in the request body other than <strong><code>email<\/code><\/strong>, <strong><code>phone<\/code><\/strong>, and <strong><code>name_of_account_holder<\/code>.<\/strong><\/p>\n\n\n\n<p>Depending on the value of type parameter, here is how the sample request body would look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --request POST \\\n     --url https:\/\/api.zwitch.io\/v1\/accounts\/<span class=\"highlight\"><strong>&lt;debit_va_id&gt;<\/strong><\/span>\/beneficiaries \\\n     --header 'Accept: application\/json' \\\n     --header 'Authorization: Bearer <strong><span class=\"highlight\">&lt;access_key&gt;:&lt;secret_key&gt;<\/span><\/strong>' \\\n     --header 'Content-Type: application\/json' \\\n     --data '\n{\n     \"type\": \"<strong><span class=\"highlight\">account_number<\/span><\/strong>\",\n     \"email\": \"john.doe@email.com\",\n     \"phone\": \"9675196666\",\n     \"name_of_account_holder\": \"John Doe\",\n     \"bank_account_number\": \"363636514348445576\",\n     \"bank_ifsc_code\": \"YESB0CMSNOC\",\n     \"bank_name\": \"Yes Bank\",\n     <span class=\"highlight\">\"vpa\": \"9675196666@upi\"<\/span>\n}\n'<\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong> Make sure to update the &lt;<strong>debit_va_id<\/strong>&gt; with the Virtual Account\u2019s ID or the linked ICICI bank Current Account\u2019s ID from where the amount needs to be debited. You can find this ID from your Zwitch\u2019s Sandbox Dashboard in the \u201cManage Keys\u201d section under the column \u201cID\u201d or returned in the response body when linking the account using our APIs.<\/p>\n\n\n\n<p>Once the beneficiary is successfully created, you will get the beneficiary id as highlighted in the code below in your response body. The beneficiary ID will be used in the Transfers API to transfer the amount.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n\"id\":\"<strong><span class=\"highlight\">vab_2EL60lbRVG2rT4Z2mY4RY35I9<\/span><\/strong>\"\n\"object\":\"beneficiary\"\n\"type\":\"account_number\"\n\"name_of_account_holder\":\"John Doe\"\n\"email\":\"john.doe@email.com\"\n\"phone\":\"9675196666\"\n\"bank_account_number\":\"363636514348445576\"\n\"bank_ifsc_code\":\"YESB0CMSNOC\"\n\"bank_name\":\"Yes Bank\"\n<strong><span class=\"highlight\">\"vpa\": \"9675196666@upi\"<\/span><\/strong>\n\"is_sandbox\":false\n}<\/code><\/pre>\n\n\n\n<p>There are other processes that you can do using Beneficiaries API. They are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Get beneficiary<\/strong> &#8211; To list details of a particular beneficiary,<\/li>\n\n\n\n<li><strong>List all beneficiaries<\/strong> &#8211; To list all beneficiaries created under a virtual account, and<\/li>\n\n\n\n<li><strong>Delete a beneficiary<\/strong> &#8211; To delete a particular beneficiary<\/li>\n<\/ul>\n\n\n\n<h3 id=\"create-a-transfer\" class=\"wp-block-heading\"><strong>Create a Transfer<\/strong><\/h3>\n\n\n\n<p>To initiate a transfer, you\u2019ve to pass the following parameters in the request body:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The value of <strong><code>type<\/code><\/strong> could be <strong><code>account_number<\/code><\/strong> or <strong><code>vpa<\/code><\/strong> depending on the type of beneficiary added. In the case of virtual account to virtual account transfer, no beneficiary creation is required and the value of <strong><code>type<\/code><\/strong> should be <strong><code>wallet<\/code><\/strong>,\u00a0<\/li>\n\n\n\n<li><strong><code>debit_account_id<\/code><\/strong> &#8211; The account id from which the amount will be transferred,\u00a0<\/li>\n\n\n\n<li><strong><code>credit_account_id<\/code><\/strong> &#8211; The account id to which the amount will be credited (mandatory in case <strong><code>type<\/code><\/strong> is <strong><code>wallet<\/code>)<\/strong>,<\/li>\n\n\n\n<li><strong><code>beneficiary_id<\/code><\/strong> &#8211; This is created using the above process (mandatory in case <strong><code>type<\/code><\/strong> is <strong><code>account_number<\/code><\/strong> or <strong><code>vpa<\/code><\/strong>),<\/li>\n\n\n\n<li><strong><code>amount<\/code><\/strong> &#8211; The amount to be transferred,<\/li>\n\n\n\n<li><strong><code>currency_code<\/code><\/strong> &#8211; It should be <strong><code>inr<\/code><\/strong>, and<\/li>\n\n\n\n<li><strong><code>merchant_reference_id<\/code><\/strong> &#8211; A unique string that will identify the payouts<\/li>\n<\/ul>\n\n\n\n<p>Here is a sample request body in case the beneficiary added is a Virtual Payment Address handle:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --request POST \\\n     --url https:\/\/api.zwitch.io\/v1\/transfers \\\n     --header 'Accept: application\/json' \\\n     --header 'Authorization: Bearer <strong><span class=\"highlight\">&lt;access_key&gt;:&lt;secret_key&gt;<\/span><\/strong>'' \\\n     --header 'Content-Type: application\/json' \\\n     --data '\n{\n     \"debit_account_id\": \"va_9KOI7QEqOADbDYII3NsI8GRJE\",\n     \"type\": \"vpa\",\n     \"amount\": 1,\n     \"currency_code\": \"inr\",\n     \"beneficiary_id\": \"<strong><span class=\"highlight\">vab_2EL60lbRVG2rT4Z2mY4RY35I9<\/span><\/strong>\",\n     \"merchant_reference_id\": \"testtransfer\"\n}\n'<\/code><\/pre>\n\n\n\n<p>You have to pass these additional parameters as well:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>payment_mode<\/code><\/strong> &#8211; Values can be <strong><code>imps<\/code><\/strong>, <strong><code>neft<\/code><\/strong> and <strong><code>rtgs<\/code><\/strong> and mandatory when the <strong><code>type<\/code><\/strong> is <strong><code>account_number<\/code><\/strong><\/li>\n\n\n\n<li><strong><code>payment_remark<\/code><\/strong> &#8211; This appears in the bank account statement. However, it may not be available on some beneficiary banks.<\/li>\n\n\n\n<li><strong><code>async<\/code><\/strong> &#8211; by default the value is <strong><code>false<\/code><\/strong>. If it is made <strong><code>true<\/code><\/strong>, then transfers will happen asynchronously<\/li>\n\n\n\n<li><strong><code>metadata<\/code><\/strong> &#8211;\u00a0 additional parameters such as order id which you might require in the response<\/li>\n<\/ul>\n\n\n\n<p>You\u2019ll get the following response from the APIs if the amount is credited to a bank account and not on a VPA handle or other virtual account, on completing transfer successfully:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"id\": \"tr_nrAyzIQHt888jDGQtCDegBqoR\",\n    \"object\": \"transfer\",\n    \"type\": \"account_number\",\n    \"amount\": 1,\n    \"transacted_at\": 1622531493,\n    \"created_at\": 1622531489,\n    \"status\": \"success\",\n    \"bank_reference_number\": \"115212968196\",\n    \"payment_mode\": \"imps\",\n    \"paid_to\": \"67334963307\",\n    \"merchant_reference_id\": \"456167114\"\n}\n<\/code><\/pre>\n\n\n\n<p>You can also take care of other processes with the Transfers API. They are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Retrieve transfer<\/strong> &#8211; Gets details of a particular transaction when the transaction id is passed<\/li>\n\n\n\n<li><strong>List all transfers<\/strong> &#8211; This fetches the transfers created after and before a specific transaction. It also allows you to control how many transactions to be displayed on a single page with the default being 10 transactions and the maximum being 100 transactions.<\/li>\n<\/ul>\n\n\n\n<p>Instant transfers are a great enhancement for a rich customer experience. Most of the startups leverage transfers to grow fast and become among the large players over a very short span of time. Now is the time to automate transfer flow across your business.&nbsp;<br><br>To learn more about Beneficiaries and Transfers API, read our documentation <a href=\"https:\/\/developers.zwitch.io\/reference#overview-4\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bank transfers are hard for businesses. Most of the businesses would\u2019ve experienced interruptions in doing transfers because of fixed banking hours.&nbsp; Delayed payments often lead to a stoppage in services.&hellip;<\/p>\n","protected":false},"author":4,"featured_media":361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[30,50,51,52],"powerkit_post_featured":[],"class_list":{"0":"post-360","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technology","8":"tag-api","9":"tag-automated-payouts","10":"tag-transfers","11":"tag-transfers-api"},"_links":{"self":[{"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":1,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":2104,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/posts\/360\/revisions\/2104"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/media\/361"}],"wp:attachment":[{"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/media?parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/categories?post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/tags?post=360"},{"taxonomy":"powerkit_post_featured","embeddable":true,"href":"https:\/\/www.zwitch.io\/blog\/wp-json\/wp\/v2\/powerkit_post_featured?post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}