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

# Fetch Payment Sources

> Fetch payment sources 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>

Payment sources are any payment account (Bank Account, PPI, Wallets, Mobile Money, and so on) offered by a regulated entity where money can be held, debited, and credited. Use this endpoint to fetch banks or fundsource providers. After a customer selects a bank, TPAP uses this API to fetch a list of payment sources.  Based on the query parameters, the TPAP has the option to get fundsources in real time for NPCI, or get only VPA-linked fundsource or get only fundsources for a particular bank.

<RequestExample>
  ```bash Curl theme={null}
  curl -X GET 'api.rzp.<bank>.com/v1/upi/tpap/fundsources?refresh=true&linked=true&upi_iin=7078129&skip=0&count=10&device_ip=198.1.1.1&device_geocode=1234.1213' \
  -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" \
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "entity":"collection",
    "count":1,
    "items":[
      {
        "id":"fs_1234",
        "entity":"upi.fundsource",
        "type":"savings",
        "customer_name":"Gaurav Kumar",
        "masked_account_number":"XXXXXX5199",
        "account_reference_number":"999988126236990",
        "ifsc":"HDFC000001",
        "upi_pin_set":true,
        "upi_pin_length":6,
        "otp_length":6,
        "atm_pin_length":4,
        "fundsource_provider":{
          "name":"HDFC Bank",
          "upi_iin":"600007",
          "upi_enabled":false,
          "mobile_registration_format":"format1",
          "logo_url":"<bank logo url>"
        },
        "vpas":{
          "entity":"upi.collection",
          "count":1,
          "items":[
            {
              "mobile":"9999999999",
              "address":"vpa@handle",
              "status":"active",
              "primary":true
            }
          ]
        }
      }
    ]
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="refresh" type="boolean">
  Possible values:

  * `true`: If set to `true`, data is fetched via NPCI. We recommend passing this as `true` when customers are trying to link their bank accounts.
  * `false`: Data stored at PSP is fetched.
</ParamField>

<ParamField query="upi_iin" type="string" required>
  IIN of the bank returned in the response of the Fetch Fund Source Providers API. Use the IIN of the bank selected by the customer. IIN is not mandatory if this parameter value is `false`.
</ParamField>

<ParamField query="skip" type="integer">
  Number of entities to skip. Default is `10`. You can use this parameter for pagination in combination with skip.
</ParamField>

<ParamField query="count" type="integer">
  Number of entities to fetch. Default is `0`. You can use this parameter for pagination in combination with count.
</ParamField>

<ParamField query="device_ip" type="string">
  IP address of the device. For example, `123.456.123.123`.
</ParamField>

<ParamField query="device_geocode" type="string">
  Location coordinates of the device. For example, `12.9667,77.5667`.
</ParamField>

## Response Parameters

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

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

<ResponseField name="items" type="array">
  Indicates a list of objects.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the entity type name. In this case `fundsource`.
</ResponseField>

<ResponseField name="id" type="string">
  A unique identifier of the entity.
</ResponseField>

<ResponseField name="type" type="string">
  Type of account. For example, savings, credit and so on.
</ResponseField>

<ResponseField name="customer_name" type="string">
  Account holder's name.
</ResponseField>

<ResponseField name="masked_account_number" type="string">
  Masked account number.
</ResponseField>

<ResponseField name="account_reference_number" type="string">
  Indicates the account reference number.
</ResponseField>

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

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

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

<ResponseField name="upi_pin_length" type="integer">
  Indicates the length of the UPI PIN.
</ResponseField>

<ResponseField name="otp_length" type="integer">
  Indicates the length of the OTP.
</ResponseField>

<ResponseField name="atm_pin_length" type="integer">
  Indicates the length of the ATM PIN.
</ResponseField>

<ResponseField name="fundsource_provider" type="object">
  Payment sources provider details. If the payment source is a bank, payment source providers will be bank account information.
</ResponseField>

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

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

<ResponseField name="upi_enabled" type="boolean">
  Indicates if UPI is enabled. Possible values:

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

<ResponseField name="mobile_registration_format" type="string">
  Indicates the format as defined by NPCI - `format1`, `format2` and so on.
</ResponseField>

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

<ResponseField name="vpas" type="array">
  The collection of the VPAs linked to the payment source.
</ResponseField>

<ResponseField name="entity" type="string">
  The entity type name. Here, it is `collection`.
</ResponseField>

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

<ResponseField name="items" type="array">
  UPI details.
</ResponseField>

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

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

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

<ResponseField name="primary" type="boolean">
  Indicates if the VPA is linked to the payment source marked as primary. Possible values:

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