API ReferenceIntegrationsKnowledge Base

Smart Collect with TPV

Razorpay Smart Collect enables you to create virtual accounts to accept large payments from your customers in the form of bank transfers via NEFT, RTGS and IMPS.

Virtual accounts are similar to bank accounts wherein customers can transfer payments. You can create, retrieve and close virtual accounts using the Smart Collect APIs.

The virtual account response contains attributes such as id, customer_id and a field, receivers. This is an array that defines what receivers are available for the virtual account.

For example, if the receiver.types array of the original request contained bank_account, then the response will contain a receivers array which gives details of that bank_account receiver such as account number, IFSC and more.

Postman CollectionπŸ”—

We have a Postman collection to make the integration quicker and easier. Click the Download Postman Collection button below to get started.

Instructions to Use Postman CollectionπŸ”—

  • All Razorpay APIs are authenticated using Basic Authentication.

    • Generate API Keys from the Dashboard.
    • Add your API Keys in Postman. Select the required API β†’ Auth β†’ Type = Basic Auth β†’ Username = [Your_Key_ID]; Password = [Your_Key_secret]
  • Some APIs in the collection require data specific to your account either in the request body or as path parameters. For example:

    • For example, the Fetch a Virtual Account by ID API requires you to add the va_id as a path parameter in the endpoint.
    • These parameters are enclosed in {} in the collection. For example, {va_id}.
    • The API throws an error if this value is incorrect or does not exist in your system.

Smart Collect EntityπŸ”—

id

string The unique identifier of the virtual account.

name

string The merchant billing label as it appears on the Razorpay Dashboard.

entity

string Indicates the type of entity. Here, it is virtual account.

status

string Indicates whether the virtual account is in active or closed state.

description

string A brief description about the virtual account.

amount_paid

integer The amount paid by the customer into the virtual account.

notes

json object Any custom notes you might want to add to the virtual account can be entered here. Refer Notes section of the API Reference Guide to learn more.

customer_id

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.

Create Virtual AccountπŸ”—

The following endpoint creates a virtual account.

/virtual_accounts

Note:
The request format for virtual account creation recently underwent a change. If you are looking for the request format as it was before 21/11/17, you can find it here.
For new integrations, we strongly recommend you use the updated request format, as it allows a host of new features, most particularly the support for completely-numeric account numbers by default.

Request ParametersπŸ”—

receivers mandatory

json object Configuration of desired receivers for the virtual account.

types
array List of desired receiver types. Possible value is bank_account
allowed_payers mandatory

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 mandatory

string The type of account through which the customer will make the payment. Possible value is bank_account.

bank_account mandatory

object Indicates the bank account details such as ifsc and account_number.

ifsc mandatory
string The IFSC associated with the bank account through which the customer is expected to make the payment.
account_number mandatory
string The bank account number through which the customer is expected to make the payment. Handy Tips!
The SBI account number contains zeros preceding actual numbers. You should enter the complete account number, including these zeros, or else the transaction will fail, and the amount will be refunded automatically.
For Example, if the account number is 00000022234631312, add the complete account number and not just 22234631312.
description optional

string A brief description of the virtual account.

customer_id optional

string Unique identifier of the customer to whom the virtual account must be tagged. Refer to the Customer API documentation to learn how to create a customer.

notes optional

json object Any custom notes you might want to add to the virtual account can be entered here. Refer to the Notes section of the API Reference Guide to learn more.

close_by optional

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.

Note:
While sharing the details of VAs (created using RBL bank) with the customers, ensure that the fifth character in the IFSC is number 0 and not the letter O. For example, valid IFSC is RATN0VAAPIS and not RATNOVAAPIS.

Add an Allowed Payer AccountπŸ”—

Use this API to add allowed payers account details to a virtual account. You can add one account detail in a single request.

/virtual_accounts/{va_id}/allowed_payers

Path ParameterπŸ”—

va_id mandatory
string The unique identifier of the virtual account to which you want to add allowed_payers account details.

Request ParametersπŸ”—

type mandatory

string The type of account. Possible value is bank_account.

bank_account mandatory

object Indicates the bank account details such as ifsc and account_number.

ifsc mandatory
string The IFSC associated with the bank account.
account_number mandatory
string The bank account number. Handy Tips:
The SBI account number contains zeros preceding actual numbers. You should enter the complete account number, including these zeros, or else the transaction will fail, and the amount will be refunded automatically.
For example, if the account number is 00000022234631312, add the complete account number and not just 22234631312.

Refer to the Errors page for information about all the possible errors that may occur while adding allowed payer account details.

Fetch a Virtual Account by IDπŸ”—

The following endpoint fetches a virtual account by ID.

/virtual_accounts/:id

Path ParameterπŸ”—

id mandatory
string The unique identifier of the virtual account whose details are to be fetched.

Fetch all Virtual AccountsπŸ”—

The following endpoint fetches the details of all virtual accounts.

/virtual_accounts

Query ParametersπŸ”—

from
integer Timestamp, in seconds, from when virtual accounts are to be fetched.
to
integer Timestamp, in seconds, till when virtual accounts are to be fetched.
count
integer Number of virtual accounts to be fetched. The default value is 10 and the maximum value is 100. This can be used for pagination, in combination with skip.
skip
integer Number of records to be skipped while fetching the virtual accounts. This can be used for pagination, in combination with count.

Fetch Payments for a Virtual AccountπŸ”—

The following endpoint fetches payments made against a particular virtual account.

/virtual_accounts/:id/payments

Path ParameterπŸ”—

id mandatory
string The unique identifier of the virtual account for which the payment details are to be fetched.

The response parameters are the same as those mentioned in Fetch a Payment API.

Query ParametersπŸ”—

from
integer Timestamp, in seconds, from when payments are to be fetched.
to
integer Timestamp, in seconds, till when payments are to be fetched.
count
integer Number of payments to be fetched. The default value is 10 and the maximum value is 100. This can be used for pagination, in combination with skip.
skip
integer Number of records to be skipped while fetching the payments. This can be used for pagination, in combination with count.

Fetch Payment Details using ID and Transfer MethodπŸ”—

You can retrieve details of a payment using the Payment ID and transfer method.

Bank TransferπŸ”—

/payments/:id/bank_transfer

Note:
If Razorpay does not receive the bank account information of the customer from the remitting bank, the payer_bank_account key will be set to null.

Path ParameterπŸ”—

id mandatory
string The unique identifier of the payment made to the virtual account.

Response ParametersπŸ”—

id

string The unique identifier of the bank transfer.

entity

string The name of the entity. Here, it is bank_transfer.

payment_id

string The unique identifier of the payment.

mode

string The mode of bank transfer used. Possible values are:
- NEFT
- RTGS
- IMPS

bank_reference

string Unique reference number provided by the bank for the transaction.

payer_bank_account

object The payer bank account details from which payment is received.

id
string The unique identifier of the customer's bank account.
entity
string The name of the entity. Here, it is bank_account.
ifsc
string The IFSC associated with the bank account.
bank_name
string The name of the bank in which the customer has an account.
notes
object Any custom notes added to the virtual bank account.
account_number
string The unique account number of the customer.
virtual_account_id

string The unique identifier of the virtual account.

virtual_account

object Details of the virtual account.

id

string The unique identifier of the virtual account.

name

string The merchant billing label as it appears on Razorpay Dashboard.

entity

string The name of the entity. Here, it is virtual account.

status

string Indicates the status of the virtual account. Possible values are:
- active
- closed

description

string A brief description about the virtual account.

amount_paid

integer The amount paid by the customer to the virtual account.

notes

object Any custom notes added during the creation of the virtual account.

customer_id

string The unique identifier of the customer the virtual account is linked with. For more details, refer to the Customers API.

receivers

object Configuration of desired receivers for the virtual account.

id
string The unique identifier of the virtual bank account. For example, ba_Di5gbQsGn0QSz3.
entity
string The name of the entity. Here, it is bank_account.
ifsc
string The IFSC for the virtual bank account created. For example, RATN0VAAPIS.
bank_name
string The bank associated with the virtual bank account. For example, RBL.
account_number
string The unique account number provided by the bank. For example, 1112220061746877.
name
string The merchant billing label as it appears on Razorpay Dashboard.
notes
object Any custom notes added during the creation of the virtual account.
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.

type

string The type of account through which the customer will make the payment. Possible value is bank_account.

id

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

Delete an Allowed Payer AccountπŸ”—

Use this API to delete allowed payers account details added to a virtual account. You can delete one account detail in a single request.

/virtual_accounts/{:va_id}/allowed_payers/{:id}

Path ParameterπŸ”—

va_id mandatory
string The unique identifier of the virtual account from which the allowed_payers account details should be deleted.
id mandatory
string The unique identifier of the allowed_payers account that has to be deleted.

You get a 204(No Content) response if the allowed payer account details are deleted successfully.

Refer to the Errors page for information about all the possible errors that may occur while deleting allowed payer account details.

Refund Payments made to a Virtual AccountπŸ”—

You can process refunds for a payment made towards a virtual account. The following endpoint refunds a payment using the payment ID.

/payments/:id/refund

Path ParameterπŸ”—

id mandatory
string The unique identifier of the payment to be refunded.

Path ParameterπŸ”—

id mandatory
string The unique identifier of the payment which needs to be refunded.

Request ParametersπŸ”—

amount optional
integer The amount to be refunded. Amount should be in the smallest unit of the currency in which the payment was made.
  • For a partial refund, enter a value lesser than the payment amount. For example, if the payment amount is β‚Ή1500 and you want to refund only β‚Ή500, you must pass 50000.
  • For full refund, enter the entire payment amount. If amount parameter is not passed, the entire payment amount will be refunded.
speed optional
string The speed at which the refund is to be processed. The default value is normal. Refund will be processed via the normal speed and the customer will receive the refund within 5-7 working days.
notes optional
json object Key-value pairs used to store additional information. A maximum of 15 key-value pairs can be included.
receipt optional
string A unique identifier provided by you for your internal reference.

Create an Instant RefundπŸ”—

If you want to process refunds instantaneously to your customers, you can do so by passing the speed with value as optimum in the request body.

/payments/:id/refund

Request ParametersπŸ”—

amount optional
string Amount to be refunded. If no value is passed, a full refund is issued.
notes optional
json object Array of notes fields. You can enter custom data in key-value pairs. Refer the Notes section of the API Reference documentation to learn more.

Response ParametersπŸ”—

id
string The unique identifier of the refund.
amount
integer The amount that is refunded to the customer.
currency
string The currency in which the payment is made. We support international currencies.
payment_id
string The unique identifier of the payment.
notes
json object Array of notes fields. You can enter custom data in key-value pairs.
created_at
integer UNIX Timestamp that indicates when the refund was processed.

Refer Refunds API to perform other refund-related operations:

  • Fetch a particular refund or a list of refunds for a payment ID.
  • Update a refund to modify the Notes field.

Close a Virtual AccountπŸ”—

The following endpoint closes a virtual account.

/virtual_accounts/:id/close

Path ParameterπŸ”—

id mandatory
string The unique identifier of the virtual account that is to be closed.
×