All Razorpay APIs are authenticated using Basic Auth. Basic auth requires the following:
[YOUR_KEY_ID]
[YOUR_KEY_SECRET]
Basic auth expects an Authorization header for each request in the Basic base64token format. Here, base64token is a base64 encoded string of YOUR_KEY_ID:YOUR_KEY_SECRET.
Watch Out!
The Authorization header value should strictly adhere to the format mentioned above. Invalid formats will result in authentication failures. Few examples of invalid headers are:
Log into your Dashboard with appropriate credentials.
Select the mode (Test or Live) for which you want to generate the API key.
Test Mode: The test mode is a simulation mode which you can use to test your integration flow. Your customers will not be able to make payments in this mode.
Live Mode: When your integration is complete, switch to the live mode and generate live mode API keys. Replace test mode keys with live mode keys in the integration to accept payments from customers.
Navigate to Settings → API Keys → Generate Key to generate key for the selected mode.
The Key Id and Key Secret appear on a pop-up page.
Test Mode API Keys
Live Mode API Keys
Watch Out!
After generating the keys from the Dashboard, download and save them securely. If you do not remember your API Keys, you need to re-generate it from the Dashboard and replace it wherever required.
Do not share your API Key secret with anyone or on any public platforms. This can pose security threats for your Razorpay account.
string Unique identifier of the customer the virtual account is linked with. Refer the Customer API section to learn more.
receivers
json object Configuration of desired receivers for the virtual account.
id
string The unique identifier of the virtual bank account. Sample ID for virtual bank account is ba_Di5gbQsGn0QSz3
entity
string Name of the entity. Possible value is bank_account
ifsc
string The IFSC for the virtual bank account created. For example, RAZR0000001. This parameter appears in the response only when bank_account is passed as the receiver type.
bank_name
string The bank associated with the virtual bank account. For example, RAZR0000001. This parameter appears in the response only when bank_account is passed as the receiver type.
account_number
string The unique account number provided by the bank. For example, 1112220061746877. This parameter appears in the response only when bank_account is passed as the receiver type.
name
string The merchant billing label as it appears on the Razorpay Dashboard. This parameter appears in the response only when bank_account is passed as the receiver type.
notes
json object Any custom notes you might want to add to the virtual bank account can be entered here. Refer Notes section of the API Reference Guide to learn more. This parameter appears in the response only when bank_account is passed as the receiver type.
allowed_payers
array Details of customer bank accounts which will be allowed to make payments to your virtual account. The Parent parameter under which the customer bank account details must be passed as child parameters. Note:
You can add account details of 10 allowed payers for a virtual account. For more details, refer to the Third Party Validation section.
type
string The type of account through which the customer will make the payment. Possible value is bank_account.
id
string The unique identifier of the allowed_payers account.
bank_account
object Indicates the bank account details such as ifsc and account_number.
ifsc
string The IFSC associated with the bank account through which the customer is expected to make the payment.
account_number
string The bank account number through which the customer is expected to make the payment.
close_by
integer UNIX timestamp at which the virtual account is scheduled to be automatically closed. The time must be at least 15 minutes after current time. The date range can be set till 2147483647 in UNIX timestamp format (equivalent to Tuesday, January 19, 2038 8:44:07 AM GMT+05:30). Note: Any request beyond 2147483647 UNIX timestamp will fail.
closed_at
integer UNIX timestamp at which the virtual account is automatically closed.
created_at
integer UNIX timestamp at which the virtual account was created.