> ## Documentation Index
> Fetch the complete documentation index at: https://doc-test-my.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add an Allowed Payer Account

> Add an Allowed Payer Account using the Razorpay **Smart Collect TPV** APIs.

Use this endpoint to add an allowed payer's account.

<RequestExample>
  ```bash Curl theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X POST https://api.razorpay.com/v1/virtual_accounts/{va_id}/allowed_payers \
  -H "Content-Type: application/json" \
  -d '{
     "type":"bank_account",
     "bank_account":{
        "ifsc":"UTIB0000013",
        "account_number":"914010012345679"
     }
  }'
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  String virtualId = "va_Di5gbNptcWV8fQ";

  JSONObject virtualRequest = new JSONObject();
  virtualRequest.put("type","bank_account");
  JSONObject vpa = new JSONObject();
  vpa.put("ifsc","UTIB0000013");
  vpa.put("account_number","914011112345679");
  virtualRequest.put("bank_account",vpa);

  VirtualAccount virtualaccount = instance.virtualAccounts.addAllowedPayers(virtualId,virtualRequest);
  ```

  ```php PHP theme={null}
  $api = new Api($api_key, $api_secret);

  $api->virtualAccount->fetch($virtualId)->addAllowedPayer(array('types' => 'bank_account','bank_account' => array('ifsc'=>'UTIB0000013','account_number'=>'914010012345679')));
  ```

  ```javascript Node.js theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  instance.virtualAccounts.allowedPayer(virtualId,{
    types: "bank_account",
    bank_account: {
      ifsc: "UTIB0000013",
      account_number: "914010012345679"
    }
  })
  ```

  ```python Python theme={null}
  import razorpay
  client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))

  client.virtual_account.add_allowed_player(virtualId,{
    "types": "bank_account",
    "bank_account": {
      "ifsc": "UTIB0000013",
      "account_number": 914010012345679
    }
  })
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')

  virtualId = "va_Di5gbNptcWV8fQ"

  para_attr = {
    "type": "bank_account",
    "bank_account": {
      "ifsc": "UTIB0000013",
      "account_number": 914010012345679
    }
  }

  Razorpay::VirtualAccount.allowed_payer(virtualId, para_attr)
  ```

  ```go Go theme={null}
  import ( razorpay "github.com/razorpay/razorpay-go" )
  client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")

  types := make(map[string]interface{})
  types["0"] = "vpa"

   data:= map[string]interface{}{
  	"type": types,
  	"vpa": map[string]interface{}{
  	  "descriptor": "gaurikumari",
  	},
    }
  body, err := client.VirtualAccount.AllowedPayer("<virtualId>", data, nil)
  ```

  ```csharp .NET theme={null}
  RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]

  String virtualId = "va_Z6t7VFTb9xHeOs";

  Dictionary<string, object> virtualRequest = new Dictionary<string, object>();
  virtualRequest.Add("type", "bank_account");
  Dictionary<string, object> vpa = new Dictionary<string, object>();
  vpa.Add("ifsc", "UTIB0000013");
  vpa.Add("account_number", "914012112345679");
  virtualRequest.Add("bank_account", vpa);

  VirtualAccount refund = client.VirtualAccount.Fetch("va_MaxCJzVjbKRBAr").AddAllowedPayers(virtualRequest);
  ```

  ```bash CLI theme={null}
  razorpay smart-collect tpv-add-payer va_DlGmm7jInLudH8 \
    --type bank_account \
    --ifsc UTIB0000001 \
    --account-number 9876543210123456
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "id": "va_IUVQ3usNTeteGl",
    "name": "Smart Grofers",
    "entity": "virtual_account",
    "status": "active",
    "description": "Customer Identifier created for Raftar Soft",
    "amount_expected": null,
    "notes": {
      "project_name": "Banking Software"
    },
    "amount_paid": 10000,
    "customer_id": null,
    "receivers": [
      {
        "id": "ba_IUVQ424tVVobzZ",
        "entity": "bank_account",
        "ifsc": "RAZR0000001",
        "bank_name": null,
        "name": "Smart Grofers",
        "notes": [],
        "account_number": "1112220007297133"
      },
      {
        "id": "vpa_IUVRKM3WejBvhc",
        "entity": "vpa",
        "username": "rzr.payto000007005195066",
        "handle": "icic",
        "address": "rzr.payto000007005195066@icic"
      }
    ],
    "allowed_payers": [
      {
        "type": "bank_account",
        "id": "ba_JRSigCQ3MUCBYn",
        "bank_account": {
          "ifsc": "UTIB0000013",
          "account_number": "914010012345679"
        }
      }
    ],
    "close_by": 1681615838,
    "closed_at": null,
    "created_at": 1638862811
  }
  ```

  ```json Failure theme={null}
  {
     "error":{
        "code":"BAD_REQUEST_ERROR",
        "description":"Only 10 allowed payer accounts can be added",
        "field":"allowed_payers",
        "source":"business",
        "step":"virtual_account_edit",
        "reason":"allowed_payer_limit_exceeded",
        "metadata":[]
     }
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="va_id" type="string" required>
  The unique identifier of the Customer Identifier to which you want to add `allowed_payers` account details.
</ParamField>

## Request Parameters

<ParamField body="type" type="string" required>
  The type of account. Possible value is `bank_account`.
</ParamField>

<ParamField body="bank_account" type="object" required>
  Indicates the bank account details such as `ifsc` and `account_number`.
</ParamField>

<ParamField body="ifsc" type="string" required>
  The IFSC associated with the bank account.
</ParamField>

<ParamField body="account_number" type="string" required>
  The bank account number.

  <Info>
    **Handy Tips**

    SBI account numbers can contain 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.
  </Info>
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier of the Customer Identifier.
</ResponseField>

<ResponseField name="name" type="string">
  The `merchant billing label` as it appears on the Dashboard.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of entity. Here, it is `virtual account`.
</ResponseField>

<ResponseField name="status" type="string">
  Indicates whether the Customer Identifier is in `active` or `closed` state.
</ResponseField>

<ResponseField name="description" type="string">
  A brief description about the Customer Identifier.
</ResponseField>

<ResponseField name="amount_expected" type="integer">
  The amount expected by the merchant.
</ResponseField>

<ResponseField name="amount_paid" type="integer">
  The amount paid by the customer into the Customer Identifier.
</ResponseField>

<ResponseField name="notes" type="json object">
  Any custom notes you might want to add to the Customer Identifier can be entered here. Check the [Notes section](/docs/api/understand#notes) to know more.
</ResponseField>

<ResponseField name="customer_id" type="string">
  Unique identifier of the customer the Customer Identifier is linked with. Check the [Customer API](/docs/api/customers) section to know more.
</ResponseField>

<ResponseField name="receivers" type="json object">
  Configuration of desired receivers for the Customer Identifier.
</ResponseField>

<ResponseField name="id" type="string">
  The unique identifier of the Customer Identifier. Sample id for Customer Identifier is `ba_Di5gbQsGn0QSz3`
</ResponseField>

<ResponseField name="entity" type="string">
  Name of the entity. Possible value is `bank_account`.
</ResponseField>

<ResponseField name="ifsc" type="string">
  The IFSC for the Customer Identifier created. For example, `RAZR0000001`. This parameter appears in the response only when `bank_account` is passed as the receiver `type`.
</ResponseField>

<ResponseField name="bank_name" type="string">
  The bank associated with the Customer Identifier. For example, `RAZR0000001`. This parameter appears in the response only when `bank_account` is passed as the receiver `type`.
</ResponseField>

<ResponseField name="account_number" type="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`.
</ResponseField>

<ResponseField name="name" type="string">
  The `merchant billing label` as it appears on the Dashboard. This parameter appears in the response only when `bank_account` is passed as the receiver `type`.
</ResponseField>

<ResponseField name="notes" type="json object">
  Any custom notes you might want to add to the Customer Identifier can be entered here. Check the [Notes section](/docs/api/understand#notes) to know more. This parameter appears in the response only when `bank_account` is passed as the receiver `type`.
</ResponseField>

<ResponseField name="allowed_payers" type="array">
  Details of customer bank accounts which will be allowed to make payments to your Customer Identifier. The parent parameter under which the customer bank account details must be passed as child parameters. You can add account details of 10 allowed payers for a Customer Identifier. For more details, refer to the [Third Party Validation](/docs/payments/smart-collect/third-party-validation) section.
</ResponseField>

<ResponseField name="type" type="string">
  The type of account through which the customer will make the payment. Possible value is `bank_account`.
</ResponseField>

<ResponseField name="id" type="string">
  The unique identifier of the `allowed_payers` account.
</ResponseField>

<ResponseField name="bank_account" type="object">
  Indicates the bank account details such as `ifsc` and `account_number`.
</ResponseField>

<ResponseField name="ifsc" type="string">
  The IFSC associated with the bank account through which the customer is expected to make the payment.
</ResponseField>

<ResponseField name="account_number" type="string">
  The bank account number through which the customer is expected to make the payment.
</ResponseField>

<ResponseField name="close_by" type="integer">
  UNIX timestamp at which the Customer Identifier 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). Any request beyond `2147483647` UNIX timestamp will fail.
</ResponseField>

<ResponseField name="closed_at" type="integer">
  UNIX timestamp at which the Customer Identifier is automatically closed.
</ResponseField>

<ResponseField name="created_at" type="integer">
  UNIX timestamp at which the Customer Identifier was created.
</ResponseField>

## Errors

<AccordionGroup>
  <Accordion title="Account validation is only applicable on bank account as a receiver type">
    **Code:** `400`

    This error occurs when you try to add an allowed payer account on a Customer Identifier with VPA added as a receiver (with or without a Bank account).

    **Solution:** You cannot add an allowed payer account on a Customer Identifier with VPA added as a receiver (with or without a Bank account).
  </Accordion>

  <Accordion title="Only 10 allowed payer accounts can be added.">
    **Code:** `400`

    This error occurs when you try to add new allowed payer accounts when the overall `allowed_payers` limit is exceeded. You can only add up to 10 allowed payer accounts.

    **Solution:** Do not add more than 10 allowed payers.
  </Accordion>

  <Accordion title="The bank account.account number field is required when bank account is present.">
    **Code:** `400`

    This error occurs when you do not pass the bank account number in the request.

    **Solution:** Make sure to pass the bank account number in the request.
  </Accordion>

  <Accordion title="The bank account.ifsc field is required when bank account is present">
    **Code:** `400`

    This error occurs when you do not pass the IFSC in the request.

    **Solution:** Make sure to pass the IFSC in the request.
  </Accordion>

  <Accordion title="The ifsc must be 11 characters.">
    **Code:** `400`

    This error occurs when you pass an incorrect IFSC in the request. An IFSC must be 11 characters.

    **Solution:** Make sure to pass a valid IFSC in the request.
  </Accordion>

  <Accordion title="Payer detail already exist for virtual account.">
    **Code:** `400`

    This error occurs when you try to add a duplicate allowed payer's account with the same IFSC and account number that already exists.

    **Solution:** Make sure to add a valid allowed payer's account.
  </Accordion>

  <Accordion title="Bharat QR not supported for Customer Identifier.">
    **Code:** `400`

    Passing the receivers as `qr`.

    **Solution:** We have deprecated the `qr` receiver type from our APIs. From now on, only `vpa` and `bank_account` will be supported. (Jun 2022).
  </Accordion>

  <Accordion title="Bharat QR not enabled.">
    **Code:** `400`

    If you are a new merchant trying to create a Bharat QR code.

    **Solution:** We have deprecated the `bharat_qr` type for QR v2 product.
  </Accordion>
</AccordionGroup>
