# API Best Practices Source: https://www.cashfree.com/docs/api-reference/api-best-practices Recommended practices for building secure, reliable, and performant integrations with Cashfree APIs. Building a reliable Cashfree API integration requires more than correct API calls. These practices cover security, error handling, performance, and testing the areas most likely to cause issues if overlooked. ## Security Apply the following practices to protect your API credentials and ensure only legitimate requests reach your integration. ### Verify webhook signatures Always verify the signature of every incoming webhook payload before processing it. Skipping this step exposes your integration to spoofed or tampered requests. Never process a webhook payload without first validating its signature. For step-by-step instructions and code examples, see the webhook signature verification page for your product. ### Secure your API keys Exposed API keys (`x-client-id` and `x-client-secret`) can result in unauthorised transactions and data breaches. Apply the following controls to protect your keys. * Never commit API keys to version control. * Never expose API keys in client-side or browser-facing code. * Store keys in environment variables or a dedicated secrets manager. * Restrict key access to only the services and environments that require it. * Rotate keys immediately if you suspect they have been compromised. ### Avoid logging sensitive data Do not log raw API request or response bodies that contain sensitive fields such as card numbers, CVVs, bank account details, or authentication tokens. Logging this data creates a PCI DSS compliance risk and increases the potential impact of a security breach. Log only the fields required for debugging, such as order IDs, status codes, and timestamps. ## Reliability Follow these practices to ensure your integration handles failures gracefully and maintains consistent behaviour under load. ### Use idempotency keys Include a unique idempotency key in every mutating request (for example, payment creation or refund initiation) using the `x-idempotency-key` request header. If a request fails or times out, retrying with the same key prevents duplicate transactions. ```http theme={"dark"} x-idempotency-key: ``` Use a UUID as the key value. Generate a new UUID for each logical operation, and reuse the same key only when retrying that specific request. ### Subscribe to webhooks instead of polling Subscribe to webhook events instead of polling the API for status updates. Polling consumes rate limit quota and introduces unnecessary latency into your integration. For setup instructions, see [webhooks](/docs/payments/online/webhooks/overview) for further detailed information. ### Avoid concurrent requests Do not send multiple simultaneous requests from the same account. Concurrent requests increase the likelihood of rate limit errors and can degrade integration performance. If your use case requires high request volume, use a queue or a similar mechanism to process requests sequentially and manage throughput. ### Include a request ID Add a unique identifier to each request using the `x-request-id` header. This makes it easier to trace requests in logs, correlate errors, and collaborate with Cashfree support during troubleshooting. ## Performance Apply the following practices to reduce latency, manage throughput, and make efficient use of your API quota. ### Handle rate limit errors When your integration receives a rate limit error, pause all outgoing requests and apply the following logic before retrying. * If the `x-ratelimit-retry` response header is present, wait the number of seconds it specifies before retrying. * If the `x-ratelimit-remaining` header value is `0`, do not send another request until the time indicated by `x-ratelimit-reset` has passed. When applying exponential backoff, start with a one-second delay and double the wait time with each subsequent attempt (2s, 4s, 8s). Add a small random jitter to each interval to prevent multiple clients from retrying simultaneously. Limit retries to three to five attempts. To increase your rate limit or burst limit, raise a request through the [Merchant Dashboard](https://merchant.cashfree.com/merchants/pg/developers/rate-limits). For detailed steps, see the rate limits page for your product. ### Optimise connections with keep-alive Use HTTP keep-alive to reuse a single connection across multiple API requests. This reduces per-request latency and lowers resource usage on both client and server. Set the following header in all API requests. ```http theme={"dark"} Connection: keep-alive ``` ## Integration Follow these practices to ensure your integration stays current, reduces manual effort, and aligns with Cashfree's supported conventions. ### Specify the API version Always use the latest API version to access current features, performance improvements, and security updates. Cashfree APIs use a date-based versioning scheme. Specify the version in the `x-api-version` request header using the format `YYYY-MM-DD`. ```http theme={"dark"} x-api-version: 2025-01-01 ``` If you are on an older version, upgrade to the latest to benefit from new capabilities and bug fixes. ### Use Cashfree SDKs Cashfree provides official SDKs in popular programming languages to reduce integration effort. The SDKs handle authentication, request and response formatting, response parsing, and error handling. Access pre-built libraries for your preferred language and start integrating faster. ## Testing Complete all integration testing in the Cashfree sandbox environment before deploying to production. The sandbox replicates production behaviour without processing real transactions. To retrieve your sandbox API keys, follow these steps. 1. Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) and sign in with your credentials. 2. Navigate to your product under **Developers** > **API Keys**. 3. Copy the test mode keys and use them in your sandbox environment.

Related topics

# Authentication Source: https://www.cashfree.com/docs/api-reference/authentication Learn how to authenticate Cashfree APIs using API keys, generate sandbox and production credentials, and pass headers correctly across payments and payouts. Almost all Cashfree APIs require authentication. There are some exceptions like the `/order/sessions` Payments API. Each Cashfree product requires its own unique client ID and client secret. For example, if you are using both the Payments API and the Payouts API, you must generate separate credentials for each. This means one set of keys for the Payments API and a different set of keys for the Payouts API. ## Merchant authentication * The standard authentication for merchants uses two specific headers `x-client-id` and `x-client-secret`. Pass your `appId` and `secretKey` in these fields. * Ensure that you place your secret key securely and that no one else can access it. * Also never call any API which requires authentication from the client as that would require you to expose the secret key to the client. Below is a curl request which shows how to send these headers in the API call. ```bash theme={"dark"} curl --request {REQUEST-TYPE} \ --url https://sandbox.cashfree.com/pg/{resource} \ --header 'Content-Type: application/json' \ --header 'x-api-version: 2025-01-01' \ --header 'x-client-id: ' \ --header 'x-client-secret: ' ... ... ``` ## Generate API keys Each Cashfree product requires its own unique client ID and client secret. For example, if you are using both the Payments API and the Payouts API, you must generate separate credentials for each. This means one set of keys for the Payments API and a different set of keys for the Payouts API. Follow the below steps to generate your API key for Payment Gateway. 1. Go to **Payment Gateway Dashboard** > and click on **Developers** icon in the right navigation or click **Developers** on the top right of the [Merchant Dashboard](https://merchant.cashfree.com/merchants). 2. Click **API Keys** under Payment Gateway.\ In the test environment, Cashfree auto-generates your API keys. In the production environment, click **Generate API Keys** and complete the 2FA authentication to generate the keys. Cashfree uses separate credentials for each environment, so ensure you use the correct set for the environment you are working in. 3. Once generated, the dashboard shows the API keys in a masked format. To view the full set of keys, click the icon and select **View API Key**. In the production environment, you would be required to do 2FA authentication to view the keys. You must securely store your api keys at all times. You can also navigate directly to your [Production API credentials](https://merchant.cashfree.com/merchants/pg/developers/api-keys?env=prod) in the Merchant Dashboard. View API Keys You can only generate a single API key pair at a time. Once you generate the keys from the dashboard, keep them secure. If it is lost, you need to re-generate them from the dashboard. ## Partner authentication If you are building a platform and want to use the Payment APIs on behalf of your customers you can do so using by leveraging authentication for platforms. You should use the **x-partner-apikey** and **x-partner-merchantid** headers instead of the **x-client-id** and **x-client-secret** headers. * **x-partner-apikey**: This is the common API Key generated and unique for each Partner * **x-partner-merchantid**: This is the unique merchant ID for each merchant associated with the Partner.\ To view the merchant ID for each merchant, login to your Cashfree Partner Dashboard with your partner login credentials > go to the **Merchants** section, and copy the **Merchant ID** of the respective merchant. Click [here](/docs/partners/embedded/integration/gateway-integration#partner-api-keys) to know how to generate partner authentication keys. # Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/overview-ts Resolve common Cashfree integration issues across payments, payouts, webhooks, SDKs, and Secure ID with quick fixes, error references, and debug steps. Integration errors can occur due to incorrect configurations, missing features, or environment mismatches. This guide outlines the most common issues across Cashfree products and provides actionable steps to help you resolve them quickly and ensure a smooth integration experience. Resolve common integration issues related to accepting online and in-person payments. Troubleshoot payout failures, IP whitelisting errors, and other disbursal-related issues. Diagnose and fix issues related to identity verification and document validation flows. Learn how to handle webhook delivery failures, signature mismatches, and response timeouts. Get help with integration errors and compatibility issues across Cashfree’s SDKs. # Payments Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/payments-ts Troubleshoot Cashfree integration issues including authentication failures, order creation errors, UPI flow problems, and checkout configuration. The Authentication fails when: * Test credentials are used in the production environment or vice versa. * Client ID and Client Secret are passed in the request body instead of as headers. * API keys from different environments are mixed (for example, a Sandbox App ID used with a Production Secret Key). * Incorrect API keys are used, such as keys copied incorrectly or taken from a different account. To troubleshoot this issue, follow these steps: * Ensure you are using the correct API keys displayed in the [Merchant Dashboard](https://merchant.cashfree.com/auth/login). * Use test credentials in the test environment and production credentials in the live environment. For example, use the Client ID and Client Secret generated for the Test/Sandbox environment when making requests to `https://sandbox.cashfree.com`. * When calling the production API, use the Production API Key and Secret Key with the Production endpoint (for example, `https://api.cashfree.com/pg/orders/{order_id}`). Do not mix Sandbox credentials with the Production endpoint, or vice versa. * Pass the Client ID and Client Secret as headers, not in the request body. * Ensure both keys are from the same environment. For more details, refer to the [authentication documentation](/docs/api-reference/authentication). This scenario covers multiple concerns, such as server-to-server (S2S) feature is enabled for you, but it isn't approved for your account or vice versa. To troubleshoot this issue, follow these steps: * The prerequisite for S2S is that it requires PCI DSS compliance. * To enable it, contact your Account Manager or fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). Once your account is reviewed and approved, this feature will be enabled. The payment mode that the merchant is trying to make the payment isn't enabled for the respective account. To troubleshoot this issue, follow these steps: * Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) and go to **Settings > Payment Methods** to enable the mode. * Alternatively, contact your Account Manager or fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). To troubleshoot this issue, follow these steps: * The user needs to log out of the Amazon account from that system, clear the browser cache and try once again. If you're encountering null or empty objects in the Get Order API response, please consider below cases. * When no payment is associated with the order yet. ie a payment has not yet been attempted against the Order. * If there's a delay in the payment being recorded due to bank or network delays. * You are hitting the Get payments for an order API before your end customer has tried to pay. To troubleshoot this issue, follow these steps: * Please Configure webhooks to receive real-time payment updates. * Use the Get Payments for Order API, as the Get Order Status API will only return the order's current state and not the payment specifics. The [Get Payments for an Order API](/docs/api-reference/payments/latest/payments/get-payments-for-an-order) (`GET /pg/orders/{order_id}/payments`) returns an empty array (`[]`) when no payment attempt exists for the order. This happens if the customer opens checkout and then exits, closes the page, or goes back without selecting a payment method such as UPI, card, or netbanking. Cashfree creates a payment object only after the customer selects a method and starts an attempt. Handle the response as follows: * Empty array (`[]`): no payment attempt. Do not treat this as `USER_DROPPED`. `USER_DROPPED` appears on a payment object after the customer selected a method and then left the flow. * One or more payment objects: use `payment_status` on each object. Possible values are `SUCCESS`, `FAILED`, `PENDING`, `NOT_ATTEMPTED`, `USER_DROPPED`, `VOID`, and `CANCELLED`. The [Get Payments for an Order API](/docs/api-reference/payments/latest/payments/get-payments-for-an-order) requires the following headers: * `x-api-version`: the API version you integrate with. Latest is `2026-01-01`. * `x-client-id`: your App ID. * `x-client-secret`: your Secret Key. Platforms that call the API on behalf of merchants use `x-partner-apikey` and `x-partner-merchantid` instead of `x-client-id` and `x-client-secret`. See [API authentication](/docs/api-reference/authentication). Pass the dummy mobile number `9999999999` in the `customer_phone` field of your [Create Order API](/docs/api-reference/payments/latest/orders/create-order) request to avoid storing payment instrument details such as cards or UPI handles. Cashfree does not store instrument details against this dummy number. If you're encountering this issue, please consider below cases. * More than two decimal places have been provided for the 'order\_amount' field. For example, `10.123` or `11089.360` are invalid; `11089.36` is valid. * Order Amount is 0 or negative. * You have exceeded the maximum amount limit set for your MID. To troubleshoot this issue, follow these steps: * Configure `order_amount` with a maximum of two decimal places. * A minimum amount of one rupee is required. * Kindly get the maximum amount limit raised for your Merchant ID. Please contact your Account Manager or fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) If you're encountering this issue, please check if your Merchant Category Code (MCC) is under the blocked list for UPI Intent. This feature is not allowed for certain categories of business due to RBI regulations. To troubleshoot this issue, please contact your Account Manager or fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) When a customer enters invalid card details, Cashfree checkout displays an error message so they can correct the details and retry. For the standard Payment Gateway checkout, `customer_phone` is a required field during order creation. You cannot omit the phone number or pass an empty value. The standard checkout pre-fills the value you provide and allows the customer to edit it before completing the payment. The phone number does not directly affect the availability of UPI Intent or UPI QR. It is used for checkout personalisation and eligibility, including recommended payment methods, offers, Pay Later eligibility, card saving, and card linking. This mismatch can occur when multiple payment attempts are made against the same Order ID. One attempt may fail (for example, due to insufficient funds) while a subsequent attempt succeeds. The Merchant Dashboard reflects the final successful status of the order, but your API response may be capturing one of the earlier failed attempts. To see all payment attempts and their respective statuses for a specific order, use the [Get Payments for an Order API](/docs/api-reference/payments/latest/payments/get-payments-for-an-order). To retrieve `cf_payment_id` values, use the [Get Payments for an Order API](/docs/api-reference/payments/latest/payments/get-payments-for-an-order). Pass the order ID as a path parameter. The response returns a list of all payment attempts made for that order, each containing its `cf_payment_id`. If the [Get Payment by ID API](/docs/api-reference/payments/latest/payments/get-payment-by-id) returns `NOT_ATTEMPTED` while the webhook confirms `SUCCESS`, verify that you are passing the correct `cf_payment_id` in the API request path. Ensure you are not passing a phone number or any other session-derived value in the URL path where the API expects the `cf_payment_id` (for example, `/pg/orders/{order_id}/payments/{cf_payment_id}`). Always extract the `cf_payment_id` directly from the Cashfree webhook payload or the initial payment response. To check the status of a specific payment against an order, use the endpoint `https://api.cashfree.com/pg/orders/{order_id}/payments/{cf_payment_id}`. This API returns the details of the payment ID passed, including the `payment_status` field. You can generate sample API responses for various payment modes by referring to the [Order Pay documentation](/docs/api-reference/payments/latest/payments/order-pay). Within the documentation or testing environment, you can toggle between different payment modes to view their specific response structures. # Payouts Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/payouts-ts Troubleshoot Cashfree Payouts errors including IP whitelisting, beneficiary validation, transfer failures, balance checks, and signature verification flows. This issue arises when the API requests are made from a non-whitelisted IP address. To troubleshoot this issue, follow this step: * Refer to the [Payouts documentation](/docs/api-reference/payouts/getting-started-with-payouts-apis#whitelist-your-ip-address) to whitelist your IP address. This issue arises due to intermittent downtimes at Cashfree's end. To troubleshoot this issue, please retry this API after 10 - 15 minutes. # SDK Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/sdk-ts Troubleshoot Cashfree SDK integration issues for Android, iOS, Flutter, React Native, and web JS, including build, initialisation, and checkout failures. ### Mobile SDKs To troubleshoot this issue, follow this step: * Always use the latest SDK versions. Check the [Changelog](/docs/payments/developers/changelog/android) for updates. When the user is trying to install apps from sources other than the Play Store / App Store and test them in a Production environment then Cashfree mobile SDK Android, React Native, Flutter, Cordova, Ionic, Capacitor will block the transaction. This error also occurs when the application package is not whitelisted by Cashfree or when you are using an outdated SDK version. Whitelist your app package or check the whitelisting status in the [Merchant Dashboard](https://merchant.cashfree.com/auth/login). See [Whitelist Your Website or App](/docs/payments/online/go-live/whitelist). Upgrade your Flutter SDK to the latest stable version (for example, 2.4.0+52 or higher). Test with a build uploaded to the Google Play Store (or as a Play Store tester) so the source is recognised as trusted. To troubleshoot this issue, follow these steps: * Provide the package name of your internal testing application to Cashfree support so they can add it to the approved list. * See the guidelines for testing apps in [production environments](/docs/payments/online/mobile/misc/cashfree_integrity_prod_testing). This issue occurs when there is an NDK version mismatch between your local setup and the SDK requirements.\ To troubleshoot this issue, follow these steps: * Update the ndk.dir path in your local.properties file:\ `ndk.dir=/path/to/ndk/` * Alternatively, open Android Studio > SDK Manager > SDK Tools, and install the required NDK version. This issue occurs when Gradle cannot find the required Cashfree dependencies.\ To troubleshoot this issue, follow these steps: * Add the following repositories inside android/build.gradle under allprojects > repositories:\ `google()`\ `mavenCentral()`\ `maven { url "https://jitpack.io" }` To initialise a payment, follow these steps: * Use the method:\ `CashfreePGSDK.doPayment(orderId, setEnvironment, setPaymentSessionId);` * Ensure the following: * `orderId` and `paymentSessionId` are securely generated from your backend. * `setEnvironment` is either `SANDBOX` or `PRODUCTION`. * You specify the platform (for example, UPI, card, or netbanking). This issue occurs in the sandbox (test) environment. Real UPI apps don't launch because transactions are simulated.\ To test UPI behaviour, follow these steps: * Use the Cashfree UPI simulator with sandbox credentials. * For end-to-end testing, use production mode with small payment amounts. No. UPI Intent works only on supported mobile devices and mobile applications, because it opens an installed UPI app. On desktop websites, present UPI QR. Do not offer UPI Intent or UPI Collect on desktop, except where NPCI still allows Collect. See [UPI Collect Flow Deprecation](/docs/payments/manage/payment-methods/upi-collect) for QR setup, iOS support, and exemption details. The `payment_session_id_invalid` error means the payment session ID is missing or does not exist. Common causes include: 1. **Modified session ID**: Don't trim the `payment_session_id` or add extra characters to it. Pass it exactly as received from the Create Order API response. 2. **Environment mismatch**: Ensure the `payment_session_id` generated in one environment is not used in another. A Sandbox session ID cannot be used with the Production checkout environment. To resolve this error: 1. Pass the `payment_session_id` exactly as received from the Create Order API. 2. Create the order in the same environment that the app uses. 3. Initialise `CFSession` with `CFEnvironment.PRODUCTION` for production orders, or `CFEnvironment.SANDBOX` for sandbox orders. 4. Verify that your API credentials, endpoint, and checkout environment are all consistent. See [React Native Integration](/docs/payments/online/mobile/react-native) for the session setup. To troubleshoot this issue, follow these steps: * Run:\ `flutter clean`\ `flutter pub get` * If issues persist, delete the following directories:\ `.gradle/`\ `.idea/` To integrate the native UPI Intent flow on Android: 1. Create a Cashfree order from your server to obtain a `payment_session_id` and `order_id`. 2. Initialise the Cashfree Mobile SDK in your app. 3. Create a `CFSession` using the payment session ID and order ID. 4. Configure `CFUPIIntentCheckoutPayment`. 5. Call `doPayment()` to launch the native UPI Intent flow. 6. Handle the SDK callback and verify the final payment status from your backend. See [Android Integration](/docs/payments/online/mobile/android) for full setup details. No. Cashfree does not currently offer a UPI plugin or SDK for React Native that keeps the customer fully inside your app. The customer must still complete the payment through an external UPI application, such as Google Pay or PhonePe. ### Server-Side SDKs If you use the Cashfree Node.js SDK (`cashfree-pg`), pass the environment as the `CFEnvironment.PRODUCTION` enum in the configuration constructor. Do not pass a plain string. A string value can cause the SDK to default to the sandbox host, which returns a 401 authentication error when you use live API keys. Sample integration kits * [Python](https://github.com/cashfree/cashfree-pg-sdk-python) * [Java](https://github.com/cashfree/cashfree-pg-sdk-java) * [.NET](https://github.com/cashfree/cashfree-pg-sdk-dotnet) * [PHP](https://github.com/cashfree/cashfree-pg-sdk-php) * [Node.js](https://github.com/cashfree/cashfree-pg-sdk-nodejs) * [Go](https://github.com/cashfree/cashfree-pg) # Secure ID Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/secureid-ts Troubleshoot Cashfree Secure ID verification errors including bank account, PAN, GST, IFSC, and aadhaar APIs with checks for inputs, headers, and responses. This issue arises when the customer's name isn't accessible through IMPS rails from partner banks. This is a bank-side limitation. The name can't be retrieved in this case. Bank account details are invalid across all partner banks. This is a limitation on the bank’s end. The account is valid but currently blocked, so transactions can't be processed. As part of the penny drop validation, we attempted to deposit ₹1 into the account. However, the transaction failed due to the blocked status. To troubleshoot this issue, follow this step: * Coordinate with the customer to verify and reactivate the account via their bank. UTR generation usually occurs during penny drop validation. In this case, a different validation mechanism was used to improve the success rate, so a UTR wasn't generated. To troubleshoot this issue, follow this step: * If UTR generation is required for all validations, fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) to enable this configuration for your account. This issue arises when there are excessive penny drop attempts made (for example, more than 15 in 24 hours) to the same account and IFSC code. To troubleshoot this issue, follow this step: * Fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) to unblock affected accounts. This issue arises when you call Cashfree's APIs through your frontend. To troubleshoot this issue, follow this step: * To avoid CORS errors while integrating Cashfree's API, route the API requests through your backend server. Your backend can handle the request and pass the response back to the frontend. This approach bypasses browser-imposed CORS restrictions, as the call is made server-side. In Secure ID, Penny Drop is a real transaction, so it is supported only in the Production environment. It does not perform a real verification in the Pre-Production (Test) environment. Instead, you will receive mock responses in the Test environment, which can be used to test and validate your integration before moving to Production. A 422 Unprocessable Entity error in the Bank Account Validation API can occur for the following reasons: 1. You are using the deprecated V1 endpoint (for example, `/payout/v1/validation/bankDetails`), which is being retired. Migrate to the [Bank Account Verification Sync V2 API](/docs/api-reference/vrs/v2/bav-v2/bank-account-verification-sync-v2). 2. The required feature is not enabled for your account. Contact your Account Manager or fill in the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) to enable it. 3. There are invalid or missing request parameters. 4. The request does not meet the API's validation requirements. The `id_not_found` status in the bank account verification API can occur for the following reasons: * The account is returned as invalid by available sources. * IMPS mode is not enabled for the specific bank account and IFSC combination. The verification process may rely on IMPS. Verify with the respective bank whether IMPS transactions are enabled for the account. A 404 error or `api_error` message can occur if you are using incorrect credentials. Ensure you are using API keys specifically generated from the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) rather than general Payment Gateway credentials. Secure ID Client IDs should start with `CF`. # Webhooks Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/webhooks-ts Troubleshoot Cashfree webhook delivery issues including signature verification, retries, missing events, payload parsing, and endpoint availability problems. This issue may arise due to multiple reasons, such as: * High latency in response to the test payload. * Webhook endpoint didn't return HTTP 200 OK. To troubleshoot this issue, follow this step: Ensure your webhook endpoint returns a 200 OK response within 50 ms during configuration. This issue may arise due to multiple reasons, such as: * Parsed payload is being used. * Timestamp provided in the ‘x-webhook-timestamp’ isn't used for creating the signed payload. To troubleshoot this issue, follow these steps: * Use the raw payload and x-webhook-timestamp to generate the signed payload. * Sign it using your client secret and HMAC SHA256. * Refer [here](/docs/payments/online/webhooks/overview#webhook-signature-verification) for the sample code. This issue may arise due to multiple reasons, such as: * Endpoint not returning 200 OK. * Required events not selected. * Endpoint expects a non-JSON format. * Payment is still in an intermediate state. To troubleshoot this issue, follow these steps: * Ensure the endpoint returns 200 OK and can parse JSON. * Use the [Get Payment Status API](/docs/api-reference/payments/latest/payments/get-payments-for-an-order) to check the payment status. This issue arises because HTTP (instead of HTTPS) webhook endpoint configured in production. To troubleshoot this issue, follow this step: * Use only HTTPS URLs for webhook endpoints in the production environment. This error occurs when production API keys are not generated for your merchant account. To generate them: 1. Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login). 2. Click **Switch to Prod** at the top right. 3. Click **Developers** at the top right. 4. Click **API Keys** under **Payment Gateway**. 5. Click **Generate API Keys** and complete two-factor authentication. After the keys are generated, you can configure your production webhooks. Receiving duplicate webhook events for a single successful payment can occur when multiple webhook versions are enabled for your account. Identify which webhook version you intend to use, then raise a request through the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). Cashfree disables the unused version. This control is not available in the Merchant Dashboard. For other causes, including retries and duplicate subscriptions, see [Receiving duplicate webhook events](/docs/payments/online/webhooks/troubleshooting#receiving-duplicate-webhook-events). For comprehensive security guidelines including IP whitelisting, signature verification, and SSL configuration, refer to the [Webhook Security Checklist](/docs/payments/online/webhooks/security-checklist). # Bill Fetch Request Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/bill-fetch/request openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/request/bill-fetch Use this API to initiate a bill fetch or bill validation request for a customer. This is an **async** API. It returns only an acknowledgement with a `ref_id`. The actual bill details must be retrieved separately by polling the Bill Fetch Response API using this `ref_id`. This API is only applicable for billers whose `fetch_requirement` or `support_bill_validation` is `MANDATORY` or `OPTIONAL`. For billers where both are `NOT_SUPPORTED` (i.e., `DIRECT_PAY` flow), calling this API will return a validation error. Proceed directly to the Bill Payment Request API for those billers. The flow is determined using `fetch_requirement` and `support_bill_validation` from the Fetch Billers Info API response, evaluated in the following priority order: | Priority | `fetch_requirement` | `support_bill_validation` | Flow | |---|---|---|---| | 1 | `MANDATORY` | Any | `FETCH_AND_PAY` | | 2 | `NOT_SUPPORTED` | `MANDATORY` or `OPTIONAL` | `VALIDATE_AND_PAY` | | 3 | `NOT_SUPPORTED` | `NOT_SUPPORTED` | `DIRECT_PAY` | | 4 | `OPTIONAL` | `MANDATORY` | `VALIDATE_AND_PAY` | | 5 | `OPTIONAL` | Any other | `FETCH_AND_PAY` | For `DIRECT_PAY`, skip the bill fetch step and proceed directly to the Bill Payment Request API. Store the `flow` field from the response. It determines which fields to expect in the Bill Fetch Response and whether a bill payment can proceed without a prior fetch. # Bill Fetch Response Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/bill-fetch/response openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/response/bill-fetch Use this API to poll the result of a previously initiated Bill Fetch or Bill Validation request. Use the `ref_id` from the Bill Fetch Request API to retrieve the status and bill details. Poll at increasing intervals until `message` is no longer `"Request is still being processed"`: | Attempt | Wait before this poll | |---|---| | 1 | 5 seconds | | 2 | 15 seconds | | 3 | 30 seconds | | 4 | 1 minute | | 5+ | 3 minutes | Stop polling when `message` is `"Bill details fetched successfully"` or `"Bill request failed"`. If the request remains in a processing state beyond your retry limit, treat it as a timeout and raise a support ticket. - `bill_fetch_response` is present in every response, including success, failure, and pending states. - For `FETCH_AND_PAY` success, the response includes `bill_fetch_response`, `bill_details`, `biller_response`, and `additional_info`. - For `FETCH_AND_PAY` failure, the response includes only `bill_fetch_response`. - For `VALIDATE_AND_PAY` success, the response includes `bill_fetch_response` and `additional_info`. - For `VALIDATE_AND_PAY` failure, the response includes only `bill_fetch_response`. - While the request is pending, the response includes only `bill_fetch_response`, with the processing status. # Bill Payment Request Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/bill-payment/request openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/request/bill-payment Use this API to initiate a bill payment against a previously fetched or validated bill. This is an **async** API. It returns only an acknowledgement with a `transaction_ref_id`. Poll the Bill Payment Response API using both `bill_fetch_ref_id` and `transaction_ref_id` to get the final payment status. The `bill_fetch_ref_id` is not required for the direct pay flow. # Bill Payment Response Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/bill-payment/response openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/response/bill-payment Use this API to poll for the result of a previously submitted bill payment request. Call this using both `bill_fetch_ref_id` and `transaction_ref_id` from the Bill Payment Request API. The `bill_fetch_ref_id` is not required for the direct pay flow. Poll at increasing intervals until `message` is no longer `"Payment is still being processed"`: | Attempt | Wait before this poll | |---|---| | 1 | 5 seconds | | 2 | 15 seconds | | 3 | 30 seconds | | 4 | 1 minute | | 5+ | 3 minutes | Stop polling when `message` is `"Payment successful"` or `"Payment failed"`. If the payment remains in a processing state beyond your retry limit, treat it as a timeout and raise a support ticket. The outcome is conveyed by the top-level `message` and can be confirmed from `data.bill_payment_response.reason.response_code`:
  • Payment is still being processed (response_code PENDING): payment is still in progress. Continue polling.
  • Payment successful (response_code 000): payment completed successfully.
  • Payment failed: payment failed. Read reason.compliance_reason for the cause.
# Fetch Biller Categories Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/billers/categories openapi/bbps/bbps-cou.yaml get /bbps/cou/v1/billers/categories Use this API to fetch the list of all active biller categories available on the BBPS network. Agent Institutions can use this to populate category selection in their UI. Since this data changes infrequently, it is recommended to fetch and cache it at predefined intervals instead of calling the API on every user request. # Fetch Billers Info Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/billers/info openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/info Use this API to fetch the complete catalog and MDM (Master Data Management) details of billers registered under BBPS. Use this to understand biller configuration, required customer input parameters, supported payment modes and channels, and fee structures. If the request body is omitted, all billers are returned. # Data to Test Integration Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/data-to-test-integration Use the sandbox credentials, test billers, and end-to-end flow on this page to validate your BBPS COU integration before going live. Use the sandbox credentials and test flow on this page to validate your BBPS COU integration before going live. The sandbox environment supports end-to-end testing of the bill fetch and bill payment journey, including a built-in auto bill simulator for the Loan Repayment category. Agent IDs and device block values for each supported initiating channel. How to identify customer input parameters for any biller and how to use the auto bill simulator. Step-by-step instructions to complete a full bill payment cycle in the sandbox environment. ## Sandbox credentials Use the agent IDs below when constructing sandbox requests. Each agent ID is pre-configured for a specific initiating channel. | Initiating channel | Channel code | Sandbox agent ID | | :- | :- | :- | | Internet Banking (Post-login) | `INTB` | `CH01CH02INB516193127` | | Mobile Banking (Post-login) | `MOBB` | `CH01CH02MBBPAL001085` | ### Device block values The device block must match the tag requirements of the initiating channel. Use the values below when building sandbox requests. Pass the following tags in the `agent.device.tag` array for the `INTB` channel. | Tag name | Sandbox value | | :- | :- | | `INITIATING_CHANNEL` | `INTB` | | `IP` | `124.170.23.24` | | `MAC` | `01-23-45-67-89-ab` | Pass the following tags in the `agent.device.tag` array for the `MOBB` channel. | Tag name | Sandbox value | | :- | :- | | `INITIATING_CHANNEL` | `MOBB` | | `IP` | `124.170.23.24` | | `IMEI` | `123456789012345` | | `OS` | `IOS` | | `APP` | `AGENTAPP` | For the Bill Fetch Request API, the same values apply but are passed as named fields directly under `agent_device_info` (for example, `init_channel`, `ip`, `mac`) rather than as a tag array. The tag array format applies to the Bill Payment Request API. ## Test billers ### Finding customer input parameters Each biller requires a specific set of customer identifiers to initiate a bill fetch. To find the correct parameters for a biller, call the [Fetch Billers Info API](/docs/api-reference/other-apis/bbps-cou/billers/info) and read the `biller_customer_params` field in the response. This field lists all the input parameter names and their expected formats that must be passed in the `input_params` block of the Bill Fetch Request. ### Auto bill simulator For the Loan Repayment category, a built-in auto bill simulator is available in the sandbox environment. Instead of supplying real customer identifiers, pass `CF_AUTO_GENERATE` as the value for any input parameter. The system automatically generates a bill and returns a `ref_id` that you can use to poll the Bill Fetch Response API. Use the following biller to test the auto bill simulator: | Field | Value | | :- | :- | | Biller ID | `SWAR00027NAT2J` | | Category | Loan Repayment | | Input parameter value | `CF_AUTO_GENERATE` | The auto bill simulator eliminates the need for real loan account numbers during sandbox testing, making it straightforward to run a complete end-to-end flow without any production data. ## End-to-end sandbox testing The following steps walk you through a complete BBPS COU bill payment cycle in the sandbox environment using the auto bill simulator. Call the [Bill Fetch Request API](/docs/api-reference/other-apis/bbps-cou/bill-fetch/request) using your sandbox credentials. Use biller ID `SWAR00027NAT2J` and pass `CF_AUTO_GENERATE` as the value for all input parameters in the `input_params` block. A successful request returns a `ref_id`. Store this value — you will need it to poll the bill fetch response and to submit the bill payment request. Call the [Bill Fetch Response API](/docs/api-reference/other-apis/bbps-cou/bill-fetch/response) using the `ref_id` from Step 1. Poll at regular intervals until the response returns a terminal status. Once successful, note the `biller_response` object and the `additional_info` field from the response. You must pass both of these fields exactly as received into the Bill Payment Request in Step 4. Use [Cashfree DevStudio](https://www.cashfree.com/devstudio) to complete the payment leg of the transaction in the sandbox environment. Once the payment is complete, DevStudio returns a Cashfree payment ID (`cf_payment_id`). Store this value — it is required as the `pg_reference_id` in the next step. Call the [Bill Payment Request API](/docs/api-reference/other-apis/bbps-cou/bill-payment/request) with the following data: * Under `head`, set `bill_fetch_ref_id` to the `ref_id` from Step 1 and set `pg_reference_id` to the `cf_payment_id` received from DevStudio in Step 3. * Pass the `biller_response` object exactly as received from the Bill Fetch Response in Step 2. * Pass the `additional_info` field exactly as received from the Bill Fetch Response in Step 2. A successful request returns a `transaction_ref_id`. Store this value along with the `bill_fetch_ref_id` to poll for the final payment status. Call the [Bill Payment Response API](/docs/api-reference/other-apis/bbps-cou/bill-payment/response) using both the `bill_fetch_ref_id` from Step 1 and the `transaction_ref_id` from Step 4. Poll at regular intervals until `data.status` returns `success` or `failed`. A `success` status confirms that the end-to-end BBPS COU transaction completed successfully in the sandbox environment. Complete all integration testing in the sandbox environment before deploying to production. For help with errors encountered during testing, refer to the [BBPS COU error codes](/docs/api-reference/other-apis/bbps-cou/error-codes) page.

Related topics

# Bill Fetch and Payment Error Codes Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/error-codes Cashfree BBPS Customer Operating Unit (COU) compliance response codes for failed bill fetch, validation, and payment requests, with retry categories. The Cashfree BBPS Customer Operating Unit (COU) API returns a compliance response code in `compliance_resp_cd` when a bill fetch, validation, or payment request fails. The accompanying `compliance_reason` gives the human-readable failure reason. Use these codes to identify the cause of a failure and to decide whether you can retry the request. ## Retry categories Each error code maps to a retry category that tells you how to handle the failure. The following categories apply across all error groups: * `NON_RETRIABLE`: the request will fail again with the same input. Do not retry the same request. Correct the customer details or inform the customer, as indicated by the reason. * `RETRIABLE`: the failure is temporary, usually a biller or network issue. Retry the request after a short delay. * `CONDITIONAL`: the outcome depends on inner error codes returned by the biller or the switch. Inspect the accompanying reason before you decide whether to retry. Some reasons include additional timing guidance, such as retrying later or on the next day. Always honour the timing hint in the reason before you retry. ## Bill fetch error codes The [Bill Fetch Response API](/docs/api-reference/other-apis/bbps-cou/bill-fetch/response) returns these codes when a fetch request fails. Fetch codes use the `BFR` prefix. | `compliance_resp_cd` | Reason | Category | | - | - | - | | `BFR001` | Incorrect or invalid customer account | `NON_RETRIABLE` | | `BFR002` | Invalid combination of customer parameters | `NON_RETRIABLE` | | `BFR003` | No bill data available | `NON_RETRIABLE` | | `BFR004` | Payment received for the billing period, no bill due | `NON_RETRIABLE` | | `BFR005` | Customer account is blocked or closed | `NON_RETRIABLE` | | `BFR006` | Customer account is not activated | `NON_RETRIABLE` | | `BFR007` | Bill due date has expired, bill details not available | `NON_RETRIABLE` | | `BFR008` | Unable to get bill details from biller | `RETRIABLE` | | `BFR009` | Scheduled downtime by biller, try again later | `RETRIABLE` | | `BFR010` | Unscheduled downtime by biller, try again later | `RETRIABLE` | | `BFR011` | Incomplete details in biller system, update customer profile | `NON_RETRIABLE` | | `BFR012` | ePayment not enabled for the dealer | `NON_RETRIABLE` | | `BFR013` | Maximum refill count reached | `NON_RETRIABLE` | | `BFR014` | Consumer has reported loss of cylinder | `NON_RETRIABLE` | | `BFR015` | Cannot take booking, consumer KYC not submitted | `NON_RETRIABLE` | | `BFR016` | One prior booking is pending against this consumer | `NON_RETRIABLE` | | `BFR017` | Price not yet set for nature or package code. Retry later. | `RETRIABLE` | | `BFR018` | Day-end not done, try after some time | `RETRIABLE` | | `BFR019` | Consumer number and distributor not matching | `NON_RETRIABLE` | | `BFR020` | LPG ID not found | `NON_RETRIABLE` | | `BFR021` | Vehicle registration number invalid or does not exist | `NON_RETRIABLE` | | `BFR022` | FASTag inactive or blocked, recharge not allowed | `NON_RETRIABLE` | | `BFR023` | FASTag exempted, recharge not allowed | `NON_RETRIABLE` | ## Bill validation error codes The [Bill Fetch Response API](/docs/api-reference/other-apis/bbps-cou/bill-fetch/response) returns these codes when a bill validation request fails. Validation codes use the `BVR` prefix. | `compliance_resp_cd` | Reason | Category | | - | - | - | | `BVR001` | Incorrect or invalid customer account | `NON_RETRIABLE` | | `BVR002` | Invalid combination of customer parameters | `NON_RETRIABLE` | | `BVR003` | Customer account is blocked or closed | `NON_RETRIABLE` | | `BVR004` | Customer account is not activated | `NON_RETRIABLE` | | `BVR005` | Invalid amount | `NON_RETRIABLE` | | `BVR006` | Customer account deactivated, pay to activate | `NON_RETRIABLE` | | `BVR007` | Incomplete details in biller system, update profile | `NON_RETRIABLE` | | `BVR008` | Customer account valid but no bill due | `NON_RETRIABLE` | | `BVR009` | Technical exception from biller | `RETRIABLE` | ## Payment posting error codes The [Bill Payment Response API](/docs/api-reference/other-apis/bbps-cou/bill-payment/response) returns these codes when a payment fails at the biller. Payment codes use the `BPR` prefix. | `compliance_resp_cd` | Reason | Category | | - | - | - | | `BPR001` | Incorrect or invalid customer account | `NON_RETRIABLE` | | `BPR002` | Invalid combination of customer parameters | `NON_RETRIABLE` | | `BPR003` | Customer account is blocked or closed | `NON_RETRIABLE` | | `BPR004` | Customer account is not activated | `NON_RETRIABLE` | | `BPR005` | Payment cannot be accepted at this time | `RETRIABLE` | | `BPR006` | Payment request has been exceeded for the day. Retry the next day. | `NON_RETRIABLE` | | `BPR007` | Repeat payment request | `NON_RETRIABLE` | | `BPR008` | Due date expired, re-fetch to get current outstanding | `RETRIABLE` | | `BPR009` | Scheduled downtime by biller, try again later | `RETRIABLE` | | `BPR010` | Unscheduled downtime by biller, try again later | `RETRIABLE` | | `BPR011` | Payment amount different from current outstanding | `RETRIABLE` | | `BPR012` | FASTag top-up failed, try again later | `RETRIABLE` | ## Infrastructure error codes These codes indicate a transport or switch-level failure between the operating units, rather than a biller decision. Codes with the `BOU` prefix relate to the Biller Operating Unit, and codes with the `COU` prefix relate to the Customer Operating Unit. | `compliance_resp_cd` | Reason | Category | | - | - | - | | `BOU001` | Send failed to BOU | `RETRIABLE` | | `BOU002` | Inner error codes from BOU negative acknowledgement | `CONDITIONAL` | | `BOU003` | Timeout at BOU | `RETRIABLE` | | `BOU004` | BOU reversal retry failure | `NON_RETRIABLE` | | `BOU005` | BOU reversal response timeout | `NON_RETRIABLE` | | `BOU006` | Connect timeout at BOU | `RETRIABLE` | | `BOU007` | Read timeout at BOU | `RETRIABLE` | | `BOU008` | Unable to connect to BOU | `RETRIABLE` | | `BOU009` | Pending transaction timeout at BOU | `RETRIABLE` | | `COU001` | Send failed to COU | `RETRIABLE` | | `COU002` | Inner error codes from COU negative acknowledgement | `CONDITIONAL` | | `COU003` | COU reversal retry failure | `NON_RETRIABLE` | | `COU006` | Connect timeout at COU | `RETRIABLE` | | `COU007` | Read timeout at COU | `RETRIABLE` | | `COU008` | Unable to connect to COU | `RETRIABLE` | # BBPS for Customers Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/overview Cashfree BBPS for Customers APIs cover authentication, biller discovery, bill fetch, bill payment, ticket handling, and wallet operations for Agent Institutions. The BBPS for Customers (Customer Operating Unit, or COU) APIs enable Agent Institutions, entities that onboard customers and offer BBPS services, to integrate with the Bharat Bill Payment System (BBPS) network operated by NPCI. Using these APIs, Agent Institutions can build complete bill payment experiences for their customers across all registered BBPS billers. ## Key features Cashfree BBPS for Customers supports the following capabilities: * **Biller discovery**: Retrieve all active biller categories and MDM details, including customer input parameters, supported payment modes, and fee structures, to present accurate biller information before initiating a payment. * **Async bill fetch and payment**: Bill fetch and payment requests return a reference ID immediately. Poll the corresponding response endpoint at regular intervals until the operation returns a terminal status. * **Flexible payment flows**: Supports `FETCH_AND_PAY`, `VALIDATE_AND_PAY`, and direct bill payment flows, determined automatically by biller configuration, across all BBPS categories. Direct bill payment is used for billers that do not require a prior fetch or validation step, such as donation billers. * **Ticket management**: Raise a support ticket for any processed transaction and poll its status using the Ticket APIs. * **Wallet management**: Check the agent institution wallet balance and retrieve paginated ledger history for reconciliation. ## Authentication All APIs use header authentication. Pass both headers in every request: ```http theme={"dark"} x-client-id: x-client-secret: ``` Credentials are issued per Agent Institution. Your `x-client-id` and `x-client-secret` are available in your [Merchant Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys) for both sandbox and production environments. ## Versioning All BBPS COU APIs require an `x-api-version` header in every request. The current supported version is `2025-01-01`. ```http theme={"dark"} x-api-version: 2025-01-01 ``` This value is pre-filled in the **Try It** playground on each API page. ## Rate limits All APIs are rate limited to 100 requests per 60 seconds. Exceeding the limit returns HTTP 429. ## API flow A complete bill payment journey involves the following steps: Get the list of active biller categories, for example, ELECTRICITY, DTH, and GAS. Get MDM details for billers in a category, including customer input parameters, supported payment modes, fetch requirements, and fee structures. Initiate an async bill fetch, validation, or direct payment for the customer. Returns a `ref_id` immediately. The system determines the flow automatically based on biller configuration: * `FETCH_AND_PAY` returns bill details from the biller * `VALIDATE_AND_PAY` validates customer identity without fetching bill details * Direct bill payment skips the fetch step entirely and is used for billers such as donation billers Poll using the `ref_id` at regular intervals until the response returns a terminal status. Refer to the polling strategy in the Bill fetch response API for recommended intervals and retry limits. Submit the payment using data from the fetch response. Returns `transaction_ref_id` immediately. Poll using `bill_fetch_ref_id` and `transaction_ref_id` at regular intervals until the response returns a terminal status. Refer to the polling strategy in the Bill payment response API for recommended intervals and retry limits. To raise a support ticket for a processed payment, use the Raise Ticket Request API after a payment is complete. Poll the Ticket Status API using the returned `ref_id` to track progress.

Billers

Fetch biller categories

Get all active biller category codes, such as ELECTRICITY, DTH, and GAS. Cache this list because it changes infrequently.


Fetch billers info

Get MDM details for billers in a category, including customer input parameters, supported payment modes, fetch requirements, and fee structures.

Bill fetch

Bill fetch request

Initiate an async bill fetch or validation for the customer. Returns a ref\_id immediately. The system determines the flow based on biller configuration. It uses FETCH\_AND\_PAY or VALIDATE\_AND\_PAY.


Bill fetch response

Poll for the bill fetch result using the ref\_id returned from the fetch request.

Bill payment

Bill payment request

Initiate an async bill payment using data from the fetch response. Returns a transaction\_ref\_id immediately.


Bill payment response

Poll for the payment result using bill\_fetch\_ref\_id and transaction\_ref\_id until data.status is success or failed.

Ticket management

Raise ticket request

Raise a support ticket for a processed bill payment transaction. Returns a ref\_id immediately.


Poll ticket status

Poll for the current status of a raised ticket using the ref\_id returned from the ticket request.

Wallet

Wallet balance

Get the current agent institution wallet balance.


Wallet ledger

Retrieve paginated wallet transaction history for reconciliation.

# Raise a Ticket Request Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/ticket/request openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/request/ticket Use this API to raise a support ticket for a previously processed bill payment. This is an **async** API. It returns an acknowledgement with a `ref_id`. Poll the Ticket Status API using `ref_id` to get the current status of your ticket. Pass one of the following codes in the `disposition` field: | Disposition code | Description | Type | |---|---|---| | `D11` | Transaction Successful, Amount Debited but services not received | Dispute | | `D12` | Transaction Successful, Amount Debited but Service Disconnected or Service Stopped | Dispute | | `D13` | Transaction Successful, Amount Debited but LPSC Late Payment Surcharge Charges added in next bill | Dispute | | `D21` | Erroneously paid in wrong account | Dispute | | `D22` | Duplicate Payment | Dispute | | `D23` | Erroneously paid the wrong amount | Dispute | | `D31` | Payment information not received from Biller or delay in receiving payment information from the Biller | Complaint | | `D32` | Bill paid but amount not adjusted or still showing due amount | Complaint | # Poll Ticket Status Response Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/ticket/response openapi/bbps/bbps-cou.yaml post /bbps/cou/v1/billers/response/ticket-status Use this API to poll the status of a previously raised ticket. Call this using the `ref_id` returned from the Raise Ticket Request API. Poll at increasing intervals until `message` is no longer `"Ticket request is still being processed"`: | Attempt | Wait before this poll | |---|---| | 1 | 5 seconds | | 2 | 15 seconds | | 3 | 30 seconds | | 4 | 1 minute | | 5+ | 3 minutes | Stop polling when `message` is `"Ticket details fetched successfully"` or `"Ticket request failed"`. If the ticket remains in a processing state beyond your retry limit, contact Cashfree support with the `ref_id`. | `message` | Meaning | |---|---| | `"Ticket details fetched successfully"` | Completed. Check `data` for ticket details. | | `"Ticket request failed"` | Terminal failure. Stop polling. | | `"Ticket request is still being processed"` | Still processing. Continue polling. | # Fetch Agent Institution Wallet Balance Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/wallet/balance openapi/bbps/bbps-cou.yaml get /bbps/cou/agent/{agentId}/wallet/balance Use this API to fetch the current available wallet balance for a given Agent Institution. This balance reflects funds available for BBPS bill payment transactions. The balance can be positive or negative, depending on the Agent Institution's funding model: - Prefunding model: the Agent Institution funds the wallet in advance, and bill payments are debited from it. The balance is the remaining prefunded amount and does not go below zero. - Shortfall (postfunding) model: bill payments are drawn against a Cashfree-funded credit line, so the balance can be negative. A negative balance represents the current shortfall, that is, the amount the Agent Institution has drawn and must repay. # Fetch Agent Institution Wallet Ledger Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps-cou/wallet/ledger openapi/bbps/bbps-cou.yaml post /bbps/cou/agent/{agentId}/wallet/ledger Use this API to fetch a paginated list of wallet ledger entries for a given Agent Institution. Includes credits (recharges) and debits (bill payments). Results can be filtered by date range, transaction type, or UTR. All request body fields are optional. An empty body returns all entries. The ledger lists wallet credits (recharges) and debits (bill payments). On the prefunding model, each bill payment also produces freeze and unfreeze hold entries against the prefunded balance. On the shortfall (postfunding) model, debits can take the running balance negative, reflecting the amount drawn against the credit line. # APIs to Implement Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/apis-to-implement Reference for the APIs billers must expose to join the BBPS network, covering bill fetch, payment posting, and authentication requirements. To join the BBPS network, billers must implement two APIs that Cashfree calls on behalf of the network during customer bill interactions. Both APIs must be built to the structure defined below and shared with Cashfree along with the authentication details and environment URLs. Once you provide the API contracts and URLs for both test and production environments, Cashfree integrates your APIs within two working days, provided they meet the recommended standards. ## APIs to implement The following two APIs are required for BBPS network participation: ### Bill fetch The bill fetch API is called when a customer initiates a bill lookup on a BBPS-enabled app such as PhonePe, Google Pay, or Paytm. It must return the outstanding bill details for the customer based on the input parameters passed by the network. * **Method**: GET * **Trigger**: Customer initiates a bill lookup on a BBPS-enabled app * **Response**: Outstanding bill details for the customer ### Payment posting The payment posting API is called after a customer completes a bill payment on a BBPS-enabled app. Your system must respond with an acceptance or rejection of the payment. * **Method**: POST * **Trigger**: Customer completes a payment on a BBPS-enabled app * **Response**: Acceptance or rejection of the payment ## Authentication Along with your API contracts and environment URLs, inform Cashfree of the authentication protocol your APIs use and provide credentials for both test and production environments. # Check Transaction Status Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/check-transaction-status get /bbps/biller/bill/status/{bbps_transaction_id} The check transaction status API allows billers to retrieve the current status of a transaction using the unique BBPS transaction ID associated with the bill. This endpoint serves as a reliable method for querying transaction details, providing merchants with real-time updates on payment status. # Next Steps for Biller Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/next-steps-for-biller Follow these next steps after implementing the BBPS biller APIs, including sharing endpoints and credentials with Cashfree to complete onboarding and go live. 1. Once you are done implementing this APIs at your end, please create a document with the following details and send it over to [bbpsproduct@cashfree.com](mailto:bbpsproduct@cashfree.com): * The API contracts that are finally implemented for both the APIs. Include the following: * Expected Sample Request * Sample Success Response * Sample Failure Response * Sample Error Response * Describe the authentication mechanism you have implemented along with credentials for the same in * Test Environment * Production Environment * Provide the base URL & the path to access both the APIs in * Test Environment * Production Environment * Provide 7-8 data points in test environment through which bill fetch can be triggered. * Confirm the Onboarding Configurations as defined in Section F and mention the same in the document. 2. Cashfree team will test the API functionality in test environment and then integrate with BBPS system if its working as expected. 3. The same would be sent for approval to NPCI along with the legal documentation. NPCI would take 1-2 weeks to approve the request if everything is correct. 4. NPCI would give a go-ahead and configure the production routing so transactions can be initiated. Biller would be live on BHIM initially and within 1 week would appear on GPay. Post that it would appear on PhonePe and other apps in 2 weeks. 5. Biller can use Cashfree Dashboard to see realtime reporting of transactions coming through BBPS. # NPCI Onboarding Configurations Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/npci-onboarding-configurations Configure BBPS biller onboarding fields including customer input parameters, payment amount exactness, extra bill fetch response data, and acceptance rules. In addition to legal and branding details, billers must submit the following technical configurations to NPCI as part of the onboarding process. Review each configuration and provide your decisions along with your API contracts. ## Customer input parameters **Required** Define the input parameters that customers must enter in the payment app to identify their account or bill. For each parameter, provide the following details: | Field | Description | | - | - | | Name | Parameter identifier, for example, `phone_number`, `loan_number`, `policy_no` | | Data type | `Alphanumeric`, `Numeric`, or `Date` | | Special characters | Whether special characters are allowed in the value, and if so, which ones | | Length | Minimum and maximum character length of the value, for example, 3 to 10 characters | ## Payment amount exactness **Required** Select the amount behaviour you want to apply to payments received through BBPS. | Option | Description | | - | - | | `ADHOC` | Customer can enter any amount | | `EXACT` | Amount is non-editable | | `EXACT DOWN` | Customer can enter an amount equal to or less than the bill fetch amount | | `EXACT UP` | Customer can enter an amount equal to or greater than the bill fetch amount | ## Additional bill fetch response fields **Optional** If your bill fetch response needs to return fields beyond the standard response, specify the additional parameters here. These become part of the `additional_info` object in the bill fetch response. ## Payment acceptance behaviour **Optional** Select whether your system should always accept payments, or accept and reject based on business logic. * **Always accept**: Cashfree accepts all payments on your behalf, even if your systems are unavailable, and retries posting to your system later. Recommended if your system has no business logic for declining payments. * **Accept or reject per transaction**: Your system evaluates and responds to each payment individually. Recommended if you have business logic that requires declining specific payments. # BBPS for Business Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/overview API reference for Cashfree BBPS for Business covering NPCI-compliant biller API design, transaction status, complaint handling, and onboarding configuration. The BBPS for Business (Biller Operating Unit, or BOU) APIs provide billers with a structured blueprint to build APIs that meet NPCI standards, enabling seamless onboarding onto the Bharat Bill Payment System (BBPS) network. By following this approach, billers can ensure their APIs align with Cashfree and NPCI requirements, improving workflow success rates and accelerating the onboarding process. ## Key features Cashfree BBPS for Business supports the following capabilities: * **NPCI-compliant API design**: Build bill fetch, validation, and payment APIs that meet NPCI standards, ensuring compatibility with the BBPS network. * **Flexible bill flows**: Supports `FETCH_AND_PAY` and `VALIDATE_AND_PAY` flows based on your biller system's capability. * **Transaction status checks**: Respond to status queries from the BBPS network to support reconciliation and dispute resolution. * **Complaint handling**: Handle inbound complaint requests from the network for disputed or failed transactions. * **Onboarding configuration guidance**: Access NPCI onboarding configurations to correctly set up your biller profile on the BBPS network.

Transaction status

Check transaction status

Check the status of a transaction on the BBPS network for reconciliation and dispute resolution.

## Getting started Use the following resources to begin your BBPS for Business integration: Learn about the BBPS for Business integration model, onboarding requirements, and API design guidelines. Review the bill fetch and payment posting APIs your biller system must implement for BBPS integration. # Allocate Funds to Virtual Account Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/allocate-funds-to-virtual-account post /v1/connected-wallet/recharge Use this API to recharge the OneEscrow account (notional credit) using a payment instrument. # Create Virtual Account Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/create-virtual-account post /fundsources/connected/virtual-account Use this API to create a virtual account that helps streamline the management of funds, enhance tracking capabilities, and simplify the financial process. # Get Fund Source Details Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/fund-source/get-fund-source-details get /v1/fundsources/{paymentInstrumentId} Use this API to get the details of the fund source. # Get Account Statement Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/get-account-statement get /v1/accountStatement Use this API to fetch the account statement of the virtual account in a paginated format using cursor-based pagination. # Overview Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/payouts-v2-apis Cashfree OneEscrow Payouts V2 APIs simplify endpoint selection, streamline transfers, and reduce integration effort across beneficiary, transfer, and reports. The version 2 APIs simplifies the process of selecting the correct API for merchants, streamlines transfer APIs, and reduces integration issues: | API | Description | | :- | :- | | [Standard Transfer V2](/docs/api-reference/payouts/v2/transfers-v2/standard-transfer-v2) | Use this API to initiate an amount transfer at Cashfree. It is an async request by default. | | [Get Transfer Status V2](/docs/api-reference/payouts/v2/transfers-v2/get-transfer-status-v2) | Use this API to get the status of the initiated transfer. You can use either the transfer\_id or cf\_transfer\_id to fetch the details. | | [Batch Transfer V2](/docs/api-reference/payouts/v2/transfers-v2/batch-transfer-v2) | Use this API to initiate a batch transfer request at Cashfree. You can transfer money to multiple beneficiaries. | | [Get Batch Transfer Status V2](/docs/api-reference/payouts/v2/transfers-v2/get-batch-transfer-status-v2) | Use this API to get the status of the initiated batch transfer. You can use either the batch\_transfer\_id or cf\_batch\_transfer\_id to fetch the details. | # Transfer Funds Between VAs Source: https://www.cashfree.com/docs/api-reference/other-apis/oneescrow/transfer-funds-between-vas post /v1.2/internalTransfer Use this API to transfer funds between virtual accounts (VAs). # Overview Source: https://www.cashfree.com/docs/api-reference/overview Browse the Cashfree API reference, covering payments, payouts, identity verification, and platform APIs with sandbox testing and language-specific examples. Cashfree provides RESTful APIs for payments, transfers, identity verification, and financial solutions. APIs support sandbox testing and production environments determined by your credentials, with consistent authentication, error handling, and multi-language documentation examples. Accept payments from customers through digital and in-person channels. Manage company finances through a unified dashboard. Verify customer identities using Cashfree's identity verification solutions (PAN, Aadhaar, and more). Manage digital wallets, sub-wallets, gift cards, and prepaid cards with Cashfree’s PPI APIs. Embed payments in SaaS applications with Cashfree's embedded payment solutions. Access specialised solutions for specific business needs, including BBPS bill payments. # Data to Test Integration Source: https://www.cashfree.com/docs/api-reference/payments/data-to-test-integration Use the test card numbers, UPI IDs, netbanking credentials, and OTPs supplied here to validate your Cashfree integration in the sandbox environment. Use the test data on this page to validate your Cashfree integration before going live. Check [Supported sandbox features](#supported-sandbox-features) to confirm availability before testing. Test card numbers, netbanking credentials, and UPI VPAs for standard checkout flows. Netbanking and UPI parameter configurations for TPV account validation testing. Token Vault BINs and credit and debit card EMI test credentials. Mobile numbers and PAN or OTP inputs for Paylater and Cardless EMI testing. ## Supported sandbox features The following table lists the payment modes and functionality available for testing in the sandbox environment. | Payment mode or feature | Sandbox support status | | :- | :- | | Card | Supported. Use the test card details provided below. | | Netbanking | Supported. Use the test netbanking account provided below. | | UPI | Supported. Use the test UPI Virtual Payment Addresses (VPAs). | | Wallet | Supported through a single generic test wallet. Individual wallet providers, such as Paytm or AmazonPay, are not available for testing. | | Credit and debit card EMI | Supported. Use the test EMI card details. | | Paylater | Supported. Use the test details provided below. | | Cardless EMI | Supported for transactions with a minimum amount of `1,000` (INR). | | Pre-authorisation (API) | Supported for card and UPI modes via the Order Pay `link` channel. | The sandbox environment does not support PayPal or bank transfer payment modes at this time. ### Test a pre-authorisation transaction To test a pre-authorisation transaction, complete the following steps. 1. Create an order with the `order_note` parameter set to `preauth_transaction`. 2. Capture or void the authorised funds using the [Pre-authorisation API](/docs/api-reference/payments/latest/payments/preauthorisation). ## Core payment modes Use the test card credentials, netbanking simulation account, or UPI addresses below to validate standard checkout flows. ### Test card details To test card transactions in the sandbox environment, select a card number from the tables below based on the transaction state you want to simulate. #### Standard successful checkout testing Use these configurations to simulate successful domestic card payments. For all cards in this table, use `111000` as the OTP, `03/2028` as the fixed expiry, `123` for CVV, and `Test` as the cardholder name. | Scheme | Card type | Card sub-type | Card number 1 | Card number 2 | | :- | :- | :- | :- | :- | | Visa | Debit | Retail | `4706131211212123` | `4062288312345026` | | Visa | Credit | Retail | `4576238912771450` | `4444333322221111` | | Visa | Credit | Premium | `4466050254381183` | `4136880012657791` | | Visa | Credit | Corporate | `4074970084343075` | `4770355457382883` | | Mastercard | Debit | Retail | `5409162669381034` | `5445856839524391` | | Mastercard | Credit | Retail | `5105105105105100` | `5176539438527826` | | Mastercard | Credit | Premium | `5242535837492075` | `5203860658394375` | | Mastercard | Credit | Corporate | `5552190758372734` | `5506908329471983` | | Rupay | Debit | Retail | `6074825972083818` | `6074828163369590` | | Rupay | Credit | Retail | `6528591234543575` | `65292523412356` | #### International and USD scenario testing Use these configurations to validate cross-border payment routing, currency conversion, subscription flows, and multi-factor bank authentication loops. | Testing scenario | Card number | Expiry | CVV | Cardholder name | | :- | :- | :- | :- | :- | | Standard USD flow | `7000 0083 1380 6604` | `09/2027` | `581` | `Test` | | Standard USD flow | `7000 0091 5369 7715` | `12/2021` | `591` | `Test` | | Standard USD flow | `7000 0094 7240 2110` | `05/2024` | `204` | `Test` | | Standard USD flow | `7000 0055 0418 0328` | `08/2026` | `324` | `Test` | | Standard USD flow | `7000 0014 6659 2972` | `02/2026` | `153` | `Test` | | Native bank OTP loop | `4266 9020 7958 3702` | `09/2028` | `681` | `Test` | | Recurring subscriptions | `4138 6748 6000 0008` | `01/2027` | `123` | `Test` | ### Test netbanking To test netbanking integrations, use the default test bank identifier below. | Bank name | Payment code | Bank API code | | :- | :- | :- | | TEST Bank | `3333` | `TESTR` | ### Test UPI Virtual Payment Addresses (VPAs) Pass the following test VPAs in your payment request payload to simulate specific transaction outcomes and error states. | Virtual Payment Address (VPA) | Simulated transaction response | | :- | :- | | `testsuccess@gocash` | Simulates a successful transaction. | | `testfailure@gocash` | Simulates a failed transaction. | | `testinvalid@gocash` | Simulates an invalid VPA error. | | `testdeclineuser@gocash` | Simulates a cancellation by the user. The application prompts the user to retry. | | `testexpired@gocash` | Simulates a session timeout where the user does not complete the transaction in time. | | `testtimeoutbank@gocash` | Simulates an issuing bank timeout. | | `testremitterunavailable@gocash` | Simulates an unavailable remitter bank instance. | | `testinsufficientfunds@gocash` | Simulates insufficient account funds. | | `testbankdeclined@gocash` | Simulates a generic reject response from the user's bank. | | `testriskflagged@gocash` | Simulates a transaction rejected due to bank security and risk assessments. | | `testnetworkerror@gocash` | Simulates a core network infrastructure failure. | | `testinvalidpin@gocash` | Simulates an incorrect PIN entry error. | | `testremitterdispatchfailed@gocash` | Simulates a delivery dispatch failure from the remitter bank. | | `testbeneficiarytimeout@gocash` | Simulates a timeout failure at the destination beneficiary bank. | | `testuserdropped@gocash` | Simulates an unattempted transaction abandonment by the customer. | | `testtransactionrisk@gocash` | Simulates a customer risk rejection profile check. | | `testfingerprintmismatch@gocash` | Simulates a hardware device biometric or fingerprint mismatch. | | `testinvalidvpa@gocash` | Simulates an improperly configured payment instrument. | | `testbankriskrejected@gocash` | Simulates an internal banking security policy rejection. | | `testremittertimeout@gocash` | Simulates a delayed response from the remitter bank. | | `testfraud@gocash` | Simulates an automated anti-fraud block by the payment service provider. | | `testvalidationerror@gocash` | Simulates a Third-Party Verification (TPV) account mapping failure. | | `testdebitfailed@gocash` | Simulates a failure during the account debit process. | | `testpspunregistered@gocash` | Simulates a blocked network state on the client application. | Use the VPA that matches the error state you want to handle in your integration. This helps you verify that your error handling covers each failure mode before going live. ## Third-Party Verification (TPV) ### Test TPV netbanking Third-Party Verification (TPV) ensures that the funding bank account matches your database records. Use these parameters to simulate a validated netbanking setup. | Bank parameter | Static testing value | | :- | :- | | `accountNumber` | `1111222233` | | `ifsc` | `TEST0001234` | ### Test TPV UPI Use these parameters to test account authorisation over the UPI rails. | Parameter | Testing value | | :- | :- | | `userVPA` (success) | `testtpvsuccess@gocash` | | `userVPA` (fail) | `testtpvfail@gocash` | | `accountNumber` | `1111222233` | | `ifsc` | `TEST0001234` | ## Tokenisation and instalment programs ### Token Vault test cards To build a test card number for Token Vault API configurations, append any random 10-digit sequence to the card BINs below. Expiry can be any future date and CVV any 3-digit number. | Scheme | Supported card BIN | | :- | :- | | Visa | `470613, 457623, 436534, 415527, 466535` | | Mastercard | `559423, 544405, 533983, 555219, 524877` | ### Credit card EMI test cards Use the following credit cards to validate EMI calculations and processing endpoints. Expiry can be any future date and CVV any 3-digit number. | Issuing bank | Bank card parameter name (`card_bank_name`) | Card number | | :- | :- | :- | | Axis Bank | Axis | `4111 4647 7655 4152` | | Standard Chartered Bank | Standard Chartered | `4622 7185 3202 3725` | | ICICI Bank | ICICI | `4748 4661 2346 7526` | | Kotak Bank | Kotak | `4363 9070 5531 5237` | | HDFC Bank | HDFC | `5241 8100 0000 0000` | | RBL Bank | RBL | `4112 5597 3537 3674` | | Bank of Baroda | BOB | `4111 5638 8133 3699` | | AU Bank | AU | `4111 5849 6705 0056` | | Citi Bank | CITI | `4112 5229 6265 9579` | | Yes Bank | YES | `4111 6514 1790 3257` | | IndusInd Bank | INDUS | `4111 5351 6094 6904` | | HSBC Bank | HSBC | `4111 6668 0832 0291` | | Federal Bank | FED | `4111 5924 7037 2263` | ### Debit card EMI test cards Use this configuration to test debit card EMI processing. | Issuing bank | Bank card parameter name (`card_bank_name`) | Card number | | :- | :- | :- | | HDFC Bank | HDFC | `4386 2412 2321 5159` | ## Alternative financing options ### Paylater integration details To test standard Paylater partner platforms, use the registered mobile number below. | Provider instance | Registered mobile number | | :- | :- | | Any | `8714268343` | ### Cardless EMI integration details Use the following mobile number to simulate user registration states for Cardless EMI options. | Provider instance | Registered mobile number | Required input parameters | | :- | :- | :- | | Any | `8714268343` | If prompted for **PAN**, use `1234`.
If prompted for **OTP**, use `777777`. | Complete all integration testing in the sandbox environment before deploying to production. For broader recommendations on building reliable integrations, see [API best practices](/docs/api-reference/api-best-practices). # Enums Reference Source: https://www.cashfree.com/docs/api-reference/payments/enums Look up enum values in the Cashfree API, covering order states, payment states, net banking codes, wallet codes, and EMI codes. An enum (enumeration) is a data type that restricts a field to a specific set of predefined string values. The Cashfree API uses enums across requests and responses to ensure that only valid, expected values are accepted or returned for a given field. The following are some examples of enum fields in the Cashfree API: * The `order_status` field returns one of `ACTIVE`, `PAID`, `EXPIRED`, or `TERMINATED`, never a free-form string. * The `payment_status` field returns one of `SUCCESS`, `FAILED`, `PENDING`, `CANCELLED`, and others. * Net banking and wallet codes are fixed numeric identifiers mapped to specific providers. Because enum values are fixed and predictable, you can use them directly in conditional logic, error handling, and status checks without accounting for unexpected values. ## Order states Order states represent the current status of an order throughout its lifecycle, from creation to a terminal state such as paid or expired. Use these values to determine whether an order is still open for payment or has reached a final state. An order moves through the following states based on payment outcomes and merchant actions. | Order State | Description | | :- | :- | | ACTIVE | Orders are marked as **ACTIVE**, when an order is created by the merchant through an API request to Cashfree. | | PAID | Orders are marked **PAID** when the payment is verified by Cashfree and the payment is successful. | | EXPIRED | Orders are marked as **EXPIRED** when the order has exceeded `order_expiry_time` specified by merchant to complete the order. | | TERMINATED | This status is returned when you request order termination through the [Order Termination API](/docs/api-reference/payments/latest/orders/terminate-order). Once terminated, customers can no longer pay for this order. | | TERMINATION\_REQUESTED | This status is returned after you call the [Order Termination API](/docs/api-reference/payments/latest/orders/terminate-order) to end an order. The termination request is acknowledged but still processing. Orders can only be terminated when all transactions have reached terminal states. If a pending transaction completes successfully while termination is processing, the status will change from **TERMINATION\_REQUESTED** to **SUCCESS**. | ## Payment states Payment states indicate the status of an individual payment attempt within an order. An order can have multiple payment attempts, and each attempt progresses through its own states before reaching a terminal outcome such as `SUCCESS` or `FAILED`. Each payment attempt within an order has its own lifecycle. Use these states to handle granular payment scenarios. | Payment State | Description | Remarks | | :- | :- | :- | | SUCCESS | Transaction is successful and the amount is captured. | Terminal state. Once successful, the order moves to **PAID**. | | FAILED | Transaction failed due to bank, customer, or system issues. | Terminal state. Customers can initiate a new attempt. | | NOT\_ATTEMPTED | Transaction is created but acknowledgement from the bank is awaited. | Initial state for a payment attempt. | | PENDING | Request is sent to the bank and a response is awaited. | Non-terminal state. Do not fulfil orders in this state. | | FLAGGED | Transaction is identified as high-risk and requires review. | Merchant must manually approve or reject the payment. | | CANCELLED | Amount is reversed because a success response arrived after the time to live (TTL). | Automatic system reversal for late confirmations. | | VOID | Transaction amount is not captured by explicit request. | Typically used for pre-authorised card payments or UPI mandates. | | USER\_DROPPED | Customer abandoned the payment flow before completion. | Includes closing the app or OTP page without attempting payment. | ## Net banking codes Net banking codes identify the supported net banking providers. Pass the **Bank Code** value in the `payment_method` parameter of your API request to initiate a net banking transaction. The **TPV Supported** column indicates whether the bank supports Third Party Validation (TPV). When TPV is enabled, Cashfree verifies that the customer completes the payment from the specific bank account provided during order creation. The following table lists the supported banks and their corresponding codes for net banking integrations. | Bank name | Bank code | TPV supported | | - | - | - | | Airtel Payments Bank | 3123 | N | | Andhra Pragathi Grameena Bank | 3094 | N | | AU Small Finance Bank | 3087 | Y | | Axis Bank | 3003 | Y | | Axis Bank - Corporate | 3071 | N | | Bandhan Bank - Retail Banking | 3088 | Y | | Bank of Bahrain and Kuwait | 3095 | N | | Bank of Baroda - Corporate | 3060 | Y | | Bank of Baroda - Retail Banking | 3005 | Y | | Bank of India | 3006 | Y | | Bank of India - Corporate | 3061 | Y | | Bank of Maharashtra | 3007 | N | | Barclays - Corporate | 3080 | N | | Canara Bank | 3009 | Y | | Capital Small Finance Bank | 3098 | Y | | Central Bank of India | 3011 | N | | City Union Bank | 3012 | Y | | City Union Bank - Corporate | 3083 | Y | | Cosmos Bank | 3097 | Y | | CSB Bank Limited | 3010 | Y | | DBS Bank Ltd | 3017 | N | | DCB Bank - Retail | 3018 | Y | | Deutsche Bank | 3016 | Y | | Dhanlakshmi Bank | 3019 | Y | | Dhanlaxmi Bank - Corporate | 3072 | N | | Equitas Small Finance Bank | 3076 | N | | ESAF Small Finance Bank | 3100 | N | | Federal Bank | 3020 | Y | | Fincare Bank | 3101 | N | | Gujarat State Co-operative Bank Limited | 3091 | N | | HDFC Bank | 3021 | Y | | HDFC Corporate | 3084 | N | | HSBC Retail NetBanking | 3092 | Y | | ICICI Bank | 3022 | Y | | ICICI Bank - Corporate | 3073 | N | | IDBI Bank | 3023 | Y | | IDBI Bank - Corporate | 3124 | Y | | IDFC FIRST Bank | 3024 | Y | | Indian Bank | 3026 | Y | | Indian Overseas Bank | 3027 | Y | | Indian Overseas Bank - Corporate | 3081 | Y | | IndusInd Bank | 3028 | Y | | Jammu and Kashmir Bank | 3029 | Y | | Jana Small Finance Bank | 3102 | Y | | Janata Sahakari Bank Ltd Pune | 3104 | N | | Kalyan Janata Sahakari Bank | 3105 | N | | Karnataka Bank Ltd | 3030 | Y | | Karnataka Gramin Bank | 3113 | N | | Karnataka Vikas Grameena Bank | 3107 | N | | Karur Vysya Bank | 3031 | Y | | Kotak Mahindra Bank | 3032 | Y | | Kotak Mahindra Bank - Corporate | 3134 | Y | | Maharashtra Gramin Bank | 3108 | N | | Mehsana urban Co-op Bank | 3109 | N | | NKGSB Co-op Bank | 3111 | N | | Nutan Nagarik Sahakari Bank Limited | 3112 | N | | Punjab & Sind Bank | 3037 | Y | | Punjab National Bank - Corporate | 3065 | N | | Punjab National Bank - Retail Banking | 3038 | Y | | RBL Bank | 3039 | Y | | RBL Bank Limited - Corporate | 3114 | N | | Saraswat Bank | 3040 | Y | | SBM Bank India | 3115 | Y | | Shamrao Vithal Bank - Corporate | 3075 | N | | Shamrao Vitthal Co-operative Bank | 3041 | N | | Shivalik Small Finance Bank | 3086 | Y | | South Indian Bank | 3042 | Y | | Standard Chartered Bank | 3043 | Y | | State Bank Of India | 3044 | Y | | State Bank of India - Corporate | 3066 | Y | | Suryoday Small Finance Bank | 3116 | N | | Tamil Nadu State Co-operative Bank | 3051 | N | | Tamilnad Mercantile Bank Ltd | 3052 | Y | | Thane Bharat Sahakari Bank Ltd | 3118 | N | | The Kalupur Commercial Co-Operative Bank | 3106 | N | | The Surat Peoples Co-operative Bank Limited | 3090 | Y | | The Sutex Co-op Bank Ltd | 3117 | Y | | TJSB Bank | 3119 | N | | UCO Bank | 3054 | Y | | UCO Bank Corporate | 3122 | N | | Ujjivan Small Finance Bank | 3126 | Y | | Union Bank of India | 3055 | Y | | Union Bank of India - Corporate | 3067 | Y | | Utkarsh Small Finance Bank | 3089 | Y | | Varachha Co-operative Bank Limited | 3120 | N | | Yes Bank - Corporate | 3077 | N | | Yes Bank Ltd | 3058 | Y | | Zoroastrian Co-Operative Bank Ltd | 3121 | N | ## Wallet codes Wallet codes identify the supported digital wallet providers. Pass the **Payment Code** value in your API request to collect payments via a specific wallet. The following table lists the available wallet providers and their corresponding payment codes. | S. No | Wallet name | Payment code | | :- | :- | :- | | 1 | FreeCharge | 4001 | | 2 | MobiKwik | 4002 | | 3 | Ola Money | 4003 | | 4 | Airtel Money | 4006 | | 5 | Amazon Pay | 4008 | | 6 | PayTM | 4007 | | 7 | PhonePe | 4009 | | 8 | Test Wallet (Sandbox) | 4010 | ## EMI codes Equated Monthly Instalment (EMI) codes specify the available instalment plans for supported banks and card types. Use these values to present EMI options to customers during checkout. The following attributes apply across all EMI plan tables: * **card\_bank\_name**: The bank identifier to pass in the API request parameter. * **Tenure**: The duration of the instalment plan, expressed in months. * **Annual interest rate**: The yearly interest rate applied to the transaction amount, expressed as a percentage. Verify that the transaction amount falls within the **Minimum amount** and **Maximum amount** range specified for the selected plan and tenure before making the API request. Credit card EMI lets customers split a large payment into fixed monthly instalments charged to their credit card. This is the most widely supported EMI type and is available across major Indian banks. The following table lists the supported banks, interest rates, and tenures available for credit card EMI. | Card type | Type of EMI | Bank | card\_bank\_name | Minimum amount | Maximum amount | Annual interest rate | Tenure | | - | - | - | - | - | - | - | - | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 3 | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 6 | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 9 | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 12 | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 18 | | Credit | Standard | ICICI Bank | icici | 1500 | 9999999 | 15.99 | 24 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 3 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 6 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 9 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 12 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 18 | | Credit | Standard | AU Small Finance Bank | au | 2000 | - | 14 | 24 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 3 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 6 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 9 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 12 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 18 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 17 | 24 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 3 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 6 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 9 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 12 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 18 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 24 | | Credit | Standard | Bank of Baroda | bob | 2500 | - | 16 | 36 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 14 | 3 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 14 | 6 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 15 | 9 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 15 | 12 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 15 | 18 | | Credit | Standard | RBL Bank | rbl | 2500 | - | 15 | 24 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 11.88 | 3 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 14 | 6 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 15 | 9 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 15 | 12 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 15 | 18 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | - | 15 | 24 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 3 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 6 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 9 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 12 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 18 | | Credit | Standard | Yes Bank | yes | 1500 | 999999999 | 16 | 24 | | Credit | Standard | American Express | amex | 5000 | - | 14 | 3 | | Credit | Standard | American Express | amex | 5000 | - | 14 | 6 | | Credit | Standard | American Express | amex | 5000 | - | 14 | 9 | | Credit | Standard | American Express | amex | 5000 | - | 14 | 12 | | Credit | Standard | American Express | amex | 5000 | - | 15 | 18 | | Credit | Standard | American Express | amex | 5000 | - | 15 | 24 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 18 | 3 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 6 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 9 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 12 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 18 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 24 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 36 | | Credit | Standard | HDFC Bank | hdfc | 1000 | 999000 | 17 | 48 | | Credit | Standard | Kotak Mahindra Bank | kotak | 1000 | - | 16 | 3 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 6 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 9 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 12 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 18 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 20 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 24 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 30 | | Credit | Standard | Kotak Mahindra Bank | kotak | 2500 | - | 16 | 36 | | Credit | Standard | SBI | sbi | 2500 | - | 17.25 | 3 | | Credit | Standard | SBI | sbi | 2500 | - | 17.00 | 6 | | Credit | Standard | SBI | sbi | 2500 | - | 17.00 | 9 | | Credit | Standard | SBI | sbi | 2500 | - | 17.00 | 12 | | Credit | Standard | SBI | sbi | 2500 | - | 17.00 | 18 | | Credit | Standard | SBI | sbi | 2500 | - | 17.00 | 24 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 3 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 6 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 9 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 12 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 18 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 24 | | Credit | Standard | IDFC Bank | idfc | 1500 | - | 16 | 36 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 17 | 3 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 6 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 9 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 12 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 18 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 24 | | Credit | Standard | IndusInd Bank | indus | 2000 | - | 16 | 36 | Debit card EMI allows customers to pay in monthly instalments without a credit card. The bank determines eligibility based on the customer's account history. The following bank and plans are currently supported for debit card EMI. The **Native OTP** column indicates whether the bank handles OTP verification directly. | Bank name | Native OTP | | :- | :- | | HDFC Bank | Yes | #### Debit card EMI plans | Card type | Type of EMI | Bank | card\_bank\_name | Minimum amount | Maximum amount | Annual interest rate | Tenure | | - | - | - | - | - | - | - | - | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 3 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 6 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 9 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 12 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 18 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 24 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 36 | | Debit | Standard | HDFC Bank | hdfc | 3000 | 400000 | 16 | 48 | Cardless EMI allows customers to pay in instalments without a physical card. Financing is provided by partner banks or Non-Banking Financial Companies (NBFCs). The following table lists the supported cardless EMI providers, interest rates, and available tenures. | Card type | Type of EMI | Bank | provider | Minimum amount | Maximum amount | Annual interest rate | Tenure | | - | - | - | - | - | - | - | - | | Cardless | Standard | HDFC Bank | hdfc | 3000 | 500000 | 16 | 3 | | Cardless | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 6 | | Cardless | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 9 | | Cardless | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 12 | | Cardless | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 18 | | Cardless | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 24 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 18 | 3 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 18 | 6 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 18 | 9 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 18 | 12 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 60000 | 24 | 3 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 60000 | 24 | 6 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 60000 | 24 | 9 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 60000 | 24 | 12 | | Cardless | Standard | LazyPay | lazypay | 3000 | 100000 | 20 | 3 | | Cardless | Standard | LazyPay | lazypay | 3000 | 100000 | 20 | 6 | | Cardless | Standard | LazyPay | lazypay | 3000 | 100000 | 20 | 9 | | Cardless | Standard | LazyPay | lazypay | 3000 | 100000 | 20 | 12 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 22 | 3 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 22 | 6 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 27 | 9 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 27 | 12 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 27 | 15 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 27 | 18 | | Cardless | Standard | TVS Credit | tvs | 3000 | 50000 | 27 | 24 | | Cardless | Standard | Home Credit | homecredit | 4000 | 75000 | 25 | 3 | | Cardless | Standard | Home Credit | homecredit | 4000 | 75000 | 25 | 6 | | Cardless | Standard | ZestMoney | zestmoney | 3000 | 200000 | 20 | 3 | | Cardless | Standard | ZestMoney | zestmoney | 3000 | 200000 | 24.90 | 6 | | Cardless | Standard | ZestMoney | zestmoney | 3000 | 200000 | 24.90 | 9 | Pay later providers extend a short-term line of credit to customers, allowing them to complete a purchase immediately and pay the amount, in full or in instalments, at a later date. The following table lists the supported pay later providers and the corresponding parameter values to use in API requests. | Provider parameter | Name of the provider | | :- | :- | | lazypay | LazyPay (applicable for orders with a minimum value of ₹100 and a maximum value of ₹5,000) | # Errors Source: https://www.cashfree.com/docs/api-reference/payments/errors Understand the Cashfree API error structure, common HTTP status codes, and merchant-specific error codes you can handle programmatically. ## Error structure The Payment Gateway response in case of an error includes the following: * **error\_code**: Code associated with every error. * **error\_description**: Description of the error. * **error\_source**: Source of the error. * **error\_reason**: Failure reason. **Sample error response from API**: ```json theme={"dark"} { "message": "bad URL, please check API documentation", "help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9", "code": "request_failed", "type": "invalid_request_error" } ``` **Sample error response from webhook**: ```json theme={"dark"} { "auth_id": null, "authorization": null, "bank_reference": "306118259130", "cf_payment_id": 1636676360, "entity": "payment", "error_details": { "error_code": "TRANSACTION_DECLINED", "error_description": "transaction is rejected at the remitter bank end. Please reach out to issuer bank", "error_reason": "bank_rejected", "error_source": "bank" }, "is_captured": false, "order_amount": 1.00, "order_id": "order_18482MSWq8prPMOW0jTeGsx0B1JmPC1", "payment_amount": 1.00, "payment_completion_time": "2023-03-02T18:24:51+05:30", "payment_currency": "INR", "payment_group": "upi", "payment_message": "01::REJECTED", "payment_method": { "upi": { "channel": "collect", "upi_id": "8XXXXXXXX2@upi" } }, "payment_status": "FAILED", "payment_time": "2023-03-02T18:24:18+05:30" } ``` *** ## List of error types and error codes Below are the error types and error codes with their descriptions. ### Error types | error\_type | description | | - | - | | `api_connection_error` | Network communication issue with API server. | | `api_error` | General server error during request processing. | | `authentication_error` | Invalid or missing authentication credentials. | | `invalid_request_error` | Request is malformed or has invalid parameters. | | `feature_not_enabled` | Requested feature is not enabled for the account. | | `rate_limit_error` | Too many requests sent in a short time. | | `validation_error` | Request failed validation checks. | | `idempotency_error` | Repeated request with same idempotency key caused conflict. | | `bad_gateway_error` | Received invalid response from upstream server. | ### Error codes | error\_code | description | | - | - | | `card_unsupported` | Card type not supported by payment system. | | `payment_method_unsupported` | Payment method not accepted for this transaction. | | `surcharge_invalid` | Surcharge amount is missing, incorrect, or not allowed. | | `payment_gateway_unsupported` | Selected payment gateway is not supported. | | `card_submission_disabled` | Card submission is currently disabled or blocked. | | `order_amount_invalid` | Order amount is missing, negative, or exceeds limits. | | `order_inactive` | Order is no longer active or has expired. | | `customer_email_invalid` | Customer email is missing or incorrectly formatted. | | `version_invalid` | Provided API version is not supported or malformed. | | `order_token_invalid` | Order token is missing, expired, or incorrect. | | `sub_session_id_invalid` | Sub-session ID is missing or invalid. | | `payment_session_id_invalid` | Payment session ID is missing or does not exist. | | `native_otp_session_id_invalid` | Native OTP session ID is invalid or expired. | | `flash_upi_auth_token_invalid` | Flash UPI auth token is invalid or expired. | | `cookie_invalid` | Session cookie is missing, expired, or malformed. | | `order_id_invalid` | Order ID is incorrect, missing, or unrecognised. | | `order_expiry_time_invalid` | Order expiry time is missing, invalid, or in past. | | `order_id_not_paid` | Order ID exists, but payment was not completed. | | `order_id_voided` | Order was voided and cannot be processed further. | | `refund_amount_invalid` | Refund amount is missing, invalid, or exceeds original payment. | | `refund_id_invalid` | Refund ID is missing, incorrect, or unrecognised. | | `netbanking_bank_code_invalid` | Invalid or unsupported netbanking bank code provided. | | `payment_method_invalid` | Specified payment method is invalid or not recognised. | | `refund_invalid` | Refund cannot be processed due to invalid conditions. | | `vendor_id_invalid` | Vendor ID is missing, malformed, or not recognised. | | `payment_gateway_inactive` | Payment gateway is inactive or unavailable. | | `customer_phone_invalid` | Customer phone number is missing or incorrectly formatted. | | `partner_apikey_invalid` | Partner API key is missing, invalid, or unauthorised. | | `payment_amount_invalid` | Payment amount is missing, negative, or incorrectly formatted. | | `refund_unsupported` | Refund operation is unsupported for this payment type. | | `order_already_paid` | Order has already been paid successfully. | | `bank_processing_failure` | Bank failed to process the payment request. | | `api_request_timeout` | API request timed out before completion. | | `sdk_token_invalid` | SDK token is invalid or malformed. | | `sdk_token_unknown` | Unknown SDK token provided in the request. | | `simulation_id_invalid` | Simulation ID is invalid or does not exist. | | `entity_id_invalid` | Entity ID is incorrect, missing, or unrecognised. | | `entity_unsupported` | Entity type is not supported for this operation. | | `simulation_id_missing` | Simulation ID is required but missing in request. | | `subscription_id_missing` | Subscription ID is required but missing. | | `payment_id_missing` | Payment ID is missing or not found. | | `plan_id_missing` | Plan ID is missing, invalid, or not found. | | `refund_id_missing` | Refund ID is required but missing. | | `PaymentForm_form_creation_failed` | Failed to create payment form due to internal error. | | `PaymentForm_link_creation_failed` | Failed to create payment link due to system issue. | | `order_already_exists` | Order already exists with the given ID or details. | | `orderpay_already_exists` | OrderPay object already exists for this order. | | `order_id_already_exists` | Order ID already exists and cannot be duplicated. | | `domain_name_refererString` | Invalid or unapproved domain name in referer header. | | `android_package_{xRequestedWith}` | Invalid or unrecognised Android package name in request. | | `refType_not_approved` | Referenced entity is not approved for this operation. | | `refType_ineligible` | Referenced entity is not eligible for this operation. | | `payment_gateway_inactive_request_failed` | Payment gateway inactive; request could not be completed. | | `subscription_id_missing_request_failed_failed` | Subscription ID missing; request failed. | | `simulation_id_missing_request_failed_failed` | Simulation ID missing; request failed. | | `cod_eligibility_failed` | COD eligibility check failed for this order. | | `Paymentlink_create_failed` | Failed to create payment link due to internal issue. | | `headless_otp_submit_request_failed` | OTP submission failed during headless authentication flow. | | `order_creation_faied` | Order creation failed due to validation or server error. | | `pan_submit_failed` | PAN submission failed due to invalid data or server error. | | `gstin_submit_failed` | GSTIN submission failed due to incorrect or missing data. | | `cin_submit_failed` | CIN submission failed due to invalid or missing data. | | `risk_data_ip_address_request_failed` | IP address risk check failed during request processing. | | `cart_create_failed` | Cart creation failed due to invalid input or server issue. | | `order_create_failed` | Order creation failed; please retry or check input data. | | `order_pay_failed` | Order payment attempt failed due to processing error. | | `refund_post_failed` | Refund request failed to post due to system error. | | `link_post_failed` | Failed to post link request to server. | | `api_request_failed` | API request failed due to timeout or internal error. | | `form_post_failed` | Form submission failed due to validation or processing error. | | `aadhar_otp_generation_failed` | Aadhaar OTP generation failed during identity verification. | | `aadhar_otp_verification_failed` | Aadhaar OTP verification failed or expired. | | `pan_verification_failed` | PAN verification failed due to a mismatch or system error. | | `bank_account_verification_failed` | Bank account verification failed due to invalid input. | | `otp_generation_failed` | OTP generation failed due to rate limits or server error. | | `otp_expired_failed` | OTP has expired; please request a new one. | | `otp_invalid_failed` | OTP is invalid or does not match. | | `ref_id_invalid_failed` | Reference ID is invalid or not found. | | `shipping_fetch_failed` | Shipping info fetch failed due to network or service error. | | `entity_simulation_payment_error_code_failed` | Entity simulation failed during payment processing. | | `gst_verification_failed` | GST verification failed due to incorrect or unverified GSTIN. | | `offer_not_found` | Offer not found or does not exist. | | `customer_get_not_found` | Customer not found with given details. | | `payment_not_found` | Payment record not found for provided ID. | | `payment_post_not_found` | Payment request failed; resource not found. | | `entityId_not_found` | Entity ID not found or unrecognised. | | `order_get_not_found` | Order not found for given ID. | | `cart_get_not_found` | Cart not found for current session or ID. | | `orderpay_post_not_found` | OrderPay request not found or already processed. | | `card_alias_not_found` | Card alias not found or invalid. | | `cardbin_details_not_found` | Card BIN details not available or missing. | | `card_not_found` | Card not found or does not exist. | | `order_id_post_not_found` | Order ID not found in post request. | | `modeRates_get_not_found` | Mode rate information not available or missing. | | `refund_get_not_found` | Refund information not found for provided ID. | | `transaction_get_not_found` | Transaction details not found or unavailable. | | `settlement_get_not_found` | Settlement not found for provided identifier. | | `link_get_not_found` | Payment link not found or deleted. | | `merchant_get_not_found` | Merchant account not found or unregistered. | | `terminal_id_post_not_found` | Terminal ID not found in post request. | | `resource_post_not_found` | Resource not found during post request. | | `terminal_post_not_found` | Terminal not found or inactive. | | `order_request_not_found` | Order request not found or expired. | | `payment_request_not_found` | Payment request not found or invalid. | | `dispute_request_not_found` | Dispute request not found or missing. | | `document_request_not_found` | Document request not found or expired. | | `resource_get_not_found` | Requested resource not found or unavailable. | | `form_get_not_found` | Form not found or has been removed. | | `authentication_error` | Authentication failed due to invalid or missing credentials. | | `customer_instruments_authentication_error` | Customer instruments request failed authentication. | | `integrity_token_not_found` | Integrity token not found or expired. | | `checkout_config_not_found` | Checkout configuration not found or misconfigured. | | `api_error_not_found` | API error: requested resource not found. | | `payment_instrument_not_found` | Payment instrument not found or unsupported. | | `order_not_found` | Order does not exist or was deleted. | | `instrument_not_found` | Instrument not found for current customer or request. | | `request_failed` | Request failed due to server or network error. | | `cryptogram_request_failed` | Cryptogram generation failed or request is invalid. | | `authorize_only_invalid` | Authorise-only is not allowed for this transaction. | | `card_number_invalid` | Card number is invalid or incorrectly formatted. | | `emi_tenure_invalid` | EMI tenure is invalid or unsupported for selection. | ## List of errors for payments Download the list of errors along with their explanation. Payment Error List Error details will be shown for every failed transaction in the payload of the following APIs and webhooks: * [Get Payments for an Order](/docs/api-reference/payments/latest/payments/get-payments-for-an-order) * [Get Payment by ID](/docs/api-reference/payments/latest/payments/get-payment-by-id) * [Payment Failed Webhook](/docs/api-reference/payments/latest/payments/webhooks#payment-failed-webhook) # Order Pay Authorise Only Source: https://www.cashfree.com/docs/api-reference/payments/latest/apple-pay/payments/authorize-payment-for-an-order post /orders/sessions/authorize Use this API when an order has already been created and you want Cashfree to process the payment for authorisation only. To use this API, the 'AUTHORIZE_ONLY' flag must be enabled for your account. Submit [Support Form](https://merchant.cashfree.com/auth/login) to enable this feature. # Create Customer at Cashfree Source: https://www.cashfree.com/docs/api-reference/payments/latest/customers/create-customer-at-cashfree openapi/payments/v2026-01-01.yaml post /customers Use this API to register a customer in Cashfree's system before initiating payments, subscriptions, tokenisation, or other customer-linked actions. It creates a reusable *customer profile* and returns a unique identifier for future transactions. # Accept Dispute by Dispute ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/accept-dispute-by-dispute-id openapi/payments/v2026-01-01.yaml put /disputes/{dispute_id}/accept Use this API to get accept the Dispute by specifying the Dispute ID. # Contest Arbitration by Dispute ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/contest-arbitration-by-dispute-id openapi/payments/v2026-01-01.yaml put /disputes/{dispute_id}/contest-arbitration Use this API to contest an ARBITRATION dispute without uploading documents. NPCI (National Payments Corporation of India) does not allow document upload at the `ARBITRATION` stage. Cashfree forwards the evidence you submitted at the pre-arbitration stage to the card network or NPCI for a final decision. To contest a dispute at an earlier stage by uploading documents, use the [Submit Evidence API](/docs/api-reference/payments/latest/disputes/submit-evidence-to-contest-the-dispute-by-dispute-id) instead. Use this API only when `dispute_type` is `ARBITRATION` and `dispute_status` is one of the following: * `ARBITRATION_CREATED` * `ARBITRATION_DOCS_RECEIVED` * `ARBITRATION_INSUFFICIENT_EVIDENCE` # Dispute Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/dispute-webhooks Configure Cashfree dispute webhooks to receive automated notifications when disputes are created, updated, contested, or closed against your transactions. Dispute webhooks can be configured to receive automated notifications when disputes are created, updated and closed. The webhook notification will be sent on all the URLs added and enabled under the dispute webhook. Merchants can add new URLs and enable or disable existing URLs for refund webhook at any point in time and it will be reflected instantaneously. | Webhook | Description | | :- | :- | | DISPUTE\_CREATED | Dispute\_created webhook will be triggered when a new dispute is created. | | DISPUTE\_UPDATED | Dispute\_updated webhook will be triggered when a dispute is updated, for example when a comment is added by the Cashfree team, when the dispute moves into further stages like Pre-arbitration, Arbitration, or when the status of the dispute changes. | | DISPUTE\_CLOSED | This webhook will be triggered when a dispute is closed. | Click [here](/docs/payments/online/webhooks/overview) to know how to configure webhooks. ## Dispute created **Sample Payload** ```javascript Version 2025-01-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475258", "dispute_type": "DISPUTE", "reason_code": "1402", "reason_description": "Duplicate Processing", "dispute_amount": 3, "created_at": "2023-06-15T21:49:48+05:30", "updated_at": "2023-06-15T21:49:48+05:30", "respond_by": "2023-06-18T23:59:59+05:30", "dispute_status": ""DISPUTE_CREATED"", "cf_dispute_remarks": "Dispute is created, please take action", "dispute_action_on": "MERCHANT", "dispute_amount_currency": "INR" }, "order_details": { "order_id": "order_1944392DR1kMTFYdIf8bI2awAcC3i9FTa", "order_amount": 3, "order_currency": "INR", "cf_payment_id": 885473311, "payment_amount": 3, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": "2023-06-15T21:50:04+05:30", "type": "DISPUTE_CREATED" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475258", "dispute_type": "DISPUTE", "reason_code": "1402", "reason_description": "Duplicate Processing", "dispute_amount": 3, "created_at": "2023-06-15T21:49:48+05:30", "updated_at": "2023-06-15T21:49:48+05:30", "respond_by": "2023-06-18T23:59:59+05:30", "dispute_status": ""DISPUTE_CREATED"", "cf_dispute_remarks": "Dispute is created, please take action", "dispute_action_on": "MERCHANT" }, "order_details": { "order_id": "order_1944392DR1kMTFYdIf8bI2awAcC3i9FTa", "order_amount": 3, "order_currency": "INR", "cf_payment_id": 885473311, "payment_amount": 3, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": ""2023-06-15T21:50:04+05:30", "type": "DISPUTE_CREATED" } ``` ## Dispute updated **Sample Payload** ```javascript Version 2025-01-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475257", "dispute_type": "PRE_ARBITRATION", "reason_code": "13.1", "reason_description": "Merchandise / Services Not Received", "dispute_amount": 40000, "created_at": "2023-06-15T21:16:03+05:30", "updated_at": "2023-06-15T21:19:15+05:30", "respond_by": "2023-06-19T23:59:59+05:30", "dispute_status": "PRE_ARBITRATION_CREATED", "cf_dispute_remarks": "Pre Arbitration request has been raised for this case.\nTarget Date :: 2023-06-18T00:00 -> 2023-06-19T23:59:59.", "dispute_update": "TYPE_UPDATE", "dispute_action_on": "MERCHANT", "dispute_amount_currency": "INR" }, "order_details": { "order_id": "order_1944392D4jHtCeVPPdTXkaUwg5cfnujQe", "order_amount": 40000, "order_currency": "INR", "cf_payment_id": 885457437, "payment_amount": 40000, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": "2023-06-15T21:20:24+05:30", "type": "DISPUTE_UPDATED" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475257", "dispute_type": "PRE_ARBITRATION", "reason_code": "13.1", "reason_description": "Merchandise / Services Not Received", "dispute_amount": 40000, "created_at": "2023-06-15T21:16:03+05:30", "updated_at": "2023-06-15T21:19:15+05:30", "respond_by": "2023-06-19T23:59:59+05:30", "dispute_status": "PRE_ARBITRATION_CREATED", "cf_dispute_remarks": "Pre Arbitration request has been raised for this case.\nTarget Date :: 2023-06-18T00:00 -> 2023-06-19T23:59:59.", "dispute_update": "TYPE_UPDATE", "dispute_action_on": "MERCHANT" }, "order_details": { "order_id": "order_1944392D4jHtCeVPPdTXkaUwg5cfnujQe", "order_amount": 40000, "order_currency": "INR", "cf_payment_id": 885457437, "payment_amount": 40000, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": "2023-06-15T21:20:24+05:30", "type": "DISPUTE_UPDATED" } ``` ## Dispute closed **Sample Payload** ```javascript Version 2025-01-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475257", "dispute_type": "CHARGEBACK", "reason_code": "4855", "reason_description": "Goods or Services Not Provided", "dispute_amount": 4500, "created_at": "2023-06-15T21:16:03+05:30", "updated_at": "2023-06-15T21:16:51+05:30", "respond_by": "2023-06-18T00:00:00+05:30", "resolved_at": "2023-06-15T21:16:51.682836678+05:30", "dispute_status": "CHARGEBACK_MERCHANT_WON", "cf_dispute_remarks": "Chargeback won by merchant", "dispute_amount_currency": "INR" }, "order_details": { "order_id": "order_1944392D4jHtCeVPPdTXkaUwg5cfnujQe", "order_amount": 4500, "order_currency": "INR", "cf_payment_id": 885457437, "payment_amount": 4500, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": "2023-06-15T21:17:14+05:30", "type": "DISPUTE_CLOSED" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "dispute": { "dispute_id": "433475257", "dispute_type": "CHARGEBACK", "reason_code": "4855", "reason_description": "Goods or Services Not Provided", "dispute_amount": 4500, "created_at": "2023-06-15T21:16:03+05:30", "updated_at": "2023-06-15T21:16:51+05:30", "respond_by": "2023-06-18T00:00:00+05:30", "resolved_at": "2023-06-15T21:16:51.682836678+05:30", "dispute_status": "CHARGEBACK_MERCHANT_WON", "cf_dispute_remarks": "Chargeback won by merchant" }, "order_details": { "order_id": "order_1944392D4jHtCeVPPdTXkaUwg5cfnujQe", "order_amount": 4500, "order_currency": "INR", "cf_payment_id": 885457437, "payment_amount": 4500, "payment_currency": "INR" }, "customer_details": { "customer_name": "Dileep Kumar s", "customer_phone": "8000000000", "customer_email": "dileep@gmail.com" } }, "event_time": "2023-06-15T21:17:14+05:30", "type": "DISPUTE_CLOSED" } ``` ## Payload field description | Field | Description | Example | Type | | - | - | - | - | | dispute\_id | Cashfree’s unique ID to identify a dispute. | 433475257 | Long | | dispute\_type | Type of dispute created. Possible values:
- DISPUTE
- RETRIEVAL
- CHARGEBACK
- PRE\_ARBITRATION
- ARBITRATION | Chargeback | String | | reason\_code | Condition for which the customer is filing the case. See [dispute reason codes](/docs/payments/manage/disputes/reason-codes) to know more. | 13.6 | String | | reason\_description | Description of the reason code. Codes for Chargeback cases are specified by Card networks/NPCI. | Credit not processed | String | | dispute\_amount | The amount for which the dispute has been created. | 4500 | BigDecimal | | created\_at | Time on which the dispute was registered on Cashfree’s system. | 2023-06-15T21:16:03+05:30 | LocalDateTime | | updated\_at | Time on which the dispute was updated. | 2023-06-15T21:16:51+05:30 | LocalDateTime | | respond\_by | Time by which the merchant is expected to respond to the dispute. | 2023-06-18T00:00:00+05:30 | LocalDateTime | | dispute\_status | Status of Dispute. All possible values are listed in the table below. | CHARGEBACK\_CREATED | String | | cf\_dispute\_remarks | Any remarks specified by Cashfree on the dispute. | Please submit documents. | String | | dispute\_update | Specifies what has been updated on the dispute. Possible Values:
- STATUS\_UPDATE
- TYPE\_UPDATE
- COMMENT\_UPDATE | TYPE\_UPDATE | String | | dispute\_action\_on | Specifies whether the action is on Cashfree or Merchant at a time. Possible Values:
- MERCHANT
- CASHFREE | MERCHANT | String | | resolved\_at | Time on which the dispute was resolved/closed. | 2023-06-15T21:16:51.682836678+05:30 | LocalDateTime | | event\_time | Time at which dispute webhook was initiated. | 2023-06-15T21:16:51+05:30 | LocalDateTime | | type | Type of webhook. Possible Values:
- DISPUTE\_CREATED
- DISPUTE\_UPDATED
- DISPUTE\_CLOSED | DISPUTE\_CREATED | String | | List of dispute status | | :- | | DISPUTE\_CREATED | | DISPUTE\_DOCS\_RECEIVED | | DISPUTE\_UNDER\_REVIEW | | DISPUTE\_MERCHANT\_WON | | DISPUTE\_MERCHANT\_LOST | | DISPUTE\_MERCHANT\_ACCEPTED | | DISPUTE\_INSUFFICIENT\_EVIDENCE | | RETRIEVAL\_CREATED | | RETRIEVAL\_DOCS\_RECEIVED | | RETRIEVAL\_UNDER\_REVIEW | | RETRIEVAL\_MERCHANT\_WON | | RETRIEVAL\_MERCHANT\_LOST | | RETRIEVAL\_MERCHANT\_ACCEPTED | | RETRIEVAL\_INSUFFICIENT\_EVIDENCE | | CHARGEBACK\_CREATED | | CHARGEBACK\_DOCS\_RECEIVED | | CHARGEBACK\_UNDER\_REVIEW | | CHARGEBACK\_MERCHANT\_WON | | CHARGEBACK\_MERCHANT\_LOST | | CHARGEBACK\_MERCHANT\_ACCEPTED | | CHARGEBACK\_INSUFFICIENT\_EVIDENCE | | PRE\_ARBITRATION\_CREATED | | PRE\_ARBITRATION\_DOCS\_RECEIVED | | PRE\_ARBITRATION\_UNDER\_REVIEW | | PRE\_ARBITRATION\_MERCHANT\_WON | | PRE\_ARBITRATION\_MERCHANT\_LOST | | PRE\_ARBITRATION\_MERCHANT\_ACCEPTED | | PRE\_ARBITRATION\_INSUFFICIENT\_EVIDENCE | | ARBITRATION\_CREATED | | ARBITRATION\_DOCS\_RECEIVED | | ARBITRATION\_CONTEST\_REQUESTED | | ARBITRATION\_UNDER\_REVIEW | | ARBITRATION\_MERCHANT\_WON | | ARBITRATION\_MERCHANT\_LOST | | ARBITRATION\_MERCHANT\_ACCEPTED | | ARBITRATION\_INSUFFICIENT\_EVIDENCE | ## Compute signature and verify The signature must be used to verify if the request has not been tampered with. To verify the signature at your end, you will need your Cashfree PG secret key along with the payload. Timestamp is present in the header x-webhook-timestamp ````bash theme={"dark"} timestamp := 1617695238078; signedPayload := $timestamp.$payload; expectedSignature := Base64Encode(HMACSHA256($signedPayload, $merchantSecretKey));``` ```` ## Sample code ### Verify Signature using SDK ```node Node (express) theme={"dark"} var express = require('express') import { Cashfree } from "cashfree-pg"; var app = express() Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.Environment.SANDBOX; app.post('/webhook', function (req, res) { try { Cashfree.PGVerifyWebhookSignature(req.headers["x-webhook-signature"], req.rawBody, req.headers["x-webhook-timestamp"])) } catch (err) { console.log(err.message) } }) ``` ```go Go theme={"dark"} var express = require('express') import { Cashfree } from "cashfree-pg"; var app = express() Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.Environment.SANDBOX; app.post('/webhook', function (req, res) { try { Cashfree.PGVerifyWebhookSignature(req.headers["x-webhook-signature"], req.rawBody, req.headers["x-webhook-timestamp"])) } catch (err) { console.log(err.message) } }) ``` ```php PHP theme={"dark"} "; \Cashfree\Cashfree::$XClientSecret = ""; $cashfree = new \Cashfree\Cashfree(); try { $response = cashfree->PGVerifyWebhookSignature($expectedSig, $inputJSON, $ts); } catch(Exception $e) { // Error if signature verification fails } ?> ``` ```python Python theme={"dark"} from cashfree_pg.api_client import Cashfree @app.route('/webhook', methods = ['POST']) def disp(): # Get the raw body from the request raw_body = request.data # Decode the raw body bytes into a string decoded_body = raw_body.decode('utf-8') #verify_signature timestamp = request.headers['x-webhook-timestamp'] signature = request.headers['x-webhook-signature' cashfree = Cashfree() cashfree.XClientId = "" cashfree.XClientSecret = "" try: cashfreeWebhookResponse = cashfree.PGVerifyWebhookSignature(signature, decoded_body, timestamp) except: # If Signature mis-match ``` ```java Java theme={"dark"} import com.cashfree.*; @PostMapping("/my-endpoint") public String handlePost(HttpServletRequest request) throws IOException { Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.SANDBOX; StringBuilder stringBuilder = new StringBuilder(); BufferedReader bufferedReader = null; try { bufferedReader = request.getReader(); String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line).append('\n'); } String rawBody = stringBuilder.toString(); String signature = request.getHeader("x-webhook-signature"); String timestamp = request.getHeader("x-webhook-timestamp"); Cashfree cashfree = new Cashfree(); PGWebhookEvent webhook = cashfree.PGVerifyWebhookSignature(signature, rawBody, timestamp); } catch (Exception e) { // Error if verification fails } finally { if (bufferedReader != null) { bufferedReader.close(); } } } ``` ```c C# theme={"dark"} using cashfree_pg.Client; using cashfree_pg.Model; [Route("api/[controller]")] [ApiController] public class YourController : ControllerBase { [HttpPost] public async Task Post() { // Read the raw body of the POST request using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)) { string requestBody = await reader.ReadToEndAsync(); var headers = Request.Headers; var signature = headers["x-webhook-signature"]; var timestamp = headers["x-webhook-timestamp"]; Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.SANDBOX; var cashfree = new Cashfree(); try { var response = cashfree.PGVerifyWebhookSignature(signature, requestBody, timestamp); } catch(Exception e) { // Error if signature mis matches } } } } ``` ### Compute signature and verify manually ```node Node (express) theme={"dark"} function verify(ts, rawBody){ const body = req.headers["x-webhook-timestamp"] + req.rawBody; const secretKey = ""; let genSignature = crypto.createHmac('sha256',secretKey).update(body).digest("base64"); return genSignature } ``` ```go Go theme={"dark"} func VerifySignature(expectedSig string, ts string, body string) (string, error) { t := time.Now() currentTS := t.Unix() if currentTS-ts > 1000*300 { return "", errors.New("webhook delivered too late") } signStr := strconv.FormatInt(ts, 10) + body fmt.Println("signing String: ", signStr) key := "" h := hmac.New(sha256.New, []byte(key)) h.Write([]byte(signStr)) b := h.Sum(nil) return base64.StdEncoding.EncodeToString(b), nil } timestamp := c.Request().Header.Get("x-webhook-timestamp") body, _ := ioutil.ReadAll(c.Request().Body) rawBody := string(body) signature := c.Request().Header.Get("x-webhook-signature") VerifySignature(signature, timestamp, rawBody)func VerifySignature(expectedSig string, ts string, body string) (string, error) { t := time.Now() currentTS := t.Unix() if currentTS-ts > 1000*300 { return "", errors.New("webhook delivered too late") } signStr := strconv.FormatInt(ts, 10) + body fmt.Println("signing String: ", signStr) key := "" h := hmac.New(sha256.New, []byte(key)) h.Write([]byte(signStr)) b := h.Sum(nil) return base64.StdEncoding.EncodeToString(b), nil } timestamp := c.Request().Header.Get("x-webhook-timestamp") body, _ := ioutil.ReadAll(c.Request().Body) rawBody := string(body) signature := c.Request().Header.Get("x-webhook-signature") VerifySignature(signature, timestamp, rawBody) ``` ```php PHP theme={"dark"} function computeSignature($ts, $rawBody){ $rawBody = file_get_contents('php://input'); $ts = getallheaders()['x-webhook-timestamp']; $signStr = $ts . $rawBody; $key = ""; $computeSig = base64_encode(hash_hmac('sha256', $signStr, $key, true)); return $computeSig; } ``` ```java Java theme={"dark"} public String generateSignature() { bufferedReader = request.getReader(); String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line).append('\n'); } String payload = stringBuilder.toString(); String timestamp = request.getHeader("x-webhook-timestamp"); String data = timestamp+payload; String secretKey = "SECRET-KEY"; // Get secret key from Cashfree Merchant Dashboard; Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); SecretKeySpec secret_key_spec = new SecretKeySpec(secretKey.getBytes(),"HmacSHA256"); sha256_HMAC.init(secret_key_spec); String computed_signature = Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(data.getBytes())); return computed_signature; // compare with "x-webhook-signature" } ``` ```python Python theme={"dark"} import base64 import hashlib import hmac def generateSignature(): # Get the raw body from the request raw_body = request.data # Decode the raw body bytes into a string payload = raw_body.decode('utf-8') #verify_signature timestamp = request.headers['x-webhook-timestamp'] signatureData = timestamp+payload message = bytes(signatureData, 'utf-8') secretkey=bytes("Secret_Key",'utf-8') #Get Secret_Key from Cashfree Merchant Dashboard. signature = base64.b64encode(hmac.new(secretkey, message, digestmod=hashlib.sha256).digest()) computed_signature = str(signature, encoding='utf8') return computed_signature #compare with "x-webhook-signature" ``` # Get Disputes by Dispute ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/get-disputes-by-dispute-id openapi/payments/v2026-01-01.yaml get /disputes/{dispute_id} Use this API to get Dispute details by specifying the Dispute ID. # Get Disputes by Order ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/get-disputes-by-order-id openapi/payments/v2026-01-01.yaml get /orders/{order_id}/disputes Use this API to get all Dispute details by specifying the Order ID. # Get Disputes by Payment ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/get-disputes-by-payment-id openapi/payments/v2026-01-01.yaml get /payments/{cf_payment_id}/disputes Use this API to get all Dispute details by specifying the Payment ID. # Submit Evidence to contest the Dispute by Dispute ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/submit-evidence-to-contest-the-dispute-by-dispute-id openapi/payments/v2026-01-01.yaml post /disputes/{dispute_id}/documents Use this API to submit evidence to contest a dispute by specifying the dispute ID. This API does not apply to ARBITRATION disputes. Use the [Contest Arbitration API](/docs/api-reference/payments/latest/disputes/contest-arbitration-by-dispute-id) instead. As per NPCI (National Payments Corporation of India) guidelines, document upload is not allowed at the ARBITRATION stage. If the dispute has reached the ARBITRATION stage, use the [Contest Arbitration API](/docs/api-reference/payments/latest/disputes/contest-arbitration-by-dispute-id) instead. All evidence submitted during the pre-arbitration stage is automatically carried forward for further processing. # Fetch All Downtimes Source: https://www.cashfree.com/docs/api-reference/payments/latest/downtime/fetch-all-downtimes openapi/payments/v2026-01-01.yaml get /incident Fetches active downtimes across various payment methods based on filters. Gives all active downtimes when no filters are applied. # Create Adjustment Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/create-adjustment openapi/payments/v2026-01-01.yaml post /easy-split/vendors/{vendor_id}/adjustment The Create Adjustment API will create a adjustment request either from vendor to the merchant or from merchant to the vendor. # Create On Demand Transfer Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/create-on-demand-transfer openapi/payments/v2026-01-01.yaml post /easy-split/vendors/{vendor_id}/transfer The Create On Demand Transfer API will create a new on-demand request either from to the merchant or from to the vendor. # Create Static Split Configuration Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/create-static-split-configuration openapi/payments/v2026-01-01.yaml post /easy-split/static-split This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. # Create Vendor Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/create-vendor openapi/payments/v2026-01-01.yaml post /easy-split/vendors Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. Keep the following points in mind when you create a vendor: * Use [test account details](/docs/payments/split/data-to-test#sample-bank-account-numbers-upi-and-vpa) in Sandbox mode. * Use test GST and PAN numbers from the [test details](/docs/payments/split/data-to-test#test-details) page. * Vendors that you create in the Sandbox environment with test bank account and KYC details move to `ACTIVE` status automatically after 10 minutes. * If a vendor doesn't move to `ACTIVE` status within 24 hours in Production mode, fill out the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). # Download Vendor Documents Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/download-vendor-documents openapi/payments/v2026-01-01.yaml get /easy-split/vendor-docs/{vendor_id}/download/{doc_type} Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. # Get On Demand Balance Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-on-demand-balance openapi/payments/v2026-01-01.yaml get /easy-split/vendors/{vendor_id}/balances This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. # Get Split and Settlement Details by OrderID Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-split-and-settlement-details-by-orderid openapi/payments/v2026-01-01.yaml get /easy-split/orders/{order_id} Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. # Get Split and Settlement Details by OrderID v2.0 Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-split-and-settlement-details-by-orderid-v20 openapi/payments/v2026-01-01.yaml post /split/order/vendor/recon Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. # Get Vendor All Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-vendor-all-details openapi/payments/v2026-01-01.yaml get /easy-split/vendors/{vendor_id} Use this API to get the details of a specific vendor associated with your Easy Split account. # Get Vendor All Documents Status Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-vendor-all-documents-status openapi/payments/v2026-01-01.yaml get /easy-split/vendor-docs/{vendor_id} Use this API to fetch the details of all the KYC details of a particular vendor. # Get Vendor Balance Transfer Charges Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/get-vendor-balance-transfer-charges openapi/payments/v2026-01-01.yaml get /easy-split/amount/{amount}/charges This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. # Split After Payment Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/split-after-payment openapi/payments/v2026-01-01.yaml post /easy-split/orders/{order_id}/split The Split After Payment API splits payments to vendors after customers successfully complete a payment. After you receive a successful payment confirmation, wait 2 minutes before you call this API endpoint. # Update Vendor Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/update-vendor-details openapi/payments/v2026-01-01.yaml patch /easy-split/vendors/{vendor_id} Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. # Upload Vendor Docs Source: https://www.cashfree.com/docs/api-reference/payments/latest/easy-split/upload-vendor-docs openapi/payments/v2026-01-01.yaml post /easy-split/vendor-docs/{vendor_id} Use this API to upload KYC documents of a specific vendor. # Get Eligible Cardless EMI Payment Methods for a customer on an order Source: https://www.cashfree.com/docs/api-reference/payments/latest/eligibility/get-eligible-cardless-emi-payment-methods-for-a-customer-on-an-order openapi/payments/v2026-01-01.yaml post /eligibility/cardlessemi Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. # Get Eligible Offers for an Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/eligibility/get-eligible-offers-for-an-order openapi/payments/v2026-01-01.yaml post /eligibility/offers Use this API to get eligible offers for an order_id or order amount. # Get Eligible Paylater for a customer on an order Source: https://www.cashfree.com/docs/api-reference/payments/latest/eligibility/get-eligible-paylater-for-a-customer-on-an-order openapi/payments/v2026-01-01.yaml post /eligibility/paylater Use this API to get eligible Paylater Payment Methods for a customer on an order. # Get Eligible Payment Methods for Orders Source: https://www.cashfree.com/docs/api-reference/payments/latest/eligibility/get-eligible-payment-methods openapi/payments/v2026-01-01.yaml post /eligibility/payment_methods Fetch the payment instruments a Cashfree order is eligible to use, including UPI, cards, netbanking, wallets, and EMI rails for personalised checkouts. Run in Postman: You can also try this API in our Postman Collection. ## Client environment headers Cashfree requires information about the customer's device environment to enforce NPCI rules. You must include the following headers in your [Order Pay API](/docs/api-reference/payments/latest/payments/order-pay) and Get Eligible Payment Methods request: | Header | Accepted values | Requirement | Description | | - | - | - | - | | `x-client-device` | `mobile`, `desktop`, `tablet` | Required | Type of device used by customer | | `x-client-os` | `android`, `ios`, `windows`, `macos`, `linux`, `others` | Required | Operating system of customer's device | | `x-client-rendering-type` | `mweb`, `webview`, `native` | Required when `x-client-device` is mobile | Rendering method used for the checkout experience | | `x-client-browser` | `safari`, `chrome`, `firefox`, `edge`, `others` | Required | Browser used by the customer | `x-client-rendering-type` is required only when `x-client-device` is set to mobile. For desktop and tablet devices, this header is optional. # Fetch Downtime by ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/intellisense/fetch-downtime-by-id openapi/payments/v2026-01-01.yaml get /incident/{id} Fetches details of a specific downtime using its unique ID. # Get Import Settlement Details for an Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/get-import-settlement-details openapi/cb-imports/v2026-01-01.yaml get /import/orders/{order_id}/settlements This API is used to get ICA settlement details using PG Order ID. # Get Import Settlement Recon Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/get-import-settlement-recon-details openapi/cb-imports/v2026-01-01.yaml post /import/settlements/recon This API is used to fetch all events for the provided Settlement IDs. # Get Payment Verification Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/get-payment-verification-details get /import/transactions/{cf_payment_id} This API is used to get the verification status of the payment. # Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/import-webhooks Set up Cashfree Collect from India import webhooks to receive event-based notifications about incoming international payments and reconciliation status. Webhooks are server callbacks to your server from Cashfree. Webhooks are event-based and are sent when specific events related to the transaction happen. For instructions on configuring webhooks, see [Configure Webhooks](/docs/payments/online/webhooks/configure). ## Payment Verification details webhook version (2025-01-01) The payment verification details update webhook notifies you about the payment details verification, and it give you comprehensive information about verification details update. A notification is sent to your backend from cashfree when there is any new update for payment verification. These notification are useful in cases when the internet connection is unstable or slow while the payment is getting processed. This will allow you to reconcile all the payment verification update at your end. Notifications will be sent to **notifyUrl** which is a part of the request parameter specified while creating an order request. ### Sample payload ```json Json theme={"dark"} { "data": { "order_id": "e145c994-5899-4466-804d-b90c625b2c1b", "cf_payment_id": 5114910634577, "payment_status": "SUCCESS", "payment_verification_status": "ACTION_REQUIRED", "payment_verification_expiry": "2024-07-12T15:19:42+05:30", "remarks": null, "required_details": [ { "doc_name": "goods_description", "doc_type": "VALUE", "doc_status": "ACTION_REQUIRED", "remarks": null }, { "doc_name": "invoice_number", "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "importer_name", "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "importer_address", "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "country_of_origin", "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "invoice_file", "doc_type": "DOCUMENT", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "ecommerce_order_serial_number", //Required for Physical Goods and Digital Goods "doc_type": "VALUE", "doc_status": "ACTION_REQUIRED", "remarks": null }, { "doc_name": "hs_code", //Required for Physical Goods and Digital Goods "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "shipment_date", //Required for Physical Goods "doc_type": "VALUE", "doc_status": "ACTION_REQUIRED", "remarks": null }, { "doc_name": "port_of_loading",//Required for Physical Goods "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null }, { "doc_name": "awb_number",//Required for Physical Goods "doc_type": "VALUE", "doc_status": "IN_REVIEW", "remarks": null } ] }, "event_time": "2024-07-12T13:39:42+05:30", "type": "PAYMENT_VERIFICATION_UPDATE" } ``` ## ICA Settlement details webhook version 1 (2022-09-01) The ICA Settlement Details Update webhook notifies you about the ica settlement. A notification is sent to your backend from cashfree when there is any new update for ica settlement. These notification are useful in cases when the internet connection is unstable or slow while the payment is getting processed. This will allow you to reconcile all the ica settlement update at your end. Notifications will be sent to **notifyUrl** which is a part of the request parameter specified while creating an order request. ### Sample payload
```json Json theme={"dark"} { "data": { "adjustment_amount_inr": -347641.22, "collection_amount_inr": 604854.0, "initiated_on": null, "payment_from": "2024-09-26T15:43:55", "payment_till": "2024-09-26T16:43:13", "service_charge_inr": null, "service_tax_inr": 2068.59, "settled_on": null, "settlement_amount_inr": 243651.95, "settlement_charges_inr": 0.0, "settlement_foreign_currency_details": { "settlement_amount_fcy": null, "settlement_currency": "USD", "settlement_forex_rate": null }, "cf_ica_settlement_id": 12, "settlement_tax_inr": 0.0, "settlement_utr": null, "status": "NOT_INITIATED" }, "event_time": "2024-10-03T13:27:36+05:30", "type": "ICA_SETTLEMENT_UPDATE" } ``` ## ICA settlement details webhook for LRS travel The ICA settlement details update webhook for Liberalised Remittance Scheme (LRS) travel notifies you about ICA settlements for LRS travel collections. This payload includes the `tcs_amount_inr` field, which reports the tax collected at source (TCS) on the settlement. ### Sample payload
```json Json theme={"dark"} { "data": { "cf_ica_settlement_id": 10683, "status": "SETTLED", "collection_amount_inr": 34653.0000, "service_charge_inr": 658.4400, "service_tax_inr": 118.5100, "tcs_amount_inr": 4053.5000, "adjustment_amount_inr": 0.0000, "settlement_charges_inr": 0.0000, "settlement_tax_inr": 0.0000, "settlement_amount_inr": 30599.5000, "settlement_foreign_currency_details": { "settlement_currency": "USD", "settlement_forex_rate": 94.5398, "settlement_amount": 323.6679 }, "payment_from": "2026-06-05T19:33:59+05:30", "payment_till": "2026-06-08T13:22:48+05:30", "settlement_utr": "8503c728-a7e5-4cec-9e87-4284ee3a235c", "initiated_on": "2026-06-10T10:28:33+05:30", "settled_on": "2026-06-30T06:29:21+05:30" }, "event_time": "2026-06-30T06:29:21+05:30", "type": "ICA_SETTLEMENT_UPDATE" } ```
## Signature verification The signature must be used to verify if the request has not been tampered with. To verify the signature at your end, you will need your Cashfree PG secret key along with the payload. timestamp is present in the header x-webhook-timestamp\ Actual signature is present in the header x-webhook-signature ``` timestamp := 1617695238078; signedPayload := $timestamp.$payload; expectedSignature := Base64Encode(HMACSHA256($signedPayload, $merchantSecretKey)); ``` ## Sample code ### Verify Signature using SDK ```node Node(express) theme={"dark"} using cashfree_pg.Client; using cashfree_pg.Model; [Route("api/[controller]")] [ApiController] public class YourController : ControllerBase { [HttpPost] public async Task Post() { // Read the raw body of the POST request using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)) { string requestBody = await reader.ReadToEndAsync(); var headers = Request.Headers; var signature = headers["x-webhook-signature"]; var timestamp = headers["x-webhook-timestamp"]; Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.SANDBOX; var cashfree = new Cashfree(); try { var response = cashfree.PGVerifyWebhookSignature(signature, requestBody, timestamp); } catch(Exception e) { // Error if signature mis matches } } } } ``` ```go Go theme={"dark"} import ( cashfree "github.com/cashfree/cashfree-pg/v4" ) // Route e.POST("/webhook", _this.Webhook) // Controller func (_this *WebhookRoute) Webhook(c echo.Context) error { clientId := "" clientSecret := "" cashfree.XClientId = &clientId cashfree.XClientSecret = &clientSecret cashfree.XEnvironment = cashfree.SANDBOX signature := c.Request().Header.Get("x-webhook-signature") timestamp := c.Request().Header.Get("x-webhook-timestamp") body, _ := ioutil.ReadAll(c.Request().Body) rawBody := string(body) webhookEvent, err := cashfree.PGVerifyWebhookSignature(signature, rawBody, timestamp) if err != nil { fmt.Println(err.Error()) } else { fmt.Println(webhookEvent.Object) } } ``` ```php PHP theme={"dark"} "; \Cashfree\Cashfree::$XClientSecret = ""; $cashfree = new \Cashfree\Cashfree(); try { $response = cashfree->PGVerifyWebhookSignature($expectedSig, $inputJSON, $ts); } catch(Exception $e) { // Error if signature verification fails } ?> ``` ```python Python theme={"dark"} from cashfree_pg.api_client import Cashfree @app.route('/webhook', methods = ['POST']) def disp(): # Get the raw body from the request raw_body = request.data # Decode the raw body bytes into a string decoded_body = raw_body.decode('utf-8') #verify_signature timestamp = request.headers['x-webhook-timestamp'] signature = request.headers['x-webhook-signature' cashfree = Cashfree() cashfree.XClientId = "" cashfree.XClientSecret = "" try: cashfreeWebhookResponse = cashfree.PGVerifyWebhookSignature(signature, decoded_body, timestamp) except: # If Signature mis-match ``` ```java Java theme={"dark"} import com.cashfree.*; @PostMapping("/my-endpoint") public String handlePost(HttpServletRequest request) throws IOException { Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.SANDBOX; StringBuilder stringBuilder = new StringBuilder(); BufferedReader bufferedReader = null; try { bufferedReader = request.getReader(); String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line).append('\n'); } String rawBody = stringBuilder.toString(); String signature = request.getHeader("x-webhook-signature"); String timestamp = request.getHeader("x-webhook-timestamp"); Cashfree cashfree = new Cashfree(); PGWebhookEvent webhook = cashfree.PGVerifyWebhookSignature(signature, rawBody, timestamp); } catch (Exception e) { // Error if verification fails } finally { if (bufferedReader != null) { bufferedReader.close(); } } } ``` ```c C# theme={"dark"} using cashfree_pg.Client; using cashfree_pg.Model; [Route("api/[controller]")] [ApiController] public class YourController : ControllerBase { [HttpPost] public async Task Post() { // Read the raw body of the POST request using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)) { string requestBody = await reader.ReadToEndAsync(); var headers = Request.Headers; var signature = headers["x-webhook-signature"]; var timestamp = headers["x-webhook-timestamp"]; Cashfree.XClientId = ""; Cashfree.XClientSecret = ""; Cashfree.XEnvironment = Cashfree.SANDBOX; var cashfree = new Cashfree(); try { var response = cashfree.PGVerifyWebhookSignature(signature, requestBody, timestamp); } catch(Exception e) { // Error if signature mis matches } } } } ``` ### Compute signature and verify manually ```node Node(express) theme={"dark"} function verify(ts, rawBody){ const body = req.headers["x-webhook-timestamp"] + req.rawBody; const secretKey = ""; let genSignature = crypto.createHmac('sha256',secretKey).update(body).digest("base64"); return genSignature } ``` ```go Go theme={"dark"} func VerifySignature(expectedSig string, ts string, body string) (string, error) { t := time.Now() currentTS := t.Unix() if currentTS-ts > 1000*300 { return "", errors.New("webhook delivered too late") } signStr := strconv.FormatInt(ts, 10) + body fmt.Println("signing String: ", signStr) key := "" h := hmac.New(sha256.New, []byte(key)) h.Write([]byte(signStr)) b := h.Sum(nil) return base64.StdEncoding.EncodeToString(b), nil } timestamp := c.Request().Header.Get("x-webhook-timestamp") body, _ := ioutil.ReadAll(c.Request().Body) rawBody := string(body) signature := c.Request().Header.Get("x-webhook-signature") VerifySignature(signature, timestamp, rawBody) ``` ```php PHP theme={"dark"} function computeSignature($ts, $rawBody){ $rawBody = file_get_contents('php://input'); $ts = getallheaders()['x-webhook-timestamp']; $signStr = $ts . $rawBody; $key = ""; $computeSig = base64_encode(hash_hmac('sha256', $signStr, $key, true)); return $computeSig; } ``` ```java Java theme={"dark"} public String generateSignature() { bufferedReader = request.getReader(); String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line).append('\n'); } String payload = stringBuilder.toString(); String timestamp = request.getHeader("x-webhook-timestamp"); String data = timestamp+payload; String secretKey = "SECRET-KEY"; // Get secret key from Cashfree Merchant Dashboard; Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); SecretKeySpec secret_key_spec = new SecretKeySpec(secretKey.getBytes(),"HmacSHA256"); sha256_HMAC.init(secret_key_spec); String computed_signature = Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(data.getBytes())); return computed_signature; // compare with "x-webhook-signature" } ``` ```python Python theme={"dark"} import base64 import hashlib import hmac def generateSignature(): # Get the raw body from the request raw_body = request.data # Decode the raw body bytes into a string payload = raw_body.decode('utf-8') #verify_signature timestamp = request.headers['x-webhook-timestamp'] signatureData = timestamp+payload message = bytes(signatureData, 'utf-8') secretkey=bytes("Secret_Key",'utf-8') #Get Secret_Key from Cashfree Merchant Dashboard. signature = base64.b64encode(hmac.new(secretkey, message, digestmod=hashlib.sha256).digest()) computed_signature = str(signature, encoding='utf8') return computed_signature #compare with "x-webhook-signature" ```
# Mark Sandbox Settlement Processed Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/mark-sandbox-settlement-processed put /import/settlements/emulate This API is used to mark settlement as processed in sandbox environment. # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/overview Cashfree Collect from India helps overseas merchants, payment aggregators, and marketplaces accept payments from Indian customers in INR with full compliance. **Getting Started** Follow the steps mentioned below to get started with Collect from India APIs * Fill out the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1) for onboarding assistance * If you are a Merchant, generate your keys using this method [Link](/docs/api-reference/authentication#generate-api-keys) * Register your webhook URL for updates and subscribe to the required events. For more information, refer to the [Webhook documentation](/docs/api-reference/payments/latest/international-payments/collect-from-india/import-webhooks). Once these setup is completed, we can use the below mentioned collection of APIs to create import transactions. **Collect from India - List of APIs** | API name | Description | | :- | :- | | [Create Order](/docs/api-reference/payments/latest/orders/create-order) | This API will create an order to collect payment | | [Order Pay](/docs/api-reference/payments/latest/payments/order-pay) | This API is used to pay the created payment | | [Get Payment by ID](/docs/api-reference/payments/latest/payments/get-payment-by-id) | This API is used to view payment details of an order for a payment ID | | [Upload Payment Verification Details](/docs/api-reference/payments/latest/international-payments/collect-from-india/upload-payment-verification-details) | This API is used to upload the required payment verification details | | [Get Payment Verification Details](/docs/api-reference/payments/latest/international-payments/collect-from-india/get-payment-verification-details) | This API is used to Get the verification status of the payment | | [Get Import Settlement Details for an Order](/docs/api-reference/payments/latest/international-payments/collect-from-india/get-import-settlement-details) | This API is used to get ICA settlement details using PG Order ID | | [Get Import Settlement Recon Details](/docs/api-reference/payments/latest/international-payments/collect-from-india/get-import-settlement-recon-details) | This API is used to fetch all events happened for provided Settlement IDs | # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/sandbox-simulation Learn how to simulate transaction verification and settlement processes in the sandbox environment for payments from India-based customers to overseas merchants ## Transaction verification simulation In the sandbox environment, you can simulate transaction verification using predefined test values that are automatically approved. For file-type content, the system approves PDF files while rejecting other file formats. You can submit verification details either through the [Upload Payment Verification Details](/docs/api-reference/payments/latest/international-payments/collect-from-india/upload-payment-verification-details) or the dashboard. ### Test values for transaction verification | Field name | Value | | - | - | | importer\_name | John | | importer\_address | 321 Elm Street, Suite 3, Los Angeles, CA 90401, USA | | goods\_description | This is a test product for test purpose | | country\_of\_origin | USA | | ecommerce\_order\_serial\_number | 123123 | | invoice\_number | 234234 | | hs\_code | 3456 | | shipment\_date | 01/01/2027 | | port\_of\_loading | Houston | | importer\_address\_postal\_code | 560034 | ## Settlement simulation The sandbox environment provides APIs to simulate the settlement process. This includes triggering settlements and updating their status. ### Trigger settlement Use the [Trigger Settlement API](/docs/api-reference/payments/latest/international-payments/collect-from-india/trigger-sandbox-settlement) to initiate a settlement. This is an asynchronous process, with settlement entries typically created within one second. ### Mark settlement as processed To update a settlement's status to "Processed", use the [Mark Settlement as Processed](/docs/api-reference/payments/latest/international-payments/collect-from-india/mark-sandbox-settlement-processed). The settlement forex rate shown is notional and may differ from actual foreign exchange rates. #### Simulating skipped settlements A settlement will be skipped if the settlement amount is between 0 and 1 INR, or if it is negative, the amount will be adjusted in the next settlement. Example of how to simulate a skipped settlement: 1. Create a transaction 2. Refund the transaction 3. Trigger settlement using the API The settlement will be skipped since the total collection amount will be less than 0. # Trigger Sandbox Settlement Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/trigger-sandbox-settlement post /import/settlements/emulate This API is used to trigger settlement in sandbox environment. # Upload Payment Verification Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/upload-payment-verification-details openapi/cb-imports/v2025-01-01.yaml post /import/transactions/{cf_payment_id} This API is used to upload the required payment verification details. # End Points Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/endpoints Reference base URLs and endpoints for the Cashfree Global Collections APIs across the sandbox testing environment and the production processing environment. ## Global collections gateway end points | Environment | Base URL | | :- | :- | | Test | [https://sandbox.cashfree.com/](https://sandbox.cashfree.com/) | | Production | [https://api.cashfree.com/](https://api.cashfree.com/) | # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/overview Use Cashfree Global Collections to accept cross-border collections in multiple currencies through virtual accounts that settle to your home bank account. To start using Global Collection APIs, generate your API credentials by following these steps: 1. Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login). 2. Go to **Developers**. 3. Click **API Keys** under the respective product card. 4. Select **Generate API Keys** and click **Download**. In the test environment, keys are auto-generated. In production, click **Generate API Keys** and complete two-factor authentication. View keys by clicking the icon and selecting **View API Key**. *** Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | **Global Collections List of APIs** | API name | Description | | :- | :- | | [Get Token](/docs/api-reference/payments/latest/international-payments/global-collections/partner/auth-get-token) | This API generates a new token. | | [Verify Token](/docs/api-reference/payments/latest/international-payments/global-collections/partner/auth-verify-token) | Verify the authentication token generated. The response will be ‘Token is not valid’ if the token does not exist, invalid or has been expired. | | [Get Collection Accounts](/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-collection-accounts) | This API fetches all the virtual accounts that are linked with this account. | | [Get Transactions](/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-transactions) | Use this API to get all the transaction details within a time interval. | | [Add Transaction Details](/docs/api-reference/payments/latest/international-payments/global-collections/partner/add-transaction-details) | Use this API to add transaction details to upload multiple invoices until the cumulative total of all invoice amounts matches the transaction amount. | | [Simulate Transaction](/docs/api-reference/payments/latest/international-payments/global-collections/partner/simulate-transaction) | Use this API to simulate funding to any of the virtual accounts of your merchants. | # Add Transaction Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/add-transaction-details post /gc/transactions/{referenceId}/invoice-details Use this API to input invoice details for a specific transaction. You have the flexibility to upload multiple invoices until the cumulative total of all invoice amounts matches the transaction amount. Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | # Get Auth Token Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/auth-get-token post /gc/authorize Use this API to authenticate with the Cashfree system and obtain the authorization bearer token. Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/auth-overview Authenticate Global Collections partner API calls by generating bearer tokens, verifying token validity, and refreshing credentials before each request. * [Get Token](/docs/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/auth-get-token) - Use the Get Token API to authenticate with the Cashfree system and obtain the authorization bearer token, call the authorize API. * [Verify Token](/docs/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/auth-verify-token) - Verify the authentication token generated. The response will be 'Token is not valid' if the token does not exist, invalid or has been expired. # Verify Auth Token Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/auth-verify-token get /gc/token/verify Verify the authentication token generated by the user. # Get Collection Accounts Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-collection-accounts get /gc/virtual-accounts This API fetches all the virtual accounts that is linked with the given merchant ID. Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | # Get Transactions Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-transactions get /gc/transactions Use this API to get all the transaction details within a time interval. Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/overview Browse Cashfree Global Collections partner APIs to fetch merchant transactions, simulate funding events, and manage virtual collection accounts at scale. * [Get All Transactions Details](/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-transactions) - Use this to fetch all the transactions for a particular merchant. * [Emulate Funding](/docs/api-reference/payments/latest/international-payments/global-collections/partner/simulate-transaction) - Use this to emulate a transaction for a specific merchant. * [Get All Collection Accounts for Partner Merchants](/docs/api-reference/payments/latest/international-payments/global-collections/partner/get-collection-accounts) - Use this to get all VAs for a specific merchant. * [Add Invoice Details for Partner Merchants](/docs/api-reference/payments/latest/international-payments/global-collections/partner/add-transaction-details) - Use this API to input invoice details for a specific transaction for a specific merchant. * [Merchant Webhook Configs](/docs/api-reference/payments/latest/international-payments/global-collections/partner/webhooks) - Use this document to understand the webhooks payload events and verification. # Simulate Transaction Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/simulate-transaction post /gc/transactions/emulate Use this API to simulate a funding in test environment. Based on who you are, consider the below values in the API requests | Cashfree Merchant | Cashfree Partner | | :- | :- | | x-client-id | x-partner-api-key | | x-client-secret | x-partner-merchantid | # Webhook - Partner Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/partner/webhooks Configure Global Collections partner webhooks in the Cashfree partner dashboard to receive transaction, settlement, and virtual account notifications. ### Guide to subscribe webhook events 1. Visit [https://partner.cashfree.com](https://partner.cashfree.com) login with your partner credentials 2. On the landing page click on developers section and select webhook, you will be redirected to a page to add webhook URL and subscribe events or once logged in you can use this URL [Webhook Page](https://partner.cashfree.com/partner-ui/dashboard/developers/webhook) 3. Add your webhook URL and subscribe events Global Collect Transaction, Global Collect Settlement & Global Collect Virtual Account 4. To validate the webhook signature follow [Adding webhook and signature verification guide](/docs/api-reference/platforms/latest/merchant-onboarding/webhooks#verify-signature) ### Screenshots: Landing page to add the webhook URL and subscribe the events We can add multiple webhook URLs for the different type of events. For testing, Switch to test and follow the same step in sandbox environment. ## Transaction status Active Event needs to be subscribed: **Global Collect Transaction** ```json Json theme={"dark"} { "amount": "4.50", "currency": "GBP", "cmsProfileId": 123, "event": "INTERNATIONAL_PAYMENT_COLLECTED", "merchant": { "merchant_id": "CF_7644f46b-ad82-472c-8d97-609d1a429eac" }, "paymentTime": "2022-12-29 13:42:54", "referenceId": 63, "remarks": "", "remitterAccount": "1223456789", "remitterAddress": "Dummy Address", "remitterBic": "TRWIBEB1XXX", "remitterCountry": "GB", "remitterName": "Dummy Sender", "remitterRoutingCode": "TLG0123", "status": "COMPLETED", "utr": "5347f52a-9851-4fe9-8618-32eb085590ce", "updatedStatusTime": "2022-12-29 13:50:35", "vAccountId": "97836", "vAccountNumber": "GB38TCCL12345687997836" } ``` ### Possible events and corresponding transaction status mapping | Event name | Payment status | Description | | :- | :- | :- | | INTERNATIONAL\_PAYMENT\_COLLECTED | COMPLETED | Received payment | | INTERNATIONAL\_PAYMENT\_BLOCKED | BLOCKED | The transaction has been blocked due to the specified reason in the designated field. | | INTERNATIONAL\_PAYMENT\_AWAITING\_DETAILS | COMPLETED | Waiting for the details of the transaction | ### Payload field description | Field | Description | Example | | :- | :- | :- | | amount | The foreign currency amount sent | 4.50 | | currency | Three character ISO code. View list of supported currencies [here](/docs/payments/global-collections/collection-accounts#supported-currencies). | GBP | | cmsProfileId | Merchant identifier | 123 | | event | Webhook event | INTERNATIONAL\_AMOUNT\_COLLECTED | | paymentTime | The time at which the payment was initiated. | 2022-12-29 13:42:54 | | referenceId | Cashfree transaction identifier | 63 | | remarks | Remarks passed by the sender. | Sample Remark | | reason | Reason regarding the transaction being blocked. | Transaction value below the allowed limit | | remitterAccount | The bank account number of the person who sends the money. | 1223456789 | | remitterAddress | The address of the person who sends the money. | Dummy Address | | remitterBic | Bank identifier code for the remitter. | TRWIBEB1XXX | | remitterCountry | The country from which the money is sent. | GB | | remitterName | The name of the remitter who is sending the money. | John Doe | | remitterRoutingCode | The routing code of the remitter's bank. | TLG0123 | | status | Status of FCY (foreign currency leg) of transaction. | COMPLETED, FAILED, AWAITING\_DETAILS | | updatedStatusTime | The time of the last status update. | 2022-12-29 13:50:35 | | vAccountId | Identifier of the virtual account. | 97836 | | vAccountNumber | Account number to which the payment was done. | GB38TCCL12345687997836 | | merchant | Object contains merchant\_id used while creating merchant | CF\_7644f46b-ad82-472c-8d97-609d1a429eac | ## Reversal status ```Text JSON theme={"dark"} { "amount": "1000000.00", "cmsProfileId": 123, "currency": "USD", "event": "INTERNATIONAL_PAYMENT_REVERSAL_INITIATED", "merchant": { "merchant_id": "CF_7644f46b-ad82-472c-8d97-609d1a429eac" }, "paymentTime": "2024-02-28 16:17:48", "referenceId": 63, "remitterAccount": "9919391193", "remitterAddress": "Dummy Address", "remarks": "", "remitterBic": "", "remitterCountry": "IN", "remitterName": "Dummy Sender", "remitterRoutingCode": "TLG0123", "reversal": { "reason": "Transaction value higher than the compliant limit", "status": "INITIATED" }, "signature": "F8raBNGcGjMUvbh2t/7t/9C4zU0Snqa/iXf9XzvOq0Y=", "status": "REVERSAL_INITIATED", "updatedStatusTime": "2024-02-28 16:17:54", "utr": "IF-20240228-KT9ZFA", "vAccountId": "GB75T", "vAccountNumber": "GB75TCCL12345654108280" } ``` ### Possible events and corresponding transaction status mapping | Event name | Reversal status | Transaction status | Description | | :- | :- | :- | :- | | INTERNATIONAL\_PAYMENT\_REVERSAL\_INITIATED | INITIATED | REVERSAL\_INITIATED | Reversal for the transaction is initiated. | | INTERNATIONAL\_PAYMENT\_REVERSAL\_DONE | DONE | REVERSAL\_DONE | Reversal for the transaction is completed. The funds have been successfully returned to the sender. | ### Payload field description *** ## Settlement status Active Event needs to be subscribed: **Global Collect Settlement** ```json theme={"dark"} { "amount": "3500.00", "cmsProfileId": 23853384, "currency": "USD", "event": "INR_SETTLEMENT_INITIATED", "merchant": { "merchant_id": "CF_7644f46b-ad82-472c-8d97-609d1a429eac" }, "paymentRail": "ACH", "paymentTime": "2024-02-06 11:11:42", "referenceId": 312620, "remarks": "EMULATE GC INCOMING FUNDS", "remitterAccount": "7337377781", "remitterAddress": "Dummy Address", "remitterBic": "TLG0123", "remitterCountry": "GB", "remitterName": "Dummy Sender", "remitterRoutingCode": "TLG0123", "settlement": { "expectedSettlementDate": "2024-02-06", "fxRate": 85.12, "id": "f16581f5-344c-40e8-be4b-e63cb5714a88", "inrAmount": 16219.65, "netPartnerCommission": 2106.72, "settlementCharge": 4213.44, "settlementChargeTax": 758.42, "status": "INITIATED" }, "status": "READY_FOR_SETTLEMENT", "updatedStatusTime": "2024-02-05 18:39:42", "utr": "f185d0f5-abf5-492b-9149-d45eacfeaca7", "vAccountId": "03314", "vAccountNumber": "0331496070" } ``` The firaFileDownloadUrl field will only be included in the webhook response after it has been updated. ### Possible events and corresponding settlement status mapping | Event name | Settlement status | Description | | :- | :- | :- | | INR\_SETTLEMENT\_INITIATED | INITIATED | The settlement is initiated. | | INR\_SETTLEMENT\_APPROVED | SETTLED | The settlement is settled. | | INR\_SETTLEMENT\_REJECTED | REJECTED | The settlement is rejected. | | FIRA\_FILE\_RECEIVED | SETTLED | FIRA file received for the settlement. | ### Payload field description | Field | Description | Example | | :- | :- | :- | | amount | The foreign currency amount sent | 4.50 | | currency | Three character ISO code. View list of [supported currencies](/docs/payments/international-payments/global-collections/collection-accounts#supported-currencies). | GBP | | cmsProfileId | Merchant identifier | 123 | | event | Webhook event | INTERNATIONAL\_AMOUNT\_COLLECTED | | merchant | Object contains the merchant\_id to map the merchant created. | CF\_7644f46b-ad82-472c-8d97-609d1a429eac | | paymentTime | The time at which the payment was initiated. | 2022-12-29 13:42:54 | | referenceId | Cashfree transaction identifier | 63 | | remarks | Remarks passed by the sender. | Sample Remark | | remitterAccount | The bank account number of the person who sends the money. | 1223456789 | | remitterAddress | The address of the person who sends the money. | Dummy Address | | remitterBic | Bank identifier code for the remitter. | TRWIBEB1XXX | | remitterCountry | The country from which the money is sent. | GB | | remitterName | The name of the remitter who is sending the money. | John Doe | | remitterRoutingCode | The routing code of the remitter's bank. | TLG0123 | | status | Status of FCY (foreign currency leg) of transaction. | COMPLETED, FAILED | | updatedStatusTime | The time of the last status update. | 2022-12-29 13:50:35 | | vAccountId | Identifier of the virtual account. | 97836 | | vAccountNumber | Account number to which the payment was made. | GB38TCCL12345687997836 | | paymentRail | Payment Network used to make the payment | ACH,EFT,FPS,SEPA,SWIFT,FEDWIRE | | settlement.id | Unique reference ID for the settlement since the payment can have multiple settlements. | b84a7c4c-2ce0-48ca-9b86-2a2c9ad5a35d | | settlement.fxRate | The foreign exchange rate used for currency conversion between the transaction currency and settlement currency | 85.12 | | settlement.netPartnerCommission | The final commission amount payable to the partner after deducting all applicable fees and charge | 2106.72 | | settlement.settlementCharge | Service fees charged for facilitating the settlement | 4213.44 | | settlement.settlementChargeTax | Applicable tax amount levied on the settlement service charges | 758.42 | | settlement.inrAmount | Settlement amount in rupees (INR). | 16219.65 | | settlement.firafileDownloadUrl | Download link to FIRA file | fileDownloadUrl | | settlement.status | Current status of the settlement. | INITIATED | ## Virtual account details Active Event needs to be subscribed: **Global Collect Virtual Account** ```json Json theme={"dark"} { "cmsProfileId": 260559, "event": "VIRTUAL_ACCOUNT_DETAILS", "merchant": { "merchant_id": "CF_7644f46b-ad82-472c-8d97-609d1a429eac" }, "vAccounts": [ { "accountName": "John Doe", "accountNumber": "GB11TCCL12345638242754", "accountType": "iban", "paymentType": "priority", "bankName": "The Currency Cloud Limited", "bankAddress": "12 Steward Street, The Steward Building, London, E1 6FQ, GB", "bankCountry": "GB", "currency": "AUD", "routingCode": "TCCLGB3L", "routingCodeType": "bic_swift", "addedOn": "2023-03-28 14:43:30", "vaccountId": "GB11T" }, { "accountName": "John Doe", "accountNumber": "GB11TCCL12345638242754", "accountType": "iban", "paymentType": "priority", "bankName": "The Currency Cloud Limited", "bankAddress": "12 Steward Street, The Steward Building, London, E1 6FQ, GB", "bankCountry": "GB", "currency": "BHD", "routingCode": "TCCLGB3L", "routingCodeType": "bic_swift", "addedOn": "2023-03-28 14:43:30", "vaccountId": "GB11T" } ] } ``` ### Possible events and corresponding virtual account mapping | Event name | Virtual account status | Description | | - | - | - | | VIRTUAL\_ACCOUNTS\_ACTIVATED | ACTIVE | Virtual account is activated | | VIRTUAL\_ACCOUNTS\_CREATED | INACTIVE / ACTIVE | If all the business required details are passed in the first go, VAs are created in ACTIVE state or INACTIVE | | VIRTUAL\_ACCOUNT\_DETAILS | ACTIVE | Will contain all the details of the VA | #### Description Sometimes there is mere might be a slight delay in creating some virtual accounts during onboarding and as a result, some of them might be missing in the Get All Collection Accounts API. Hence, when these missing account details are added, this webhook is triggered with all virtual account details (including the ones that were present before). This webhook contains information for all virtual account associated with a merchant along with cmsProfileId , signature and event. ### Payload field description | Field | Description | Example | | :- | :- | :- | | cmsProfileId | Merchant identifier | 123 | | event | Webhook Event | VIRTUAL\_ACCOUNT\_DETAILS | | merchant | Object contains the merchant\_id to map the merchant created. | CF\_7644f46b-ad82-472c-8d97-609d1a429eac | | vAccounts.accountName | Account Name | John Doe | | vAccounts.accountNumber | Account Number | GB11TCCL12345638242754 | | vAccounts.accountType | Account Type | iban | | vAccounts.paymentType | Type of Payment | priority | | vAccounts.bankName | Bank Name | The Currency Cloud Limited | | vAccounts.bankAddress | Bank Address | 12 Steward Street, The Steward Building, London, E1 6FQ, GB | | vAccounts.bankCountry | Bank Country | GB | | vAccounts.currency | Currency Code | BHD | | vAccounts.routingCode | Routing Code | TCCLGB3L | | vAccounts.routingCodeType | Routing Code Type | bic\_swift | | vAccounts.addedOn | The time when this virtual account was created | 2023-03-28 14:43:30 | | vAccounts.vaccountId | Virtual Account Id | GB11T | # Purpose Codes Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/purpose-codes Reference FEMA-compliant purpose codes used with Cashfree Global Collections to declare the nature of inward remittances from overseas customers. | Purpose code | Description | | - | - | | P0103 | Advance receipts against export contracts, which will be covered later by GR/PP/SOFTEX/ SDF - other than Nepal and Bhutan | | P1004 | Legal services | | P1005 | Accounting, auditing, bookkeeping services | | P1006 | Business and management consultancy and public relations | | P1007 | Advertising, trade fair service | | P1008 | Research & Development services | | P1009 | Architectural services | | P0802 | Software consultancy / implementation (other than those covered in SOFTEX form) | | P0807 | For Export of Software covered under softex (advance payment) | | P1020 | Wholesale and retailing trade services | | P1002 | Trade related services - commission on exports / imports | | P1104 | Entertainment services | | P1099 | Other services not included elsewhere, for export of services | | P1015 | Tax consulting services | | P1016 | Market research and public opinion polling service | | P1017 | Publishing and printing services | | P1019 | Commission agent services | | P1107 | Educational services | | P1109 | Other Personal, Cultural & Recreational services | | P1701 | Receipts on account of processing of goods | | P0301 | Purchases towards travel (Includes purchases of foreign TCs, currency notes etc over the counter, by hotels, Emporiums, institutions etc. as well as amount received by TT/SWIFT transfers or debit to Non-Resident account). | | P0302 | Business travel | | P0304 | Travel for medical treatment including TC purchased by hospitals | | P0305 | Travel for education including TCs purchased by educational institutions | | P0306 | Other travel receipts | | P0801 | Hardware consultancy/implementation | | P0803 | Data base, data processing charges | | P0804 | Repair and maintenance of computer and software | | P0805 | News agency services | | P0806 | Other information services- Subscription to newspapers, periodicals, etc. | | P0808 | Telecommunication services including electronic mail services and voice mail services | | P1013 | Environmental Services | | P1014 | Engineering Services | | P1101 | Audio-visual & related service:Motion picture & video tape production, distribution & projection service | | P1103 | Radio & TV production,distribution & transmission service | | P1105 | Museums, library and archival services | | P1106 | Recreation and sporting activity services | | P1108 | Health Service provided by Indian hospitals,doctors,nurses,paramedical remotely/on-site) | # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/overview Explore the Cashfree International Payments APIs that help businesses accept and disburse cross-border transactions in multiple currencies and regions. You can use the Cashfree API in test mode, which doesn't affect your live data or interact with the banking networks. The API key you use to authenticate the request determines whether the request is live mode or test mode. For overseas businesses to collect payments from Indian customers For Indian businesses to collect payments from customers worldwide # Create Offer Source: https://www.cashfree.com/docs/api-reference/payments/latest/offers/create-offer openapi/payments/v2026-01-01.yaml post /offers Use this API to create offers with Cashfree from your backend. # Get Offer by ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/offers/get-offer-by-id openapi/payments/v2026-01-01.yaml get /offers/{offer_id} Use this API to get offer by offer_id. # Create Terminal Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/create-terminal openapi/payments/v2026-01-01.yaml post /terminal Use this API to create new terminals to use softPOS. # Create Terminal Transaction Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/create-terminal-transaction openapi/payments/v2026-01-01.yaml post /terminal/transactions Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. # Demap Soundbox VPA Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/demap-soundbox-vpa openapi/payments/v2026-01-01.yaml post /terminal/demap/soundbox Use this API to demap a device from soundbox. # Fetch Terminal QR Codes Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/fetch-terminal-qr-codes openapi/payments/v2026-01-01.yaml get /terminal/qrcodes You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. # Fetch Terminal Soundbox VPA Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/fetch-terminal-soundbox-vpa openapi/payments/v2026-01-01.yaml get /terminal/soundbox/qrcodes You can fetch all the active and mapped SoundboxVpa corresponding to given terminal id or deviceSerialNo. Provide either the device_serial_no or cf_terminal_id in the request. # Get list of terminal transactions Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/get-list-of-terminal-transactions openapi/payments/v2026-01-01.yaml post /terminal/payments Use this API to fetch a paginated list of terminal payment transactions. You can filter results by date range, terminal details, payment status, and other criteria. # Get Terminal Status using Phone Number Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/get-terminal-status-using-phone-number openapi/payments/v2026-01-01.yaml get /terminal/{terminal_phone_no} Use this API to view all details of a terminal. # Get Terminal Transaction Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/get-terminal-transaction openapi/payments/v2026-01-01.yaml get /terminal/{cf_terminal_id}/payments Use this API to get terminal transaction. # Onboard Soundbox VPA Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/onboard-soundbox-vpa openapi/payments/v2026-01-01.yaml post /terminal/soundbox Use this API to onboard a terminal Vpa to soundbox. # Offline Payments Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/softpos-webhooks Receive Cashfree Offline Payments webhooks for in-person card and UPI transactions so your servers learn about completions, failures, and refunds. Configure an endpoint to receive instant notifications when your terminal's status changes through Cashfree Offline Payments. ## Terminal status update webhook The terminal status update webhook is triggered when a terminal's status changes. The payload includes the updated terminal details and the event timestamp. ```java theme={"dark"} { "data": { "added_on": "2024-03-07 15:11:02", "cf_terminal_id": 1234, "last_updated_on": "2024-04-26 12:16:08", "terminal_id": 1233, "terminal_name": "ABC", "terminal_phone": "9696969696", "terminal_status": "PROVISIONALLY_ACTIVE", "terminal_type": "STOREFRONT", "review_remarks": "approved" }, "event_time": "2024-04-26T12:16:08+05:30", "type": "TERMINAL_STATUS_UPDATE" } ``` # Update Soundbox VPA Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/update-soundbox-vpa openapi/payments/v2026-01-01.yaml patch /terminal/{cf_terminal_id}/soundbox Use this API to update a terminal Vpa to soundbox. # Update Terminal Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/update-terminal openapi/payments/v2026-01-01.yaml patch /terminal/{cf_terminal_id} Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for "Storefront". Only account status change is possible in case of "Agent". # Update Terminal Status Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/update-terminal-status openapi/payments/v2026-01-01.yaml patch /terminal/{cf_terminal_id}/status Use this API to update the terminal status. # Upload Terminal Docs Source: https://www.cashfree.com/docs/api-reference/payments/latest/offline-payments/upload-terminal-docs openapi/payments/v2026-01-01.yaml post /terminal/{cf_terminal_id}/docs Use this API to upload the terminal documents. # Create Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/create-order openapi/payments/v2026-01-01.yaml post /orders An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. # Get Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/get-order openapi/payments/v2026-01-01.yaml get /orders/{order_id} Use this API to fetch the order that was created at Cashfree's using the `order_id`. ## When to use this API - To check the status of your order This API allows you to retrieve order data for the current and previous financial years. To access data older than this period, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) # Get Order Extended Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/get-order-extended openapi/payments/v2026-01-01.yaml get /orders/{order_id}/extended Use this API to fetch the order related data like address,cart,offers,customer details etc using the Cashfree's `order_id`. ## When to use this API - To get the extended data associated with order. This API allows you to retrieve order data for the current and previous financial years. To access data older than this period, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) # Terminate Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/terminate-order openapi/payments/v2026-01-01.yaml patch /orders/{order_id} Use this API to terminate the order that was created at Cashfree's using the `order_id`. # Update Order Extended Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/update-order-extended openapi/payments/v2026-01-01.yaml put /orders/{order_id}/extended Use this api to update the order related data like shipment details,order delivery status etc. ## When to use this API - To provide/update the shipment details or order delivery status. - Once the order is PAID. # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/overview Learn details about the 2026-01-01 version of our Payment APIs. ## Payment Gateway endpoints Use the following base URLs depending on whether you are testing or processing live payments. | Environment | Base URL | | :- | :- | | Test | `https://sandbox.cashfree.com/pg` | | Production | `https://api.cashfree.com/pg` | | Latest version | v6, 2026-01-01
The previous versions were 2025-01-01, 2023-08-01, 2021-05-21, 2022-01-01, and 2022-09-01 | ## Authentication All APIs require authentication except `POST /orders/sessions`, which does not require credentials and can be called directly from the browser. For authentication details for merchants and partners, see [API authentication](/docs/api-reference/authentication). ## Payment gateway APIs The following sections list all available APIs grouped by function. ### Orders Use these APIs to create and manage payment orders. | API | Description | | :- | :- | | [Create Order](/docs/api-reference/payments/latest/orders/create-order) | Use this API to create orders with Cashfree from your backend and get the payment link. | | [Order Pay](/docs/api-reference/payments/latest/payments/order-pay) | Use this API when you have already created the orders and want Cashfree to process the payment. | | [Preauthorization](/docs/api-reference/payments/latest/payments/preauthorisation) | Use this API to capture or void a preauthorized payment. | | [Get Order](/docs/api-reference/payments/latest/orders/get-order) | Use this API to view all details of an order. | ### Authentication Use this API to submit or resend an OTP during a payment flow. | API | Description | | :- | :- | | [Submit or Resend OTP](/docs/api-reference/payments/latest/payments/submit-or-resend-otp) | Use the submit or resend OTP API to send OTP to Cashfree. | ### Payments Use these APIs to retrieve payment details for an order. | API | Description | | :- | :- | | [Get Payments for an Order](/docs/api-reference/payments/latest/payments/get-payments-for-an-order) | Use this API to view all payment details for an order. | | [Get Payment by ID](/docs/api-reference/payments/latest/payments/get-payment-by-id) | Use this API to view payment details of an order for a payment ID. | ### Settlements Use these APIs to fetch settlement details for individual orders or across a date range. | API | Description | | :- | :- | | [Get Settlements by Order ID](/docs/api-reference/payments/latest/settlements/get-settlements-by-order-id) | Use this API to view all the settlements of a particular order. | | [Get All Settlements](/docs/api-reference/payments/latest/settlement-reconciliation/get-all-settlements) | Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. | ### Payment links Use these APIs to create, retrieve, and manage payment links. | API | Description | | :- | :- | | [Create Payment Link](/docs/api-reference/payments/latest/payment-links/create-payment-link) | Use this API to create a new payment link. The created payment link url will be available in the API response parameter link\_url. | | [Fetch Payment Link Details](/docs/api-reference/payments/latest/payment-links/fetch-payment-link-details) | Use this API to view all details and status of a payment link. | | [Get Orders for a Payment Link](/docs/api-reference/payments/latest/payment-links/get-orders-for-a-payment-link) | Use this API to view all order details for a payment link. | | [Cancel Payment Link](/docs/api-reference/payments/latest/payment-links/cancel-payment-link) | Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. | ### Token vault Use these APIs to manage saved payment instruments for a customer. | API | Description | | :- | :- | | [Fetch All Saved Instruments](/docs/api-reference/payments/latest/token-vault/fetch-all-saved-card-instrument) | Use this API to get all saved instruments for a customer ID. | | [Fetch Single Saved Instrument](/docs/api-reference/payments/latest/token-vault/fetch-specific-saved-card-instrument) | Use this API to get specific saved instrument for a customer id and instrument ID. | | [Delete Saved Instrument](/docs/api-reference/payments/latest/token-vault/delete-saved-card-instrument) | Use this API to delete a saved instrument for a customer id and instrument ID. | | [Fetch Cryptogram for Saved Instrument](/docs/api-reference/payments/latest/token-vault/fetch-cryptogram-for-a-saved-card-instrument) | Use this API to get the card network token, token expiry and cryptogram for a saved instrument using instrument ID. | ### Reconciliation Use these APIs to fetch reconciliation reports for settlements and payment gateway transactions. | API | Description | | :- | :- | | [Settlement Reconciliation](/docs/api-reference/payments/latest/settlement-reconciliation/settlement-reconciliation) | Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. | | [PG Reconciliation](/docs/api-reference/payments/latest/pg-reconciliation/pg-reconciliation) | Use this API to get the payment gateway reconciliation details with date range. | # Cancel Payment Link Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/cancel-payment-link openapi/payments/v2026-01-01.yaml post /links/{link_id}/cancel Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. # Create Payment Link Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/create-payment-link openapi/payments/v2026-01-01.yaml post /links Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. SMS notifications are sent only in the production environment. In the sandbox environment, only email notifications are sent if enabled. # Fetch Payment Link Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/fetch-payment-link-details openapi/payments/v2026-01-01.yaml get /links/{link_id} Use this API to view all details and status of a payment link. # Get Orders for a Payment Link Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/get-orders-for-a-payment-link openapi/payments/v2026-01-01.yaml get /links/{link_id}/orders Use this API to view all order details for a payment link. # Payment Link Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/webhooks Receive Cashfree Payment Link webhook events when customers pay, partially pay, cancel, or expire links, so your backend can update orders automatically. ## Webhook Schema Payment Link webhook will be triggered when your customer makes a complete or partial payment using the payment link you shared. You will also be notified via the same webhook when the payment link gets cancelled or expired. ```json theme={"dark"} { "data": { "cf_link_id": 1576977, "link_id": "payment_ps11", "link_status": "PARTIALLY_PAID", "link_currency": "INR", "link_amount": "200.12", "link_amount_paid": "55.00", "link_partial_payments": true, "link_minimum_partial_amount": "11.00", "link_purpose": "Payment for order 10", "link_created_at": "2021-08-18T07:13:41", "customer_details": { "customer_phone": "9000000000", "customer_email": "john@gmail.com", "customer_name": "John " }, "link_meta": { "notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net" }, "link_url": "https://payments-test.cashfree.com/links//U1mgll3c0e9g", "link_expiry_time": "2021-11-28T21:46:20", "link_notes": { "note_key_1": "note_value_1" }, "link_auto_reminders": true, "link_notify": { "send_sms": true, "send_email": true }, "order": { "order_amount": "22.00", "order_id": "CFPay_U1mgll3c0e9g_ehdcjjbtckf", "order_expiry_time": "2021-08-18T07:34:50", "order_hash": "Gb2gC7z0tILhGbZUIeds", "transaction_id": 1021206, "transaction_status": "SUCCESS" } }, "type": "PAYMENT_LINK_EVENT", "version": 1, "event_time": "2021-08-18T12:55:06+05:30" } ``` *** ## Payload | Field | Description | Example | | :- | :- | :- | | `cf_link_id` | Unique Identifier (generated by Cashfree) for this Link. | 1543566 | | `link_id` | Unique Identifier (provided by merchant) for the Link. Only for merchant reference. | payment\_1psw | | `link_status` | Current status of the payment link. Possible values: PAID, PARTIALLY\_PAID, EXPIRED, CANCELLED. | PARTIALLY\_PAID | | `link_currency` | Default is INR. International currencies are supported. | INR | | `link_amount` | The amount which merchant wants to collect for the order. | 500.00 | | `link_amount_paid` | The amount paid by the customer. | 250.00 | | `link_partial_payments` | Indicates if partial payments are allowed or not. Default value is false. | true | | `link_minimum_partial_amount` | The minimum amount which must be paid by customer as the first payment. | 200.00 | | `link_purpose` | A brief description for which payment must be collected. This is shown to the customer. | Payment for order 10 | | `link_created_at` | Time at which the link was created. | 2021-08-18T07:13:41 | | `customer_details` | Customer object, it contains customer details. | | | `customer_name` | Name of the customer | John | | `customer_phone` | Phone number of the customer | 9000000000 | | `customer_email` | Email ID of the customer | [john@gmail.com](mailto:john@gmail.com) | | `notify_url` | Payment notification URL | [https://payment1notify.net](https://payment1notify.net) | | `link_url` | Payment link URL | [https://website.com/payments](https://website.com/payments) | | `link_expiry_time` | The date till which the link will be valid, and then it will be expired. Default is 30 days. | 2021-11-28T21:46:20 | | `link_notes` | Link notes object where you can provide any key-value pairs for your internal reference. | | | `note_key_1` | | note\_value\_1 | | `link_auto_reminders` | Default is false. Reminders will be sent to customers based on defined settings. | true | | `link_notify` | Link notify object, used to notify customers via SMS or an email. | | | `send_sms` | Default is true. If true, Cashfree will send the link to customer via SMS. | true | | `send_email` | Default is true. If true and `customer_email` is provided, Cashfree will send the link via Email. | true | | `order` | Order object, contains the order details. Will be null for cancelled and expired link statuses. | | | `order_amount` | Order amount that the customer must pay. | 700 | | `order_id` | The order ID generated. | order\_10 | | `order_expiry_time` | The date till which the order will be valid. Default is 30 days. | 2021-08-18T07:34:50 | | `transaction_id` | Transaction ID | id45466ye | | `transaction_status` | Status of the transaction. Possible values: SUCCESS. | SUCCESS | | `type` | Type of the webhook. `PAYMENT_LINK_EVENT` | PAYMENT\_LINK\_EVENT | | `version` | The version of webhook. Build parsing logic with respect to this version. | 1 | | `event_time` | Time when this webhook was created. | 2021-08-18T12:55:06+05:30 | *** ## Signature generation The signature must be used to verify if the request has not been tampered with. To verify the signature at your end, you will need your Cashfree Payment Gateway secret key along with the payload. ```javascript theme={"dark"} // The payload here refers to the raw request sent by // Cashfree to your endpoint. No modifications need to be made to this payload. { "data": { "cf_link_id": 1576977, "link_id": "payment_ps11", "link_status": "PARTIALLY_PAID", "link_currency": "INR", "link_amount": "200.12", "link_amount_paid": "55.00", "link_partial_payments": true, "link_minimum_partial_amount": "11.00", "link_purpose": "Hello my friend how are you", "link_created_at": "2021-08-18T07:13:41", "customer_details": { "customer_phone": "9905736722", "customer_email": "customer@example.com", "customer_name": "Supal " }, "link_meta": { ... } } } ``` We send the webhook response in a form data format. # Get Payment by ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/get-payment-by-id openapi/payments/v2026-01-01.yaml get /orders/{order_id}/payments/{cf_payment_id} Use this API to view payment details of an order for a payment ID. ## Error codes The following table lists the error codes you may encounter when retrieving payment details for an order using a payment ID: | Code | Description | Type | Status | | :- | :- | :- | :- | | `order_id_invalid` | The `order_id` field contains a value in an invalid format. Provide a correctly formatted order ID and try again. Value received: `#INVALID` | `invalid_request_error` | 400 | | `order_id_missing` | The `order_id` field is required but was not included in the request. | `invalid_request_error` | 400 | | `version_missing` | The `version` field is required but was not included in the request header. | `invalid_request_error` | 400 | | `payment_id_invalid` | The `payment_id` field must be a numeric value. Value received: `INVALID` | `invalid_request_error` | 400 | | `payment_get_failed` | The `payment_id` value is out of the supported integer range and cannot be processed. Value received: `100000000000000000000000000000000000000` | `invalid_request_error` | 400 | | `payment_id_missing` | The `payment_id` field is required but was not included in the request. | `invalid_request_error` | 400 | | `payment_not_found` | No transaction was found for the specified payment ID. Verify the payment ID and try again. | `invalid_request_error` | 404 | | `order_not_found` | No order was found for the specified order reference ID. Verify the order ID and try again. | `invalid_request_error` | 404 | This API allows you to retrieve payment data for the current and previous financial years. To access data older than this period, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) # Get Payments for an Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/get-payments-for-an-order openapi/payments/v2026-01-01.yaml get /orders/{order_id}/payments Use this API to view all payment details for an order. This API allows you to retrieve payment data for the current and previous financial years. To access data older than this period, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) # Order Pay Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/order-pay openapi/payments/v2026-01-01.yaml post /orders/sessions Use this API when you have already created the order using [Create Order API](https://www.cashfree.com/docs/api-reference/payments/latest/orders/create) and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use this API for plain cards payments also, the PCI DSS flag is required, for more information fill out the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod&raise_issue=1). **S2S enablement required**: To call the Seamless Payment Creation API, make sure the required S2S flag is enabled for your account. To enable it, submit a request through the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). * **S2S card flag**: To enable card payments, share your PCI DSS compliance certificate through the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod\&raise_issue=1). * **Main S2S flag for other payment modes**: To enable seamless payments for modes other than cards, submit a GST return showing an annual turnover of more than Rs. 1 crore. After the document is verified, Cashfree enables the seamless flow. ## Client environment headers Cashfree requires information about the customer's device environment to enforce NPCI rules. You must include the following headers in your Order Pay API and [Get Eligible Payment Methods](/docs/api-reference/payments/latest/eligibility/get-eligible-payment-methods) request: | Header | Accepted values | Requirement | Description | | - | - | - | - | | `x-client-device` | `mobile`, `desktop`, `tablet` | Required | Type of device used by customer | | `x-client-os` | `android`, `ios`, `windows`, `macos`, `linux`, `others` | Required | Operating system of customer's device | | `x-client-rendering-type` | `mweb`, `webview`, `native` | Required when `x-client-device` is mobile | Rendering method used for the checkout experience | | `x-client-browser` | `safari`, `chrome`, `firefox`, `edge`, `others` | Required | Browser used by the customer | `x-client-rendering-type` is required only when `x-client-device` is set to mobile. For desktop and tablet devices, this header is optional. ## Error codes The following table lists the error codes, descriptions, and types you may encounter when initiating a payment: | Code | Description | Type | Status | | :- | :- | :- | :- | | `channel_missing` | The `channel` field is required but was not included in the request. | `invalid_request_error` | 400 | | `phone_invalid` | The `phone` field must contain a valid 10-digit Indian phone number (for example, `9090407368`). Value received: `1234567890` | `invalid_request_error` | 400 | | `phone_missing` | The `phone` field is required but was not included in the request. | `invalid_request_error` | 400 | | `provider_missing` | The `provider` field is required but was not included in the request. | `invalid_request_error` | 400 | | `version_missing` | The `version` field must be one of the following supported values: `2021-05-21`, `2022-01-01`, `2022-09-01`, `2023-08-01`, `2025-01-01`, or `2026-01-01`. | `invalid_request_error` | 400 | | `card_cvv_invalid` | The `card_cvv` field must be at least 3 characters long. Value received: `12` | `invalid_request_error` | 400 | | `card_cvv_missing` | The `card_cvv` field is required but was not included in the request. | `invalid_request_error` | 400 | | `card_invalid` | The `card` field is invalid. Provide payment details using one of the following: card details, `card_alias`, `instrument_id`, or `cryptogram`. | `invalid_request_error` | 400 | | `bank_processing_failure` | The transaction could not be created at the banking partner. Retry the request or contact support if the issue persists. | `api_error` | 502 | | `request_invalid` | Cards issued in India cannot be used for transactions where the order currency is non-INR. Value received: `AUD` | `invalid_request_error` | 400 | | `orderpay_not_found` | The specified order is no longer active and cannot be used to initiate a payment. | `invalid_request_error` | 404 | | `card_bank_name_missing` | The `card_bank_name` field is required but was not included in the request. | `invalid_request_error` | 400 | | `card_bank_name_invalid` | The `card_bank_name` field contains an unrecognised value. Accepted values are: `hdfc`, `icici`, `kotak`, `rbl`, `bob`, `axis`, `standard chartered`, `au`, `yes`, `indus`, `fed`, `hsbc`, `citi`, `sbi`, `amex`, `onecard`, or `idfc`. Value received: `INVALID$BANK` | `invalid_request_error` | 400 | | `card_expiry_yy_missing` | The `card_expiry_yy` field is required but was not included in the request. | `invalid_request_error` | 400 | | `card_expiry_yy_invalid` | The `card_expiry_yy` field must be at least 2 characters long. Value received: `0` | `invalid_request_error` | 400 | | `card_expiry_mm_missing` | The `card_expiry_mm` field is required but was not included in the request. | `invalid_request_error` | 400 | | `card_expiry_mm_invalid` | The `card_expiry_mm` field must be at least 2 characters long. Value received: `0` | `invalid_request_error` | 400 | | `card_number_invalid` | The `card_number` field contains an invalid card number. Verify the card number and try again. Value received: `INVALID` | `invalid_request_error` | 400 | | `card_number_missing` | The `card_number` field is required but was not included in the request. | `invalid_request_error` | 400 | | `card_not_found` | The card details could not be retrieved. Verify the card information and try again. | `invalid_request_error` | 404 | | `emi_tenure_missing` | The `emi_tenure` field is required but was not included in the request. | `invalid_request_error` | 400 | | `order_amount_invalid` | The order amount exceeds the maximum allowed value. The amount must be less than `1,000,000`. | `invalid_request_error` | 400 | | `netbanking_account_number_invalid` | The `netbanking_account_number` field must be at least 9 characters long. Value received: `test` | `invalid_request_error` | 400 | | `netbanking_bank_code_invalid` | The `netbanking_bank_code` field contains an invalid value. Provide a supported bank code and try again. | `invalid_request_error` | 400 | | `netbanking_ifsc_invalid` | The `netbanking_ifsc` field contains an invalid IFSC code. Verify the IFSC and try again. Value received: `INVALID` | `invalid_request_error` | 400 | | `request_failed` | The selected payment mode is not configured for this account. Enable the payment mode or contact support. | `invalid_request_error` | 400 | | `currency_invalid` | The `currency` field does not accept `INR` for this request. Use a supported non-INR currency. Value received: `INR` | `invalid_request_error` | 400 | | `currency_missing` | The `currency` field is required but was not included in the request. | `invalid_request_error` | 400 | | `risk_data.customer_ip_invalid` | The `risk_data.customer_ip` field contains an invalid IP address. Provide a valid IPv4 or IPv6 address. Value received: `1.1.1` | `invalid_request_error` | 400 | | `risk_data_ip_address_request_failed` | The IP address could not be resolved. Verify the IP address and try again. | `invalid_request_error` | 400 | | `order_token_missing` | The `order_token` field is required but was not included in the request. | `invalid_request_error` | 400 | | `payment_method_invalid` | The `payment_method` field contains an unrecognised value. Provide a valid payment method and try again. | `invalid_request_error` | 400 | | `payment_method_missing` | The `payment_method` field is required but was not included in the request. | `invalid_request_error` | 400 | | `payment_method_unsupported` | The specified payment method is not supported for this request. Use a supported payment method and try again. | `invalid_request_error` | 400 | # Order Pay Authorise Only Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/order-pay-authorise-only openapi/payments/v2026-01-01.yaml post /orders/sessions/authorize Use this API when an order has already been created and you want Cashfree to process the payment for authorisation only. To use this API, the 'AUTHORIZE_ONLY' flag must be enabled for your account. Submit [Support Form](https://merchant.cashfree.com/auth/login) to enable this feature. # Preauthorisation Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/preauthorisation openapi/payments/v2026-01-01.yaml post /orders/{order_id}/authorization Use this API to capture or void a [pre-authorised](/docs/payments/features/pre-authorisation) payment. # Submit or Resend OTP Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/submit-or-resend-otp openapi/payments/v2026-01-01.yaml post /orders/pay/authenticate/{cf_payment_id} Use this API to submit or resend OTP if you use [Native OTP](https://www.cashfree.com/docs/payments/features/native-otp) for authentication of card payments. Refer to the sample responses below: Submit OTP Success and Transaction Successful – 200 OK ```json theme={"dark"} { "action": "SUBMIT_OTP", "authenticate_status": "SUCCESS", "cf_payment_id": "3991872901", "payment_message": "payment successful" } ``` Submit OTP Success but Invalid OTP – 200 OK ```json theme={"dark"} { "action": "SUBMIT_OTP", "authenticate_status": "FAILED", "cf_payment_id": "5114916442998", "payment_message": "otp is invalid" } ``` Max OTP Submit Limit Exceeded – 400 Bad Request ```json theme={"dark"} { "message": "Exceeded retry attempts. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9", "code": "request_invalid", "type": "invalid_request_error" } ``` Transaction Already Completed – 400 Bad Request ```json theme={"dark"} { "message": "Transaction is already processed. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9", "code": "request_invalid", "type": "invalid_request_error" } ``` Invalid Request – 404 Not Found ```json theme={"dark"} { "message": "transaction not found. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9", "code": "payment_not_found", "type": "invalid_request_error" } ``` Submit OTP Success but Transaction Failed – 502 Bad Gateway ```json theme={"dark"} { "message": "transaction failed", "code": "bank_processing_failure", "type": "api_error" } ``` Submit OTP Success but Transaction Pending – 502 Bad Gateway ```json theme={"dark"} { "message": "transaction incomplete", "code": "bank_processing_failure", "type": "api_error" } ``` Resend OTP Success – 200 OK ```json theme={"dark"} { "action": "RESEND_OTP", "authenticate_status": "SUCCESS", "cf_payment_id": "5114916574918", "payment_message": "otp sent successfully" } ``` ## Error codes The following table lists the error codes you may encounter when submitting an OTP: | Code | Description | Type | Status | | :- | :- | :- | :- | | `action_missing` | The `action` field is required but was not included in the request. | `invalid_request_error` | 400 | | `cf_payment_id_missing` | The `cf_payment_id` field is required but was not included in the request. | `invalid_request_error` | 400 | # Payment Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/webhooks Subscribe to Cashfree webhooks to receive asynchronous events for payment success, failure, refunds, and dispute updates on each order attempt. Webhooks are server callbacks from Cashfree to your server. Cashfree sends webhooks for the following events for a `payment`: * Payment success webhook * Payment failed webhook * Payment user dropped webhook * Payment charges webhook ## Webhook signature The merchant will receive the Webhook signature in the Webhook Header part. Below is a sample header that merchants can expect in the Webhook request. For best practices on securing your webhook endpoints, refer to the [Webhook Security Checklist](/docs/payments/online/webhooks/security-checklist). | Header name | Header value | | - | :-: | | content-length | 1681 | | x-webhook-attempt | 1 | | content-type | application/json | | x-webhook-signature | BUl8l3gElw9rlWUg0u3diRQMDzp1RysuTvxca2J5qOk= | | x-idempotency-key | A5UkesCnpkM4gGG+RpMLQ9coTGyN56UWXPoQjfYeuII= | | x-webhook-timestamp | 1785401067911 | | x-webhook-version | 2026-01-01 | | Header name | Header value | | - | :-: | | content-length | 1099 | | x-webhook-attempt | 1 | | content-type | application/json | | x-webhook-signature | 07r5C3VMwsGYeldGOCYxe5zoHhIN1zLfa8O0U/yngHI= | | x-idempotency-key | n9rn7079wqXcse3GEDEXCYle9ajXmU0SUQY8zrUNAlc= | | x-webhook-timestamp | 1746427759733 | | x-webhook-version | 2025-01-01 | | Header name | Header value | | - | :-: | | content-length | 1002 | | x-webhook-attempt | 1 | | content-type | application/json | | x-webhook-signature | 0s9zgYXyUYrQaadF5oTYzpxzHmPBMmGDSjbAKZTleL4= | | x-webhook-timestamp | 1746426425612 | | x-webhook-version | 2023-08-01 | Ensure that the webhook payload is received in raw text format. Converting the webhook into a JSON object can lead to automatic transformation of decimal values—such as the payment\_amount—into integers. This alteration (e.g., payment\_amount: 170 instead of payment\_amount: 170.00) can cause a webhook signature mismatch.

**Correct format: payment\_amount: 170.00** ✅
**Incorrect format: payment\_amount: 170** ❌
## Payment success webhook A payment success webhook triggers when a payment completes successfully. Use this webhook to: * Update the order status * Trigger fulfilment * Send a confirmation to the customer If you have migrated from Autocollect to PG VBA, use the [2022 version VBA payment webhooks](/docs/payments/vba/webhooks) to receive payment updates for VBA transactions. ```javascript Version (2026-01-01) theme={"dark"} { "data": { "order": { "order_id": "order_1112353JRZPMsx42lOnAuXiz0vddwovDk", "order_amount": 1, "order_currency": "INR", "order_tags": { "GST": "364JPAYTM0312", "Merchant_ID": "123456", "Merchant_Note": "99month Incl GST for 12 MonthsJPAYTMTJMMO_0003" }, "order_note": "testing Terminate Order Flow" }, "payment": { "cf_payment_id": "1453995084705707520", "payment_status": "SUCCESS", "payment_amount": 1, "payment_currency": "INR", "payment_message": "Simulated response message", "payment_time": "2026-09-17T11:47:22+05:30", "bank_reference": "1453995084705707520", "auth_id": null, "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3032", "netbanking_bank_name": "Kotak Mahindra Bank" } }, "payment_group": "net_banking", "international_payment": null, "payment_surcharge": { "payment_surcharge_service_charge": 0, "payment_surcharge_service_tax": 0 } }, "customer_details": { "customer_name": "ABC co", "customer_id": "Customer_123", "customer_email": null, "customer_phone": "8971520300" }, "payment_gateway_details": { "gateway_name": "CASHFREE", "gateway_order_id": "1453994974886245888", "gateway_payment_id": "1453995084705707520", "gateway_status_code": null, "gateway_order_reference_id": null, "gateway_settlement": "CASHFREE", "gateway_reference_name": null }, "payment_offers": null, "terminal_details": null }, "event_time": "2026-09-17T11:47:29+05:30", "type": "PAYMENT_SUCCESS_WEBHOOK" } ``` ```javascript Version (2025-01-01) theme={"dark"} { "data":{ "order":{ "order_id":"order_OFR_2", "order_amount":2, "order_currency":"INR", "order_tags":null }, "payment":{ "cf_payment_id":"1453002795", "payment_status":"SUCCESS", "payment_amount":1, "payment_currency":"INR", "payment_message":"00::Transaction success", "payment_time":"2025-01-15T12:20:29+05:30", "bank_reference":"234928698581", "auth_id":null, "payment_method":{ "upi":{ "channel":"collect", "upi_id":"rishab@ybl", "upi_instrument":"UPI_CREDIT_CARD", "upi_instrument_number":"masked card number", "upi_payer_ifsc":"SBI0025434", "upi_payer_account_number":"XXXXX0231" } }, "payment_group":"upi", "international_payment":{ "international":false }, "payment_surcharge":{ "payment_surcharge_service_charge":0.36, "payment_surcharge_service_tax":0.06 } }, "customer_details":{ "customer_name":null, "customer_id":"7112AAA812234", "customer_email":"test@gmail.com", "customer_phone":"9908734801" }, "payment_gateway_details":{ "gateway_name":"CASHFREE", "gateway_order_id":"1634766330", "gateway_payment_id":"1504280029", "gateway_order_reference_id":"abc_124", "gateway_settlement":"CASHFREE", "gateway_status_code":null }, "payment_offers":[ { "offer_id":"0f05e1d0-fbf8-4c9c-a1f0-814c7b2abdba", "offer_type":"DISCOUNT", "offer_meta":{ "offer_title":"50% off on UPI", "offer_description":"50% off for testing", "offer_code":"UPI50", "offer_start_time":"2022-11-09T06:23:25.972Z", "offer_end_time":"2025-02-27T18:30:00Z" }, "offer_redemption":{ "redemption_status":"SUCCESS", "discount_amount":1, "cashback_amount":0 } } ], "terminal_details":{ "cf_terminal_id":17269, "terminal_phone":"8971520311" } }, "event_time":"2025-01-15T11:16:10+05:30", "type":"PAYMENT_SUCCESS_WEBHOOK" } ``` ```javascript Version (2023-08-01) theme={"dark"} { "data":{ "order":{ "order_id":"order_OFR_2", "order_amount":2, "order_currency":"INR", "order_tags":null }, "payment":{ "cf_payment_id":"1453002795", "payment_status":"SUCCESS", "payment_amount":1, "payment_currency":"INR", "payment_message":"00::Transaction success", "payment_time":"2022-12-15T12:20:29+05:30", "bank_reference":"234928698581", "auth_id":null, "payment_method":{ "upi":{ "channel":"collect", "upi_id":"suhasg6@ybl", } }, "payment_group":"upi" }, "customer_details":{ "customer_name":null, "customer_id":"7112AAA812234", "customer_email":"test@gmail.com", "customer_phone":"9908734801" }, "payment_gateway_details":{ "gateway_name":"CASHFREE", "gateway_order_id":"1634766330", "gateway_payment_id":"1504280029", "gateway_order_reference_id":"abc_124", "gateway_settlement":"CASHFREE", "gateway_status_code":null }, "payment_offers":[ { "offer_id":"0f05e1d0-fbf8-4c9c-a1f0-814c7b2abdba", "offer_type":"DISCOUNT", "offer_meta":{ "offer_title":"50% off on UPI", "offer_description":"50% off for testing", "offer_code":"UPI50", "offer_start_time":"2022-11-09T06:23:25.972Z", "offer_end_time":"2023-02-27T18:30:00Z" }, "offer_redemption":{ "redemption_status":"SUCCESS", "discount_amount":1, "cashback_amount":0 } } ] }, "event_time":"2023-08-01T11:16:10+05:30", "type":"PAYMENT_SUCCESS_WEBHOOK" } ``` ## Payment failed webhook The payment failed webhook notifies you when a payment attempt fails, and we receive a failed response from the bank. Use case: Update order status, notify customer, initiate retry flow ```javascript Version 2026-01-01 theme={"dark"} { "data": { "order": { "order_id": "CFPay_g47u3888d0k0_tblfm766qc", "order_amount": 1.8, "order_currency": "INR", "order_tags": { "cf_link_id": "13746255", "link_id": "7f0efd36-23f3-4213-95dc-3c32ba1a27e2" }, "order_note": "Sample Order Note" }, "payment": { "cf_payment_id": "1504280029", "payment_status": "FAILED", "payment_amount": 1.8, "payment_currency": "INR", "payment_message": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00.", "payment_time": "2023-01-06T20:00:11+05:30", "bank_reference": "NA", "auth_id": "null", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3054", "netbanking_bank_name": "UCO Bank" } }, "payment_group": "net_banking", "international_payment":{ "international":false }, "payment_surcharge":{ "payment_surcharge_service_charge":0, "payment_surcharge_service_tax":0 } }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "test@gmail.com", "customer_phone": "9611199227" }, "error_details": { "error_code": "GATEWAY_ERROR", "error_description": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00. for this bank", "error_reason": "invalid_amount", "error_source": "cashfree", "error_code_raw": null, "error_description_raw": null, "error_subcode_raw": "U09" }, "payment_gateway_details": { "gateway_name": "CASHFREE", "gateway_order_id": "1634766330", "gateway_payment_id": "1504280029", "gateway_settlement": "CASHFREE", "gateway_order_reference_id": null, "gateway_reference_name": null, "gateway_status_code": null }, "payment_offers": null, "terminal_details":{ "cf_terminal_id":17269, "terminal_phone":"8971520311" } }, "event_time": "2023-08-01T20:00:12+05:30", "type": "PAYMENT_FAILED_WEBHOOK" } ``` ```javascript Version 2025-01-01 theme={"dark"} { "data": { "order": { "order_id": "CFPay_g47u3888d0k0_tblfm766qc", "order_amount": 1.8, "order_currency": "INR", "order_tags": { "cf_link_id": "13746255", "link_id": "7f0efd36-23f3-4213-95dc-3c32ba1a27e2" } }, "payment": { "cf_payment_id": "1504280029", "payment_status": "FAILED", "payment_amount": 1.8, "payment_currency": "INR", "payment_message": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00.", "payment_time": "2023-01-06T20:00:11+05:30", "bank_reference": "NA", "auth_id": "null", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3054", "netbanking_bank_name": "UCO Bank" } }, "payment_group": "net_banking", "international_payment":{ "international":false }, "payment_surcharge":{ "payment_surcharge_service_charge":0, "payment_surcharge_service_tax":0 } }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "test@gmail.com", "customer_phone": "9611199227" }, "error_details": { "error_code": "GATEWAY_ERROR", "error_description": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00. for this bank", "error_reason": "invalid_amount", "error_source": "cashfree", "error_code_raw": null, "error_description_raw": null, "error_subcode_raw": "U09" }, "payment_gateway_details": { "gateway_name": "CASHFREE", "gateway_order_id": "1634766330", "gateway_payment_id": "1504280029", "gateway_settlement": "CASHFREE", "gateway_order_reference_id": null, "gateway_reference_name": null, "gateway_status_code": null }, "payment_offers": null, "terminal_details":{ "cf_terminal_id":17269, "terminal_phone":"8971520311" } }, "event_time": "2023-08-01T20:00:12+05:30", "type": "PAYMENT_FAILED_WEBHOOK" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "order": { "order_id": "CFPay_g47u3888d0k0_tblfm766qc", "order_amount": 1.8, "order_currency": "INR", "order_tags": { "cf_link_id": "13746255" } }, "payment": { "cf_payment_id": "1504280029", "payment_status": "FAILED", "payment_amount": 1.8, "payment_currency": "INR", "payment_message": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00.", "payment_time": "2023-01-06T20:00:11+05:30", "bank_reference": "NA", "auth_id": "null", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3054", "netbanking_bank_name": "UCO Bank" } }, "payment_group": "net_banking" }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "test@gmail.com", "customer_phone": "9611199227" }, "error_details": { "error_code": "GATEWAY_ERROR", "error_description": "AMOUNT SHOULD BE WITHIN RANGE BETWEEN 20.00 TO 500000.00. for this bank", "error_reason": "invalid_amount", "error_source": "cashfree", "error_subcode_raw": "U09" }, "payment_gateway_details": { "gateway_name": "CASHFREE", "gateway_order_id": "1634766330", "gateway_payment_id": "1504280029", "gateway_settlement": "CASHFREE", "gateway_status_code": null }, "payment_offers": null }, "event_time": "2023-08-01T20:00:12+05:30", "type": "PAYMENT_FAILED_WEBHOOK" } ``` ## Payment user dropped webhook The User Dropped Webhook notifies you when your customer abandons the payment flow. It will help you understand if customers attempted to pay or not. Some common scenarios where the transaction will be marked as USER\_DROPPED are: * User was redirected to the bank's OTP page, but never entered the OTP. * User was redirected to open the UPI app, but never entered the UPI PIN. * User was shown the 3ds OTP modal, but did not enter the OTP. ```javascript Version 2026-01-01 theme={"dark"} { "data": { "order": { "order_id": "order_02", "order_amount": 2, "order_currency": "INR", "order_tags": null, "order_note": "Sample Order Note" }, "payment": { "cf_payment_id": "975672265", "payment_status": "USER_DROPPED", "payment_amount": 2, "payment_currency": "INR", "payment_message": "User dropped and did not complete the two factor authentication", "payment_time": "2022-05-25T14:25:34+05:30", "bank_reference": "1803592531", "auth_id": "2980", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3044", "netbanking_bank_name": "State Bank Of India" } }, "payment_group": "net_banking", "international_payment":{ "international":false }, "payment_surcharge":{ "payment_surcharge_service_charge":0, "payment_surcharge_service_tax":0 } }, "customer_details": { "customer_name": null, "customer_id": "7112AAA812234", "customer_email": "test@gmail.com", "customer_phone": "9611199227" }, "terminal_details":{ "cf_terminal_id":17269, "terminal_phone":"8971520311" } }, "event_time": "2022-05-25T14:35:38+05:30", "type": "PAYMENT_USER_DROPPED_WEBHOOK" } ``` ```javascript Version 2025-01-01 theme={"dark"} { "data": { "order": { "order_id": "order_02", "order_amount": 2, "order_currency": "INR", "order_tags": null }, "payment": { "cf_payment_id": "975672265", "payment_status": "USER_DROPPED", "payment_amount": 2, "payment_currency": "INR", "payment_message": "User dropped and did not complete the two factor authentication", "payment_time": "2022-05-25T14:25:34+05:30", "bank_reference": "1803592531", "auth_id": "2980", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3044", "netbanking_bank_name": "State Bank Of India" } }, "payment_group": "net_banking", "international_payment":{ "international":false }, "payment_surcharge":{ "payment_surcharge_service_charge":0, "payment_surcharge_service_tax":0 } }, "customer_details": { "customer_name": null, "customer_id": "7112AAA812234", "customer_email": "test@gmail.com", "customer_phone": "9611199227" }, "terminal_details":{ "cf_terminal_id":17269, "terminal_phone":"8971520311" } }, "event_time": "2022-05-25T14:35:38+05:30", "type": "PAYMENT_USER_DROPPED_WEBHOOK" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "order": { "order_id": "order_02", "order_amount": 2, "order_currency": "INR", "order_tags": null }, "payment": { "cf_payment_id": "975672265", "payment_status": "USER_DROPPED", "payment_amount": 2, "payment_currency": "INR", "payment_message": "User dropped and did not complete the two factor authentication", "payment_time": "2022-05-25T14:25:34+05:30", "bank_reference": "1803592531", "auth_id": "2980", "payment_method": { "netbanking": { "channel": null, "netbanking_bank_code": "3044", "netbanking_bank_name": "State Bank Of India" } }, "payment_group": "net_banking" }, "customer_details": { "customer_name": null, "customer_id": "7112AAA812234", "customer_email": "test@gmail.com", "customer_phone": "9611199227" } }, "event_time": "2022-05-25T14:35:38+05:30", "type": "PAYMENT_USER_DROPPED_WEBHOOK" } ``` ## Payment charges webhook A payment charges webhook is triggered after a successful payment when Cashfree finalises the Transaction Discount Rate (TDR) and related charges for that payment. The event time can be later than the payment time. Use this webhook to reconcile per-payment charges and the net settlement amount. To receive this event, subscribe to **Success Payment TDR** when you [configure webhooks](/docs/payments/online/webhooks/configure) in the Merchant Dashboard. The webhook `type` in the payload is `PAYMENT_CHARGES_WEBHOOK`. The `payment_method` object in this webhook can be empty (`{}`). This is expected for the payment charges event. For background on TDR, see [What is TDR?](/docs/help/account/pricing#what-is-tdr). ### `charges_details` fields | Field | Description | Example | | - | - | - | | `service_charge` | Service charge (TDR) applicable for the payment. | `0.12` | | `service_tax` | Service tax applicable on the service charge. | `0.02` | | `settlement_amount` | Net amount for the payment after deducting the service charge and service tax. | `5.86` | | `settlement_currency` | Currency of the settlement amount. | `INR` | | `service_charge_discount` | Discount applied on the service charge, if any. Returns `null` when no discount applies. | `null` | ```javascript Version 2026-01-01 theme={"dark"} { "data": { "order": { "order_id": "14508_73_1783668483731", "order_amount": 6.00, "order_currency": "INR", "order_tags": null }, "payment": { "cf_payment_id": 5979305158, "payment_status": "SUCCESS", "payment_amount": 6.00, "payment_currency": "INR", "payment_message": "SUCCESS", "payment_time": "2026-07-10T12:58:04+05:30", "bank_reference": "841754751916", "auth_id": null, "payment_method": {}, "payment_group": "sbc_upi" }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "rfeef@gmail.com", "customer_phone": "9876543211" }, "charges_details": { "service_charge": 0.12, "service_tax": 0.02, "settlement_amount": 5.86, "settlement_currency": "INR", "service_charge_discount": null } }, "event_time": "2026-07-15T08:00:05+05:30", "type": "PAYMENT_CHARGES_WEBHOOK" } ``` ```javascript Version 2025-01-01 theme={"dark"} { "data": { "order": { "order_id": "14508_73_1783668483731", "order_amount": 6.00, "order_currency": "INR", "order_tags": null }, "payment": { "cf_payment_id": 5979305158, "payment_status": "SUCCESS", "payment_amount": 6.00, "payment_currency": "INR", "payment_message": "SUCCESS", "payment_time": "2026-07-10T12:58:04+05:30", "bank_reference": "841754751916", "auth_id": null, "payment_method": {}, "payment_group": "sbc_upi" }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "rfeef@gmail.com", "customer_phone": "9876543211" }, "charges_details": { "service_charge": 0.12, "service_tax": 0.02, "settlement_amount": 5.86, "settlement_currency": "INR", "service_charge_discount": null } }, "event_time": "2026-07-15T08:00:05+05:30", "type": "PAYMENT_CHARGES_WEBHOOK" } ``` ```javascript Version 2023-08-01 theme={"dark"} { "data": { "order": { "order_id": "14508_73_1783668483731", "order_amount": 6.00, "order_currency": "INR", "order_tags": null }, "payment": { "cf_payment_id": 5979305158, "payment_status": "SUCCESS", "payment_amount": 6.00, "payment_currency": "INR", "payment_message": "SUCCESS", "payment_time": "2026-07-10T12:58:04+05:30", "bank_reference": "841754751916", "auth_id": null, "payment_method": {}, "payment_group": "sbc_upi" }, "customer_details": { "customer_name": null, "customer_id": null, "customer_email": "rfeef@gmail.com", "customer_phone": "9876543211" }, "charges_details": { "service_charge": 0.12, "service_tax": 0.02, "settlement_amount": 5.86, "settlement_currency": "INR", "service_charge_discount": null } }, "event_time": "2026-07-15T08:00:05+05:30", "type": "PAYMENT_CHARGES_WEBHOOK" } ``` ## Sample payload by payment method The instrument used for making a payment will vary by the payment methods used by the customer. Details of the payload by payment method are documented for reference. ```javascript theme={"dark"} { ..., "payment_method": { "card": { "channel": "link", "card_number": "XXXXXXXXXXXX4738", "card_network": "visa", "card_type": "credit_card", "card_sub_type": "R", "card_country": "IN", "card_bank_name": "HDFC Bank", "card_network_reference_id": "100212023061200000001014824849", "instrument_id":"8e9cc167-4fe2-4ece-be8d-c1b224e50a23", "par": "V0010014623022637739353641436" } }, "payment_group": "credit_card", ... } ``` ```javascript theme={"dark"} { ..., "payment_method": { "netbanking": { "channel":null, "netbanking_bank_code":"3022", "netbanking_bank_name":"ICICI Bank" } }, "payment_group":"net_banking", ... } ``` ```javascript theme={"dark"} { ..., "payment_method": { "upi": { "channel": "collect", "upi_id": "rishabtated@ybl", "upi_instrument" : "UPI_CREDIT_CARD", "upi_instrument_number" : "masked card number", "upi_payer_ifsc" : "SBI0025434", "upi_payer_account_number" : "XXXXX0231" } }, "payment_group":"upi", ... } ``` ```javascript theme={"dark"} { ..., "payment_method": { "app": { "channel":"AmazonPay", "upi_id":null, "provider": "AmazonPay" } }, "payment_group":"wallet", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "card":{ "channel":null, "card_number":"XXXXXXXXXX8952", "card_network":null, "card_type":"credit_card_emi", "card_country":null, "card_bank_name":"HDFC BANK", "emi_details":{ "emi_amount":1167, "emi_tenure":3, "emi_interest":16.00 }, "card_network_reference_id":null } }, "payment_group":"credit_card_emi", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "card":{ "channel":null, "card_number":"XXXXXXXXXX8952", "card_network":null, "card_type":"debit_card_emi", "card_country":null, "card_bank_name":"HDFC BANK", "emi_details":{ "emi_amount":1167, "emi_tenure":3, "emi_interest":16.00 } } }, "payment_group":"debit_card_emi", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "cardless_emi":{ "channel":null, "provider":"flexmoney", "phone":"9731117102", "emi_details":null } }, "payment_group":"cardless_emi", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "pay_later":{ "channel":null, "provider":"olapostpaid", "phone":"9731117102" } }, "payment_group":"pay_later", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "vba_transfer":{ "utr":"MerchantID_utr", "credit_ref_no":"NA", "remitter_account":"808081pxqp242614HW", "remitter_name":"Test", "remitter_ifsc":"IFSC", "email":"rishabtated@gmail.com", "phone":"9999999999", "vaccount_id":"123499", "vaccount_number":"94260000123400" } }, "payment_group":"vba_transfer", ... } ``` ```javascript theme={"dark"} { ..., "payment_method":{ "bank_transfer":{ "transfer_type":"NEFT", "bank":"UNION BANK OF INDIA" } }, "payment_group":"bank_transfer", ... } ``` ## Webhook FAQs You can configure webhook URLs for each notification type in your merchant dashboard. To receive notifications, subscribe to specific events, such as PAYMENT\_SUCCESS or PAYMENT\_FAILED. For step-by-step instructions, go through the [official documentation](/docs/payments/online/webhooks/overview).