Skip to main content
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:Next, compare the flows. You can enable more than one flow at the same time.
2

Create an account

Sign up on the Merchant Dashboard 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. Submit your KYC documents and bank account details. For the documents your business type needs, see Account activation.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.
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). 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.
4

Get API keys

Log in to the Merchant Dashboard 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.
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: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. 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.
  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:
Headers
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. 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.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 instead.
  • UPI Collect: Restricted. Don’t build on it unless your category is exempt. For the scope and exemptions, see UPI Collect Flow Deprecation.
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: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, 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.
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.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.
  • QR codes: Use the Simulate Payment API to set the outcome of the payment. For details, see Test QR code payments.
For more test data, see Sandbox environment. Map each failure to the right customer message. For the meaning of each code, see UPI error codes.
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.
  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.
  6. Make one real payment yourself before you open the flow to customers.
For the full list of checks, see the Go Live Checklist.

Go-live checklist

Use this checklist to confirm that you’re ready to launch.
Have you created your Cashfree account and verified your email?
You need a verified account to submit KYC and generate production API keys.
Sign up on the Merchant Dashboard and verify your email address.
Have you submitted your KYC documents, and has Cashfree approved them?
You can’t accept real payments until Cashfree approves your KYC.
For the documents your business type needs, see Account activation.
Have you confirmed your bank account by replying to the confirmation email?
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?
Test keys don’t work in production. Never expose your secret key in client-side code.
Log in to the Merchant Dashboard and go to Payment Gateway > Developers > API Keys.
Have you tested, in the sandbox environment, every UPI flow that you enabled?
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.
Have you tested the success, insufficient funds, incorrect PIN, expiry, abandoned, and refund scenarios?
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.
Have you configured your webhook endpoints and confirmed that they receive events?
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.
Have you implemented and tested webhook signature verification?
Without signature verification, your endpoint accepts any request that anyone sends to it.
For the verification steps, see Signature verification.
Have you reviewed your settlement cycle?
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.
Do you understand how to process refunds and respond to disputes?
Customers expect refunds and dispute responses from the day you go live.
If you sell in person, have you activated Offline Payments, created collection points, and verified your agents?
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.
Have you completed one real payment yourself?
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?
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 for bank and UPI app issues.

Troubleshooting

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.
Confirm that you replied to the bank account confirmation email and that all requested documents are submitted. For other causes, see Account FAQs.
The payment may exceed the limit for your MCC, or use a UPI flow blocked for your category. See UPI transaction limits.