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

# UPI Integration Guide

> Go from choosing a UPI flow to live UPI payments on Cashfree: complete KYC, get API keys, integrate, test in sandbox, and go live.

This guide takes you from choosing a UPI flow to accepting live UPI payments. It has nine steps. You can complete steps 4, 5, 6, and 8 in the sandbox environment while Cashfree verifies your Know Your Customer (KYC) details in step 3.

**1. Choose your UPI flows**

Choose the UPI flows that match how your customers pay you. Find the business model that describes you:

| Business model | Description | What to enable |
| :- | :- | :- |
| **Online only** | You sell through a website, an app, or both, with no physical counter. | **Payment Gateway**. UPI comes with it. Use UPI Intent for mobile checkout and dynamic QR codes for desktop checkout. |
| **Offline only** | You sell from a store or counter, with no website or app. | **Offline Payments (SoftPOS)**. Choose **Storefront** for a fixed counter, with one static QR code per store. Choose **Agent (softPOS)** if your staff move around. Offline Payments needs an active Payment Gateway account. |
| **Online and offline** | You sell online and also take payments in person. | **Payment Gateway** for online payments, plus **Offline Payments (SoftPOS)**, with Storefront or Agent (softPOS), for in-person payments. |
| **Field collection** | Your staff or agents collect payments away from a fixed location, such as at the customer's door. | **[Offline Payments (SoftPOS)](https://www.cashfree.com/docs/payments/softpos/introduction.md)**, with **Agent (softPOS)**. Agents collect payments through a QR code, a payment link, or Tap and Pay on an Android phone. |

Next, compare the flows. You can enable more than one flow at the same time.

| Flow | Use for | Integration effort | What the customer does |
| :- | :- | :- | :- |
| **[UPI Intent](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-intent.md)** | Mobile app and mobile website checkout | Low (SDK or API) | Taps a UPI app and enters their PIN. |
| **[Dynamic QR code](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-qr-codes.md#dynamic-qr-codes)** | Desktop checkout, kiosks, and point-of-sale systems | Medium (API) | Scans the code and enters their PIN. The amount is filled in. |
| **[POD QR code](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-qr-codes.md#pay-on-delivery-pod-qr-codes)** | Deliveries, printed bills, and invoices sent ahead of payment | Medium (API) | Scans the code and enters their PIN. The amount is filled in. The same code keeps working until it expires. |
| **[Storefront](https://www.cashfree.com/docs/payments/softpos/collection-point-setup.md#storefront-setup)** | A fixed counter or store with no website or app | Low (activation, then display) | Scans the code, types the amount, and enters their PIN. |
| **[UPI Collect](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-collect.md)** | Only exempt categories and iOS | Low (API) | Enters their UPI ID and approves the request in their UPI app. |
| **[Offline Payments](https://www.cashfree.com/docs/payments/softpos/introduction.md)** | Field agents, delivery staff, and stores | Low (app installation) | Scans a QR code, taps a card, or pays through a link. |

**2. Create an account**

Sign up on the [Merchant Dashboard](https://merchant.cashfree.com/merchants/signup) and enter your basic business details, such as your business name, business type, Permanent Account Number (PAN), and contact details. After you sign up, you can use the sandbox environment immediately.

You can generate test API keys and build your full integration now. You can't accept real payments until your KYC is approved.

**3. Complete KYC**

Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login). Submit your KYC documents and bank account details. For the documents your business type needs, see [Account activation](https://www.cashfree.com/docs/help/account/account-activation.md).

To verify your bank account, Cashfree sends ₹1 to it and emails you a bank account confirmation. Reply to that email after the amount arrives. Cashfree can't settle funds to you until you confirm.

> [!TIP]
>
> If you must go live by a fixed date, submit KYC before you start building. KYC verification usually takes longer than the integration.

Cashfree assigns your Merchant Category Code (MCC) based on the business details, website, and products you declare. You can't choose your own MCC. Your MCC decides your UPI limits, which UPI flows you can use, and whether you need [Third Party Validation (TPV)](https://www.cashfree.com/docs/payments/features/tpv.md). If you sell across more than one business line, tell Cashfree now, because a wrong MCC causes declines later. For details, see [UPI transaction limits](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-transaction-limits.md).

**4. Get API keys**

Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) and go to **Payment Gateway > Developers > API Keys**. Test keys are available immediately. To get production keys, click **Generate API Keys** and complete two-factor authentication after your KYC is approved.

Each server-side API request uses your client ID in the `x-client-id` header and your secret key in the `x-client-secret` header. For details, see [Authentication](https://www.cashfree.com/docs/api-reference/authentication.md).

> [!WARNING]
>
> Never expose your secret key in client-side code. Make every call that uses it from your server. Keep test keys and production keys in separate environment configurations, so test keys never reach production.

**5. Choose an integration path**

Your integration path is the hardest decision to reverse, so choose it before you build. The following table compares the options:

| Your situation | Integration path | Trade-off |
| :- | :- | :- |
| You want to go live quickly with minimal code. | [Hosted Checkout](https://www.cashfree.com/docs/payments/online/web/redirect.md). You redirect customers to a payment page that Cashfree hosts. | Less control over the checkout's look, and the customer leaves your domain briefly. |
| You want full control over the checkout interface. | A custom integration with the [Order Pay API](https://www.cashfree.com/docs/api-reference/payments/latest/payments/order-pay.md). You build the interface and call the APIs. | More build time. You handle webhooks, retries, and error messages. |
| You have a mobile app. | A mobile SDK for [Android](https://www.cashfree.com/docs/payments/online/mobile/android.md), [iOS](https://www.cashfree.com/docs/payments/online/mobile/ios.md), [React Native](https://www.cashfree.com/docs/payments/online/mobile/react-native.md), [Flutter](https://www.cashfree.com/docs/payments/online/mobile/flutter.md), or [Cordova](https://www.cashfree.com/docs/payments/online/mobile/cordova.md). | Little. This is the standard choice for apps. |
| You sell only in person. | [Offline Payments](https://www.cashfree.com/docs/payments/softpos/introduction.md). Skip step 6. | Storefront doesn't link payments to orders. To match payments per transaction or per customer, use Agent (softPOS) or Customer VPA. |

If you use Hosted Checkout, Cashfree enables UPI Intent, QR codes, and UPI Collect for you, and shows each customer only the flows allowed on their device.

Moving from Hosted Checkout to a custom integration later means rebuilding your checkout interface, but your order creation and webhook code still works. Adding a mobile SDK or in-person payments later doesn't affect your existing integration. If you're not sure, start with Hosted Checkout.

**6. Integrate online payments**

Every online UPI payment follows the same three stages, whichever path you choose:

1. Your server creates an order with the [Create Order API](https://www.cashfree.com/docs/api-reference/payments/latest/orders/create-order.md). The response returns a `payment_session_id`. It doesn't return a UPI link.
2. Your checkout processes the payment. In a custom integration, call the Order Pay API with `payment_method.upi.channel` set to `link` for UPI Intent, `qrcode` for a dynamic QR code, `podQrCode` for a POD QR code, or `collect` with a `upi_id` for UPI Collect. UPI Collect requests also require client environment headers, such as `x-client-device` and `x-client-os`. For the full set of headers and their values, see [Pass client environment details](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-collect.md#pass-client-environment-details).
3. Your server receives the payment webhook with the final status.

Use the following base URLs:

* Sandbox: `https://sandbox.cashfree.com/pg`
* Production: `https://api.cashfree.com/pg`

Server-side APIs, such as the Create Order API, need the following headers:

```http Headers theme={"dark"}
x-client-id: <CLIENT_ID>
x-client-secret: <CLIENT_SECRET>
x-api-version: 2026-01-01
Content-Type: application/json
```

The Order Pay API authenticates with the `payment_session_id`, so it doesn't need your client ID and secret. Pass the `x-api-version` header with the API version you use. Call APIs that need your client secret only from your server, never from your app or website.

A request without `x-api-version` fails. This is a common error in a first API call.

Confirm the payment status on your server, from the webhook or the [Get Order API](https://www.cashfree.com/docs/api-reference/payments/latest/orders/get-order.md). The customer's return to your website or app doesn't confirm a payment, because the customer can close the tab or lose their connection before the bank responds. Verify the signature of every webhook before you act on it. For details, see [Signature verification](https://www.cashfree.com/docs/payments/online/webhooks/signature-verification.md).

Enable the following UPI flows:

* **UPI Intent**: Enable it for mobile app and mobile website checkout.
* **Dynamic QR codes**: Enable them for desktop checkout, kiosks, and point-of-sale systems. For deliveries, printed bills, and invoices sent ahead of payment, generate [POD QR codes](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-qr-codes.md#pay-on-delivery-pod-qr-codes) instead.
* **UPI Collect**: Restricted. Don't build on it unless your category is exempt. For the scope and exemptions, see [UPI Collect Flow Deprecation](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-collect.md).

**7. Set up in-person payments (optional)**

Skip this step if you sell only online. Offline Payments (SoftPOS) offers three collection modes for in-person payments. A virtual payment address (VPA) is the UPI ID that a customer pays from or to, such as `name@bank`. The following table compares the modes:

| Attribute | Storefront | Agent (softPOS) | Customer VPA |
| :- | :- | :- | :- |
| **Use for** | A fixed counter, with one static QR code per store | Staff who move around, deliveries, field collection, and multiple counters | The same customer paying you repeatedly, such as for equated monthly instalments (EMIs) or school fees |
| **What the customer does** | Scans the store QR code, types the amount, and enters their UPI PIN | Scans a QR code that your agent shows, taps a card, or pays through a link that you send | Pays to a UPI ID or QR code created only for them |
| **Amount** | Typed by the customer, so it can be wrong | Entered by your agent, or typed by the customer for a static QR code | Typed by the customer |
| **Reconciliation** | Per store. Not linked to a single order. | Per transaction, per agent, and per collection point | Per customer |
| **Setup** | Add a collection point, then display the QR code | Add a collection point, install the app, and register and verify each agent | Add a collection point for the customer |
| **Hardware** | None | An Android phone. Tap and Pay needs Near Field Communication (NFC). | None |

Choose Storefront for a fixed counter where you don't need to match each payment to an order. Choose Agent (softPOS) if you need to know which agent collected each payment, or if you collect payments away from a fixed counter. Choose Customer VPA if the same customer pays you repeatedly.

To activate Offline Payments, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login), go to **Offline Payments**, and click **Request Activation**. After activation, add a collection point for each mode that you use. If you don't see **Customer VPA** as a collection type, contact your Cashfree account manager to enable it. For details, see [Get started with Offline Payments](https://www.cashfree.com/docs/payments/softpos/how-softpos-works.md).

**8. Test your integration**

Test in the sandbox environment before you switch to production keys. The sandbox uses the same APIs and webhook format as production. It returns a fixed set of test error responses, so you can't simulate every production error.

1. Point your integration to `https://sandbox.cashfree.com/pg` and use your test keys.
2. Run each scenario in the following table and check that your system responds correctly.
3. Check that webhooks arrive, that signature verification passes, and that your order status updates.
4. Check that the **Settlements** tab appears in the Merchant Dashboard test environment. You can't download settlement reports in the test environment.
5. Create a refund on a successful sandbox payment and check the refund webhook.

The following test UPI IDs apply only to UPI Collect, where the customer enters a UPI ID. Pass one as the `upi_id` in place of a real UPI ID to force an outcome. The UPI Collect restrictions apply in sandbox too, so use these only where your integration can use UPI Collect.

| Test UPI ID | Outcome | What to check |
| :- | :- | :- |
| `testsuccess@gocash` | The payment succeeds. | The order is marked paid, the success webhook arrives and passes verification, and the customer sees a confirmation. |
| `testinsufficientfunds@gocash` | The payment fails for insufficient funds. | The customer sees a message asking them to use another account, not a raw error code. |
| `testinvalidpin@gocash` | The payment fails for an incorrect UPI PIN. | The customer can try again. |
| `testexpired@gocash` | The customer doesn't complete the payment in time. | The order doesn't stay pending indefinitely. |
| `testuserdropped@gocash` | The payment status is `user_dropped`. | The **User Dropped Payment** webhook arrives, and the order stays `ACTIVE` because it has no successful payment. |

UPI Intent and QR codes don't use a UPI ID. To test their outcomes, use the following methods:

* **UPI Intent**: Use the Cashfree UPI simulator app on an Android device or emulator to approve or decline the payment. For details, see [Test UPI Intent](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-intent.md#test-upi-intent).
* **QR codes**: Use the Simulate Payment API to set the outcome of the payment. For details, see [Test QR code payments](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-qr-codes.md#test-qr-code-payments).

For more test data, see [Sandbox environment](https://www.cashfree.com/docs/payments/online/resources/sandbox-environment.md). Map each failure to the right customer message. For the meaning of each code, see [UPI error codes](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-error-codes.md).

**9. Go live**

Complete the following steps to start accepting real payments:

1. Confirm that your KYC is approved.
2. Replace your test keys with production keys in your environment configuration. Check that no test key remains in your production build.
3. Confirm your bank account by replying to the bank account confirmation email from Cashfree. Cashfree can't settle funds to you until you confirm.
4. Review your settlement cycle. The default is T+2, which means two business days after the payment. Faster cycles are available after approval. For details, see [Settlements](https://www.cashfree.com/docs/payments/manage/settlements.md#settlement-cycles).
5. Configure webhooks and subscribe to the **Success Payment**, **Failed Payment**, **User Dropped Payment**, and **Refund** events. Their payloads carry the types `PAYMENT_SUCCESS_WEBHOOK`, `PAYMENT_FAILED_WEBHOOK`, `PAYMENT_USER_DROPPED_WEBHOOK`, and `REFUND_STATUS_WEBHOOK`. For details, see [Configure webhooks](https://www.cashfree.com/docs/payments/online/webhooks/configure.md).
6. Make one real payment yourself before you open the flow to customers.

For the full list of checks, see the [Go Live Checklist](https://www.cashfree.com/docs/payments/online/go-live/checklist.md).

## Go-live checklist

Use this checklist to confirm that you're ready to launch.

Have you created your Cashfree account and verified your email?

Yes
No
N/A

You need a verified account to submit KYC and generate production API keys.

Sign up on the [Merchant Dashboard](https://merchant.cashfree.com/merchants/signup) and verify your email address.

Have you submitted your KYC documents, and has Cashfree approved them?

Yes
No
N/A

You can't accept real payments until Cashfree approves your KYC.

For the documents your business type needs, see [Account activation](https://www.cashfree.com/docs/help/account/account-activation.md).

Have you confirmed your bank account by replying to the confirmation email?

Yes
No
N/A

Cashfree can't settle funds to you until you confirm your bank account.

Cashfree sends ₹1 to your bank account and emails you a bank account confirmation. Reply to that email after the amount arrives.

Have you generated production API keys and removed every test key from your production build?

Yes
No
N/A

Test keys don't work in production. Never expose your secret key in client-side code.

Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) and go to **Payment Gateway > Developers > API Keys**.

Have you tested, in the sandbox environment, every UPI flow that you enabled?

Yes
No
N/A

An untested flow can fail for real customers after you go live.

Point your integration to the sandbox URL and use your test keys. For test data, see [Sandbox environment](https://www.cashfree.com/docs/payments/online/resources/sandbox-environment.md).

Have you tested the success, insufficient funds, incorrect PIN, expiry, abandoned, and refund scenarios?

Yes
No
N/A

If you show the same message for every failure, customers retry payments that can't succeed and abandon ones that could.

Use the test methods in step 8. For the meaning of each failure, see [UPI error codes](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-error-codes.md).

Have you configured your webhook endpoints and confirmed that they receive events?

Yes
No
N/A

Confirm the final payment status on your server, from the webhook or the Get Order API.

Subscribe to the **Success Payment**, **Failed Payment**, **User Dropped Payment**, and **Refund** events. For details, see [Configure webhooks](https://www.cashfree.com/docs/payments/online/webhooks/configure.md).

Have you implemented and tested webhook signature verification?

Yes
No
N/A

Without signature verification, your endpoint accepts any request that anyone sends to it.

For the verification steps, see [Signature verification](https://www.cashfree.com/docs/payments/online/webhooks/signature-verification.md).

Have you reviewed your settlement cycle?

Yes
No
N/A

The default cycle is T+2. Faster cycles are available only after approval.

For the available cycles and how weekends and bank holidays affect payouts, see [Settlements](https://www.cashfree.com/docs/payments/manage/settlements.md#settlement-cycles).

Do you understand how to process refunds and respond to disputes?

Yes
No
N/A

Customers expect refunds and dispute responses from the day you go live.

See [Refunds](https://www.cashfree.com/docs/payments/manage/refunds/overview.md) and [Chargebacks and disputes](https://www.cashfree.com/docs/payments/manage/disputes/overview.md).

If you sell in person, have you activated Offline Payments, created collection points, and verified your agents?

Yes
No
N/A

A collection point can accept payments only when its status is **Provisionally Active** or **Active**.

For the setup steps, see [Get started with Offline Payments](https://www.cashfree.com/docs/payments/softpos/how-softpos-works.md).

Have you completed one real payment yourself?

Yes
No
N/A

A real payment confirms that your production setup works before customers use it.

After the payment, check that it appears in the Merchant Dashboard and that your webhook received it.

Are you checking transactions and settlements daily for the first two weeks?

Yes
No
N/A

Problems in a new integration usually appear in the first few days of live traffic.

Review your transactions and settlements in the Merchant Dashboard, and check [Downtimes](https://www.cashfree.com/docs/payments/manage/downtimes.md) for bank and UPI app issues.

## Troubleshooting

> [accordion] My first API call fails
>
> Check that the request includes the `x-api-version` header, and that you use test keys with the sandbox URL and production keys with the production URL.

> [accordion] Settlements are on hold after going live
>
> Confirm that you replied to the bank account confirmation email and that all requested documents are submitted. For other causes, see [Account FAQs](https://www.cashfree.com/docs/help/account/faq.md).

> [accordion] Payments are declined even though customers have enough balance
>
> The payment may exceed the limit for your MCC, or use a UPI flow blocked for your category. See [UPI transaction limits](https://www.cashfree.com/docs/payments/manage/payment-methods/upi-transaction-limits.md).

Related topics

<ul>
  <li>[Create Order API](https://www.cashfree.com/docs/api-reference/payments/latest/orders/create-order.md)</li>
  <li>[Order Pay API](https://www.cashfree.com/docs/api-reference/payments/latest/payments/order-pay.md)</li>
  <li>[Go Live Checklist](https://www.cashfree.com/docs/payments/online/go-live/checklist.md)</li>
</ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.