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

# Set the Primary Payment Source

> Set the primary payment source using the Razorpay TPAP Pro API.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
</div>

Use this endpoint to set the primary payment source for the VPA.

<RequestExample>
  ```bash Curl theme={null}
  curl -X PATCH 'api.rzp.<bank>.com/v1/upi/tpap/vpa' \
  -u [YOUR_KEY_ID]:[YOUR_SECRET] \
  -H "Content-type: application/json" \
  -H "x-device-fingerprint: <device_fingerprint>" \
  -H "x-device-fingerprint-timestamp: 1496918882000" \
  -H "x-customer-reference: customer-id-from-customer" \
  -d '{
    "vpa": "customer@handle",
    "primary_fundsource_id": "fs_1234"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "entity":"upi.vpa",
    "customer_reference":"cust_1234",
    "mobile":"999999999",
    "address":"kunal-1@rzpa",
    "status":"active",
    "fundsources":{
      "entity":"collection",
      "count":2,
      "items":[
        {
          "id":"fs_1234",
          "customer_name":"kunal1",
          "masked_account_number":"xxxxxx8990",
          "account_reference_number":"999988126236990",
          "type":"savings",
          "ifsc":"SBI00001",
          "upi_pin_set":true,
          "upi_pin_length":4,
          "otp_length":4,
          "atm_pin_length":6,
          "fundsource_provider":{
            "name":"HDFC Bank",
            "upi_iin":"600007",
            "upi_enabled":false,
            "mobile_registration_format":"format1",
            "logo_url":"<bank logo url>"
          },
          "primary":true
        },
        {
          "id":"dummyfs1111112",
          "customer_name":"kunal1",
          "masked_account_number":"xxxxxx8990",
          "account_reference_number":"999988126236990",
          "type":"savings",
          "ifsc":"SBI00001",
          "upi_pin_set":true,
          "upi_pin_length":4,
          "otp_length":4,
          "atm_pin_length":6,
          "fundsource_provider":{
            "name":"HDFC Bank",
            "upi_iin":"600007",
            "upi_enabled":false,
            "mobile_registration_format":"format1",
            "logo_url":"<bank logo url>"
          },
          "primary":false
        }
      ]
    }
  }
  ```
</ResponseExample>

## Request Parameters

<ParamField body="vpa" type="string" required>
  The VPA whose link needs to be updated.
</ParamField>

<ParamField body="primary_fundsource_id" type="string" required>
  The unique identifier of the payment source.
</ParamField>

## Response Parameters

<ResponseField name="entity" type="string">
  This refers to the collection of entity. Here, it is `vpa`.
</ResponseField>

<ResponseField name="customer_reference" type="string">
  The customer identifier. Pass this parameter at the TPAP end in this attribute.
</ResponseField>

<ResponseField name="mobile" type="string">
  The mobile number of the VPA linked to the payment source.
</ResponseField>

<ResponseField name="address" type="string">
  The VPA of the customer.
</ResponseField>

<ResponseField name="status" type="enum">
  Indicates the VPA and payment source linking status. Possible values:

  * `active`
  * `inactive`
</ResponseField>

<ResponseField name="fundsources" type="object">
  The payment source details.
</ResponseField>

<ResponseField name="entity" type="string">
  The type of entity.
</ResponseField>

<ResponseField name="count" type="integer">
  Indicates the number of item in the entity.
</ResponseField>

<ResponseField name="items" type="object">
  The payment source object.
</ResponseField>

<ResponseField name="id" type="string">
  Unique identifier of the payment source.
</ResponseField>

<ResponseField name="customer_name" type="string">
  Name of the customer.
</ResponseField>

<ResponseField name="masked_account_number" type="string">
  Masked account number of the payment source.
</ResponseField>

<ResponseField name="account_reference_number" type="string">
  Account reference number of the payment source.
</ResponseField>

<ResponseField name="type" type="enum">
  Type of the payment source. Possible values:

  * `savings`
  * `current`
  * `non resident ordinary`
  * `non resident external`
  * `secured overdraft`
  * `credit`
  * `ppi`
</ResponseField>

<ResponseField name="ifsc" type="string">
  IFSC of the payment source.
</ResponseField>

<ResponseField name="fundsource_provider" type="object">
  The payment source provider details.
</ResponseField>

<ResponseField name="upi_iin" type="string">
  The UPI Issuer Identification Numbers (iin) of the payment source provider issued by NPCI.
</ResponseField>

<ResponseField name="name" type="string">
  Name of the payment source provider.
</ResponseField>

<ResponseField name="upi_enabled" type="boolean">
  Indicates if the payment source provider has UPI enabled.

  * `true`: UPI enabled.
  * `false`: UPI not enabled.
</ResponseField>

<ResponseField name="mobile_registration_format" type="string">
  Field to take the bank URL input.
</ResponseField>

<ResponseField name="logo_url" type="string">
  The URL of the bank logo.
</ResponseField>

<ResponseField name="upi_pin_set" type="boolean">
  Indicates if UPI PIN is set for payment source. Possible values:

  * `true`: UPI PIN is set.
  * `false`: UPI PIN is not set.
</ResponseField>

<ResponseField name="upi_pin_length" type="integer">
  The length of the UPI PIN allowed for payment source.
</ResponseField>

<ResponseField name="otp_length" type="integer">
  The length of the OTP PIN allowed for payment source.
</ResponseField>

<ResponseField name="atm_pin_length" type="integer">
  The ATM PIN length allowed for payment source.
</ResponseField>

<ResponseField name="primary" type="boolean">
  Indicates if vpa-payment source link is primary.

  * `true`: VPA is linked to the payment source.
  * `false`: VPA is not linked to the payment source.
</ResponseField>
