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

# Identify the UPI Fund Source

> Know whether a UPI payment was made from a bank account, a credit card, a credit line or a wallet in your server-to-server integration.

Available in
🇮🇳 India

Customers can pay on UPI from more than a bank account. In their UPI app, they can choose a RuPay credit card, a credit line or a prepaid wallet linked to UPI.

You do not send anything extra in the payment request. The customer chooses the fund source in their UPI app. Create the payment as you do for [UPI Intent](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/upi/intent.md), [UPI Collect](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/upi/collect.md) or [UPI QR](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/upi/qr.md). Razorpay returns the fund source on the payment after the customer pays.

## Fund Sources

The `payer_account_type` field in the `upi` object of the payment tells you the fund source.

| Fund Source | Description | `payer_account_type` |
| - | - | - |
| Bank account | A savings or current account. This is the default. | `bank_account` |
| Credit Card on UPI | A RuPay credit card linked to the UPI app. | `credit_card` |
| Credit Line on UPI | A pre-sanctioned credit line. It can be interest-bearing or non-interest-bearing. | `credit_line` |
| PPI or wallet | A prepaid payment instrument or wallet. | `ppiwallet` |

## Where to Find the Fund Source

Read `upi.payer_account_type` from either of the following:

* The response of the [Fetch a Payment API](https://razorpay.com/docs/api/payments/fetch-with-id.md).
* The payment entity in the `payment.authorized` and `payment.captured` [webhook events](https://razorpay.com/docs/webhooks/payments.md).

It is never a part of the payment request.

## Sample Payloads

> [tab] Credit Card on UPI
>
> ```json payment.captured theme={null}
> {
>   "event": "payment.captured",
>   "contains": ["payment"],
>   "payload": {
>     "payment": {
>       "entity": {
>         "id": "pay_ERNEungCtXpZqM",
>         "amount": 50000,
>         "currency": "INR",
>         "status": "captured",
>         "method": "upi",
>         "vpa": "gauravkumar@exampleupi",
>         "upi": {
>           "payer_account_type": "credit_card"
>         }
>       }
>     }
>   }
> }
> ```

> [tab] Credit Line on UPI
>
> The `upi` object for an interest-bearing credit line:
>
> ```json Interest-bearing theme={null}
> "upi": {
>   "payer_account_type": "credit_line",
>   "credit_line": {
>     "type": "interest_bearing"
>   }
> }
> ```
>
> The `upi` object for a non-interest-bearing credit line:
>
> ```json Non-interest-bearing theme={null}
> "upi": {
>   "payer_account_type": "credit_line",
>   "credit_line": {
>     "type": "non_interest_bearing"
>   }
> }
> ```

> [tab] PPI or Wallet
>
> ```json upi object theme={null}
> "upi": {
>   "payer_account_type": "ppiwallet"
> }
> ```

> [tab] Bank Account
>
> ```json upi object theme={null}
> "upi": {
>   "payer_account_type": "bank_account"
> }
> ```

## Interest-Bearing and Non-Interest-Bearing Credit Lines

NPCI has split Credit Line on UPI into interest-bearing and non-interest-bearing credit lines. You may need to tell them apart for reconciliation, to verify the MDR charged and for accounting.

* `payer_account_type` is `credit_line` for every credit line payment. It does not tell you the type of the credit line.
* The `credit_line` object in the `upi` object carries the type. `credit_line.type` is `interest_bearing` or `non_interest_bearing`. The object is present only when `payer_account_type` is `credit_line`.
* The `credit_line` object is returned in the response of the Fetch a Payment API and in the `payment.captured` and `payment.failed` webhook events.

## Test Mode

You cannot test payments from a credit card, a credit line or a wallet in Test Mode. A test payment always has `payer_account_type` as `bank_account`. Verify these fund sources with a live payment.

### Related Information

* [UPI Transaction Limits](https://razorpay.com/docs/payments/payment-methods/transaction-limits/upi.md)
