API ReferenceIntegrationsKnowledge Base

Bank Transfer

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 webhooks 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.

Use the below endpoint to create a customer:

/customers

Request ParametersπŸ”—

name mandatory
string Customer's name. Alphanumeric value with period (.), apostrophe (') and parentheses are allowed. Name must be between 3-50 characters in length. For example, Gaurav Kumar.
contact optional
string The customer's phone number. Maximum length of 15 characters including the country code. For example, +919876543210.
email optional
string The customer's email address. 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. Name must be between 3-50 characters in length. For example, Gaurav Kumar.
contact
string The customer's phone number. Maximum length of 15 characters, inclusive of country code. For example, +919876543210.
email
string The customer's email address. 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. Timestamp, in Unix, when the customer was created. For example, 1234567890.

Pass the customer_id available in the response to Checkout.

Step 2: Create an OrderπŸ”—

Use the below endpoint to create an order in your (backend) server.

/orders
Copycurl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \ -X POST https://api.razorpay.com/v1/orders \ -H "content-type: application/json" \ -d '{ "amount": 50000, "currency": "INR", "receipt": "receipt#1" }'
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);
Copyimport razorpay client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET")) order_amount = 50000 order_currency = 'INR' order_receipt = 'order_rcptid_11' notes = {'Shipping address': 'Bommanahalli, Bangalore'} # OPTIONAL client.order.create(amount=order_amount, currency=order_currency, receipt=order_receipt, notes=notes)
Copy$api = new Api($key_id, $secret); $order = $client->order->create([ 'receipt' => 'order_rcptid_11', 'amount' => 50000, 'currency' => 'INR' ]);
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') order = Razorpay::Order.create amount: 50000, currency: 'INR', receipt: 'TEST'
Copyvar instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' }) var options = { amount: 50000, // amount in the smallest currency unit currency: "INR", receipt: "order_rcptid_11" }; instance.orders.create(options, function(err, order) { console.log(order); });
Copyimport ( razorpay "github.com/razorpay/razorpay-go" ) client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET") data := map[string]interface{}{ "amount": 1234, "currency": "INR", "receipt": "some_receipt_id" } body, err := client.Order.Create(data)
Copy{ "id": "order_EKwxwAgItmmXdp", "entity": "order", "amount": 50000, "amount_paid": 0, "amount_due": 50000, "currency": "INR", "receipt": "receipt#1", "offer_id": null, "status": "created", "attempts": 0, "notes": [], "created_at": 1582628071 }

An order id (referred as order_id) is generated on the successful creation of an order. You should store this order id in your system against the order.

Know more about Orders API.

Request ParametersπŸ”—

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. Default is INR. Length must be of 3 characters.
receipt optional
string Your receipt id for this order should be passed here. Maximum length of 40 characters.
notes optional
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”.

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 }

Try It OutπŸ”—

To understand how your customers can transfer money to you:

  1. Launch our demo checkout.

  2. Provide your phone number and email address.
  3. Select Bank Transfer as your payment method.
  4. Click Copy Details to copy the account number, IFSC and Beneficiary Name.
  5. Go to your preferred netbanking portal, enter the copied details and initiate an online bank transfer.

Live Payment:
This initiates a live payment. The amount will be refunded within 5-7 days.

×