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.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.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:The Order Pay API authenticates with the
- Your server creates an order with the Create Order API. The response returns a
payment_session_id. It doesn’t return a UPI link. - Your checkout processes the payment. In a custom integration, call the Order Pay API with
payment_method.upi.channelset tolinkfor UPI Intent,qrcodefor a dynamic QR code,podQrCodefor a POD QR code, orcollectwith aupi_idfor UPI Collect. UPI Collect requests also require client environment headers, such asx-client-deviceandx-client-os. For the full set of headers and their values, see Pass client environment details. - Your server receives the payment webhook with the final status.
- Sandbox:
https://sandbox.cashfree.com/pg - Production:
https://api.cashfree.com/pg
Headers
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.
- Point your integration to
https://sandbox.cashfree.com/pgand use your test keys. - Run each scenario in the following table and check that your system responds correctly.
- Check that webhooks arrive, that signature verification passes, and that your order status updates.
- Check that the Settlements tab appears in the Merchant Dashboard test environment. You can’t download settlement reports in the test environment.
- Create a refund on a successful sandbox payment and check the refund webhook.
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.
9
Go live
Complete the following steps to start accepting real payments:
- Confirm that your KYC is approved.
- Replace your test keys with production keys in your environment configuration. Check that no test key remains in your production build.
- Confirm your bank account by replying to the bank account confirmation email from Cashfree. Cashfree can’t settle funds to you until you confirm.
- 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.
- 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, andREFUND_STATUS_WEBHOOK. For details, see Configure webhooks. - Make one real payment yourself before you open the flow to customers.
Go-live checklist
Use this checklist to confirm that you’re ready to launch.Have you created your Cashfree account and verified your email?
Have you submitted your KYC documents, and has Cashfree approved them?
Have you confirmed your bank account by replying to the confirmation email?
Have you generated production API keys and removed every test key from your production build?
Have you tested, in the sandbox environment, every UPI flow that you enabled?
Have you tested the success, insufficient funds, incorrect PIN, expiry, abandoned, and refund scenarios?
Have you configured your webhook endpoints and confirmed that they receive events?
Have you implemented and tested webhook signature verification?
Have you reviewed your settlement cycle?
Do you understand how to process refunds and respond to disputes?
If you sell in person, have you activated Offline Payments, created collection points, and verified your agents?
Have you completed one real payment yourself?
Are you checking transactions and settlements daily for the first two weeks?
Troubleshooting
My first API call fails
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.Settlements are on hold after going live
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.
Payments are declined even though customers have enough balance
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.