Bank Transfer

Offer bank transfer as a payment method to customers at Razorpay Checkout.


You can now accept payments from customers in the form of online bank transfers, using the Razorpay Checkout form.

How it Works๐Ÿ”—

  1. Customer selects bank transfer as the payment method on Checkout.
  2. A virtual bank account is created with bank account number and IFSC details and displayed to customer.
  3. Customer copies these details and make a netbanking payment from their online banking portal.

These virtual bank accounts are linked to the bank account you have registered with Razorpay. The money will be settled to your account as per the settlement schedule.

Feature Request
This is an on-demand feature. Please raise a request with our Support team to get this feature activated on your Razorpay account.

You can choose:

Method 1: Create New Virtual Bank Account Per Order๐Ÿ”—

This creates a new virtual bank account per order, every time a customer selects bank transfer as the payment method on Checkout.

Integration๐Ÿ”—

The bank transfer payment method will appear for the payment gateway and products such as Payment Links and Payment Pages.

Payment Links and Payment Pages
No additional integration is required if you are using Payment Links and Payment Pages.

All you have to do is raise a request with our Razorpay Team to activate the feature on your account.

Apart from enabling this feature on your account, complete the following steps to integrate this feature on your Razorpay Standard Integration:

  1. Track the checkout modal using the ondismiss function. (Only if you are using Standard Manual Checkout)
  2. Attach event listeners to the Razorpay instance. (optional)
  3. Subscribe to webhook event.

Step 1: Track the Checkout Modal using the ondismiss function๐Ÿ”—

If you have integrated with Razorpay Standard Checkout using the manual method, you must implement the ondismiss function to track the lifecyle of the Checkout modal. This displays the close icon, which the customer can use to exit the Checkout.

Copy"modal": { "ondismiss": function(){ console.log(data); } }

Step 2: Attach Event Listeners to the Razorpay Instance๐Ÿ”—

For bank transfer payments, Checkout will not give a success or a failure callback. You must attach event listeners to the Razorpay instance to track if and when the customer has selected the bank transfer payment method.

Here is the code to be added:

Copyvar rzp = new Razorpay(options); rzp.on('payment.submit', function (data) { if (data.method === 'bank_transfer') { // User has selected Bank Transfer } });

Step 3: Subscribe to Webhook event๐Ÿ”—

You must subscribe to the virtual_account.credited webhook event on the Razorpay Dashboard to receive notifications whenever customers make payments using bank transfers. Learn how to setup webhooks.

Sample Payload๐Ÿ”—

Copy{ "entity": "event", "account_id": "acc_BFQ7uQEaa7j2z7", "event": "virtual_account.credited", "contains": [ "payment", "virtual_account", "bank_transfer" ], "payload": { "payment": { "entity": { "id": "pay_DETA2KrOlhqQzF", "entity": "payment", "amount": 50000, "currency": "INR", "status": "captured", "order_id": "order_DBJOWzybf0sJbb", "invoice_id": null, "international": false, "method": "bank_transfer", "amount_refunded": 0, "amount_transferred": 0, "refund_status": null, "captured": true, "description": "NA", "card_id": null, "bank": null, "wallet": null, "vpa": null, "email": "gaurav.kumar@example.com", "contact": "+919123456789", "customer_id": "cust_1Aa00000000004", "notes": [], "fee": 731, "tax": 112, "error_code": null, "error_description": null, "created_at": 1567675983 } }, "virtual_account": { "entity": { "id": "va_DET8z3wBxfPB5L", "name": "Acme Corp", "entity": "virtual_account", "status": "active", "description": "Virtual Account to test webhook", "amount_expected": null, "notes": { "Important": "Notes for Internal Reference" }, "amount_paid": 50000, "customer_id": "cust_1Aa00000000004", "close_by": null, "closed_at": null, "created_at": 1567675923, "receivers": [ { "id": "ba_DET8z5Z5ghv4hW", "entity": "bank_account", "ifsc": "RATN0VAAPIS", "bank_name": "RBL Bank", "name": "Acme Corp", "account_number": "1112220006712324" } ] } }, "bank_transfer": { "entity": { "id": "bt_DETA2KSUJ3uCM9", "entity": "bank_transfer", "payment_id": "pay_DETA2KrOlhqQzF", "mode": "NEFT", "bank_reference": "156767598340", "amount": 50000, "payer_bank_account": { "id": "ba_DETA2UuuKtKLR1", "entity": "bank_account", "ifsc": "KKBK0000007", "bank_name": "Kotak Mahindra Bank", "name": "Gaurav Kumar", "account_number": "765432123456789" }, "virtual_account_id": "va_DET8z3wBxfPB5L" } } }, "created_at": 1567675983 }

Method 2: Create New Virtual Bank Account Per Customer๐Ÿ”—

This ensures that each customer will be allocated a unique virtual bank account, whenever they use bank transfer method on Checkout. This method requires specific integration steps, which are mentioned in the following section.

Integration๐Ÿ”—

The bank transfer payment method will appear for the payment gateway and products such as Payment Links and Payment Pages.

Payment Links and Payment Pages
No additional integration is required if you are using Payment Links and Payment Pages.

All you have to do is raise a request with our Razorpay Team to activate the feature on your account.

Apart from enabling this feature on your account, you must implement the following steps in your payment gateway integration:

  1. Create a Customer.
  2. Create an Order.
  3. Pass customer_id and order_id to Checkout.
  4. Track the checkout modal using the ondismiss function. (Only if you are using Standard Manual Checkout)
  5. Attach event listeners to the Razorpay instance. (optional)
  6. Subscribe to webhooks event.

Step 1: Create a Customer๐Ÿ”—

You must create a customer using the Customers ID. You can also do same using the Razorpay Dashboard.

The following endpoint creates or add a customer with basic details such as name and contact details. You can use this API for various Razorpay Solution offerings.

/customers

Request Parameters๐Ÿ”—

name mandatory
string Customer's name. Alphanumeric value with period (.), apostrophe (') and parentheses are allowed. The name must be between 3-50 characters in length. For example, Gaurav Kumar.
contact optional
string The customer's phone number. A maximum length of 15 characters including country code. For example, +919876543210.
email optional
string The customer's email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com.
fail_existing optional
string Possible values:
  • 0: If a customer with the same details already exists, fetches details of the existing customer.
  • 1 (default): If a customer with the same details already exists, throws an error.
gstin optional
string Customer's GST number, if available. For example, 29XAbbA4369J1PA.
notes optional
object This is a key-value pair that can be used to store additional information about the entity. It can hold a maximum of 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scottyโ€.

Request Parameters๐Ÿ”—

id
string Unique identifier of the customer. For example, cust_1Aa00000000004.
name
string Customer's name. Alphanumeric, with period (.), apostrophe (') and parentheses allowed. The name must be between 3-50 characters in length. For example, Gaurav Kumar.
contact
string The customer's phone number. A maximum length of 15 characters including country code. For example, +919876543210.
email
string The customer's email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com.
gstin
string GST number linked to the customer. For example, 29XAbbA4369J1PA.
notes
This is a key-value pair that can be used to store additional information about the entity. It can hold a maximum of 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scottyโ€.
created_at
integer UNIX timestamp, when the customer was created. For example, 1234567890.

Pass the customer_id available in the response to Checkout.

Step 2: Create an Order๐Ÿ”—

Order is an important step in the payment process.

  • An order should be created for every payment.
  • You can create an order using the Orders API. It is a server-side API call. Know how to authenticate Orders API.
  • The order_id received in the response should be passed to the checkout. This ties the Order with the payment and secures the request from being tampered.

API Sample Code๐Ÿ”—

The following is a sample API request and response for creating an order:

Copycurl -X POST https://api.razorpay.com/v1/orders -U [YOUR_KEY_ID]:[YOUR_KEY_SECRET] -H 'content-type:application/json' -d '{ "amount": 500, "currency": "INR", "receipt": "qwsaq1", "partial_payment": true, "first_payment_min_amount": 230 }'
CopyRazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]"); JSONObject orderRequest = new JSONObject(); orderRequest.put("amount", 50000); // amount in the smallest currency unit orderRequest.put("currency", "INR"); orderRequest.put("receipt", "order_rcptid_11"); Order order = razorpay.Orders.create(orderRequest); } catch (RazorpayException e) { // Handle Exception System.out.println(e.getMessage()); }
Copyimport razorpay client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET")) DATA = { "amount": 100, "currency": "INR", "receipt": "receipt#1", "notes": { "key1": "value3", "key2": "value2" } } client.order.create(data=DATA)
Copy$api = new Api($key_id, $secret); $api->order->create(array('receipt' => '123', 'amount' => 100, 'currency' => 'INR', 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
CopyRazorpayClient client = new RazorpayClient(your_key_id, your_secret); Dictionary<string, object> options = new Dictionary<string,object>(); options.Add("amount", 50000); // amount in the smallest currency unit options.add("receipt", "order_rcptid_11"); options.add("currency", "INR"); Order order = client.Order.Create(options);
Copyrequire "razorpay" Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET') options = amount: 50000, currency: 'INR', receipt: '<order_rcptid_11>' order = Razorpay::Order.create
Copyvar instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' }) instance.orders.create({ amount: 50000, currency: "INR", receipt: "receipt#1", notes: { key1: "value3", key2: "value2" } })
Copyimport ( razorpay "github.com/razorpay/razorpay-go" ) client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET") data := map[string]interface{}{ "amount": 50000, "currency": "INR", "receipt": "some_receipt_id" } body, err := client.Order.Create(data)
Copy{ "id": "order_IluGWxBm9U8zJ8", "entity": "order", "amount": 5000, "amount_paid": 0, "amount_due": 5000, "currency": "INR", "receipt": "rcptid_11", "offer_id": null, "status": "created", "attempts": 0, "notes": [], "created_at": 1642662092 }

Request Parameters๐Ÿ”—

Here is the list of parameters for creating an order:

amount mandatory
integer The transaction amount, expressed in the currency subunit, such as paise (in case of INR). For example, for an actual amount of โ‚น299.35, the value of this field should be 29935.
currency mandatory
string The currency in which the transaction should be made. See the list of supported currencies. Length must be of 3 characters.
receipt optional
string Your receipt id for this order should be passed here. Maximum length 40 characters.
notes optional
json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scottyโ€.
partial_payment optional
boolean Indicates whether the customer can make a partial payment. Possible values:
  • true: The customer can make partial payments.
  • false (default): The customer cannot make partial payments.
first_payment_min_amount optional
integer Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of โ‚น7,000 is to be received from the customer in two installments of #1 - โ‚น5,000, #2 - โ‚น2,000, then you can set this value as 500000. This parameter should be passed only if partial_payment is true.

Know more about Orders API.

Error Response Parameters๐Ÿ”—

The error response parameters are available in the API Reference Guide.

Step 3: Pass customer_id and order_id to Checkout๐Ÿ”—

You must pass the customer_id and order_id generated in the previous steps to Checkout, as shown below:

Copy<button id="rzp-button1">Pay</button> <script src="https://checkout.razorpay.com/v1/checkout.js"></script> <script> var options = { "key": "<YOUR_KEY_ID>", // Enter the Key ID generated from the Dashboard "amount": "50000", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise "currency": "INR", "name": "Acme Corp", "description": "Test Transaction", "image": "https://cdn.razorpay.com/logos/BUVypPrCFaKDu3_large.png", "order_id": "order_DBJOWzybf0sJbb", "customer_id": "cust_1Aa00000000004", "handler": function (response){ alert(response.razorpay_payment_id); alert(response.razorpay_order_id); alert(response.razorpay_signature) }, "theme": { "color": "#3399cc" } }; var rzp1 = new Razorpay(options); document.getElementById('rzp-button1').onclick = function(e){ rzp1.open(); e.preventDefault(); } </script>

Step 4: Track the Checkout Modal using the ondismiss function๐Ÿ”—

If you have integrated with Razorpay Standard Checkout using the manual method, you must implement the ondismiss function to track the lifecyle of the Checkout modal. This displays the close icon, which the customer can use to exit the Checkout.

Copy"modal": { "ondismiss": function(){ console.log(data); } }

Step 5: Attach Event Listeners to the Razorpay Instance๐Ÿ”—

For bank transfer payments, Checkout will not give a success or a failure callback. You must attach event listeners to the Razorpay instance to track if and when the customer has selected the bank transfer payment method.

Here is the code to be added:

Copyvar rzp = new Razorpay(options); rzp.on('payment.submit', function (data) { if (data.method === 'bank_transfer') { // User has selected Bank Transfer } });

Step 6: Subscribe to Webhook event๐Ÿ”—

You must subscribe to the virtual_account.credited webhook event on the Razorpay Dashboard to receive notifications whenever customers make payments using bank transfers. Learn how to setup webhooks.

Sample Payload๐Ÿ”—

Copy{ "entity": "event", "account_id": "acc_BFQ7uQEaa7j2z7", "event": "virtual_account.credited", "contains": [ "payment", "virtual_account", "bank_transfer" ], "payload": { "payment": { "entity": { "id": "pay_DETA2KrOlhqQzF", "entity": "payment", "amount": 50000, "currency": "INR", "status": "captured", "order_id": "order_DBJOWzybf0sJbb", "invoice_id": null, "international": false, "method": "bank_transfer", "amount_refunded": 0, "amount_transferred": 0, "refund_status": null, "captured": true, "description": "NA", "card_id": null, "bank": null, "wallet": null, "vpa": null, "email": "gaurav.kumar@example.com", "contact": "+919123456789", "customer_id": "cust_1Aa00000000004", "notes": [], "fee": 731, "tax": 112, "error_code": null, "error_description": null, "created_at": 1567675983 } }, "virtual_account": { "entity": { "id": "va_DET8z3wBxfPB5L", "name": "Acme Corp", "entity": "virtual_account", "status": "active", "description": "Virtual Account to test webhook", "amount_expected": null, "notes": { "Important": "Notes for Internal Reference" }, "amount_paid": 50000, "customer_id": "cust_1Aa00000000004", "close_by": null, "closed_at": null, "created_at": 1567675923, "receivers": [ { "id": "ba_DET8z5Z5ghv4hW", "entity": "bank_account", "ifsc": "RATN0VAAPIS", "bank_name": "RBL Bank", "name": "Acme Corp", "account_number": "1112220006712324" } ] } }, "bank_transfer": { "entity": { "id": "bt_DETA2KSUJ3uCM9", "entity": "bank_transfer", "payment_id": "pay_DETA2KrOlhqQzF", "mode": "NEFT", "bank_reference": "156767598340", "amount": 50000, "payer_bank_account": { "id": "ba_DETA2UuuKtKLR1", "entity": "bank_account", "ifsc": "KKBK0000007", "bank_name": "Kotak Mahindra Bank", "name": "Gaurav Kumar", "account_number": "765432123456789" }, "virtual_account_id": "va_DET8z3wBxfPB5L" } } }, "created_at": 1567675983 }
ร—