# Authentication Source: https://www.cashfree.com/docs/api-reference/authentication Authentication Cashfree Payments APIs Almosst 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`. Please pass your `appId` and `secretKey` in these fields. * Please ensure that your secret key is securely placed and cannot be accessed by anyone. * 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, API keys will be auto-generated. In the production environment, click **Generate API Keys** and complete the 2FA authentication to generate the keys. 3. Once generated, the API keys are shown 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. 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.\ The 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](/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 Common integration errors and solutions Integration errors can occur due to incorrect configurations, missing features, or environment mismatches. This guide outlines the most common issues across Cashfree Payments 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 Common integration errors and solutions for Payments posthog.capture('Accordion Clicked', { title: "Authentication failed" })}> 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. To troubleshoot this issue, follow these steps: * Use test credentials in the test environment and production credentials in the live environment. * Pass the Client ID and Client Secret as headers, not in the request body. posthog.capture('Accordion Clicked', { title: 'S2S_enabled_not_approved” or “POST/orders/pay is not enabled or approved' })}> 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. posthog.capture('Accordion Clicked', { title: "Payment mode not enabled for merchant" })}> 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). posthog.capture('Accordion Clicked', { title: "Unable to delink existing AmazonPay wallet and add a new one" })}> 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. posthog.capture('Accordion Clicked', { title: "Null objects in Get Order / Payment API response" })}> 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. posthog.capture('Accordion Clicked', { title: "Order Amount Invalid" })}> If you're encountering this issue, please consider below cases. * More than two decimal places have been provided for the 'order\_amount' field. Eg: 10.123 * Order Amount is 0 or negative. * You have exceeded the maximum amount limit set for your MID. To troubleshoot this issue, follow these steps: * Please configure order\_amount with only two decimal places maximum. * 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) posthog.capture('Accordion Clicked', { title: "UPI Intent not visible on checkout" })}> 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) # Payouts Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/payouts-ts Common integration errors and solutions for Payouts posthog.capture('Accordion Clicked', { title: "IP not whitelisted" })}> 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](https://www.cashfree.com/docs/api-reference/payouts/getting-started-with-payouts-apis#whitelist-your-ip-address) to whitelist your IP address. posthog.capture('Accordion Clicked', { title: "520 Unknown Error Occurred" })}> 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 Common integration errors and solutions for SDKs ### Mobile SDKs posthog.capture('Accordion Clicked', { title: "Integration errors due to outdated SDK versions." })}> To troubleshoot this issue, follow this step: * Always use the latest SDK versions. Check the [Changelog](https://www.cashfree.com/docs/payments/developers/changelog/android) for updates. posthog.capture('Accordion Clicked', { title: 'Error: "NOT_AVAILABLE isn\'t a trusted source, app should be installed from play store or another whitelisted app"' })}> 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. To troubleshoot this issue, follow these steps: The guidelines provided here to test app in [production environments](https://www.cashfree.com/docs/payments/online/mobile/misc/cashfree_integrity_prod_testing). posthog.capture('Accordion Clicked', { title: "NDK version mismatch error with flutter_cashfree_pg_sdk" })}> 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. posthog.capture('Accordion Clicked', { title: "Gradle build error: Could not resolve com.cashfree.pg:api..." })}> 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" }` posthog.capture('Accordion Clicked', { title: "How to initialise payment using cashfree_pg_sdk" })}> 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). posthog.capture('Accordion Clicked', { title: "Why don’t UPI apps launch in test mode?" })}> 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. posthog.capture('Accordion Clicked', { title: "SDK shows strange or inconsistent errors" })}> To troubleshoot this issue, follow these steps: * Run:\ `flutter clean`\ `flutter pub get` * If issues persist, delete the following directories:\ `.gradle/`\ `.idea/` ### Server-Side SDKs posthog.capture('Accordion Clicked', { title: "Access the sample integration kits from the below list" })}> 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 Common integration errors and solutions for Secure ID posthog.capture('Accordion Clicked', { title: "Empty or invalid name at bank" })}> 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. posthog.capture('Accordion Clicked', { title: "Invalid account" })}> Bank account details are invalid across all partner banks. This is a limitation on the bank’s end. posthog.capture('Accordion Clicked', { title: "Account blocked" })}> 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. posthog.capture('Accordion Clicked', { title: "UTR not generated" })}> 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. posthog.capture('Accordion Clicked', { title: "Bank Account Validation (BAV) Fraud" })}> 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. posthog.capture('Accordion Clicked', { title: "Blocked by CORS policy" })}> 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. # Webhooks Troubleshooting Source: https://www.cashfree.com/docs/api-reference/integration-troubleshooting/webhooks-ts Common integration errors and solutions for Webhooks posthog.capture('Accordion Clicked', { title: 'Error: "Unable to proceed. Please retry after some time"' })}> 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. posthog.capture('Accordion Clicked', { title: "Signature verification mismatch" })}> 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](https://www.cashfree.com/docs/payments/online/webhooks/overview#webhook-signature-verification) for the sample code. posthog.capture('Accordion Clicked', { title: "Webhooks not received" })}> 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](https://www.cashfree.com/docs/api-reference/payments/latest/payments/get-payments-for-order) to check the payment status. posthog.capture('Accordion Clicked', { title: "VALIDATION_FAILED" })}> 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. # APIs to Implement Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/apis-to-implement ## Biller APIs: Overview In order to join the BBPS network, the biller is required to furnish 2 core APIs that fulfill essential functions. The 2 APIs to implement are as follows: * **Bill Fetch**: This API is invoked when the end user tries to fetch bill on the App ( Phonepay/Gpay/Paytm etc). This would be a GET API based on the structure defined below. * **Payment Posting**: This API is invoked when the end customer completes payment for a bill on the App .The Biller has to respond with "acceptance" or "rejection" of the payment made by the end user. This would be a POST API based on the structure defined below. ℹ️ Once the biller provides the API contracts and URL for both test and production environment, Cashfree team would integrate the APIs within 2 working days provided they have been developed as per recommended standard. *** ## Authentication Mechanism In addition to creating these APIs, the Biller must establish an authentication framework that enables Cashfree's access to these APIs. Along with delivering the API contracts, the Biller is required to inform Cashfree about the authentication protocols and furnish credentials for both testing 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 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 Apart from the legal and branding details, there are a few technical configurations that need to be set with NPCI - the same have been highlighted below. Biller has to take a decision on each of them and submit along with the APIs. 1. **\[Mandatory]** What are the set of input parameters which will be sent as customer attributes and customer will have to key them in from the payment app ? For each parameter, describe the following details: * Name of the parameter (e.g. phone\_number, loan\_number, policy\_no). * Data Type of the parameter (e.g Alphanumeric/Numeric/Date). * Any special characters allowed in the param value - if yes, which? * Minimum and Maximum length of the param value (e.g. 3 to 10 characters). 2. **\[Mandatory]** What is the amount exactness of the payment you want to receive from BBPS. Select one of the following: * ADHOC - Customer will be able to edit the amount and input any number to make the payment. * EXACT - Amount would be non-editable. * EXACT DOWN - Customer would be able to edit the amount and input a figure which is equal or Less than the amount retrieved from Bill Fetch. * EXACT UP - Customer would be able to edit the amount and input a figure which is equal or Greater than the amount retrieved from Bill Fetch. 3. **\[Optional]** Do you want to add any additional parameters in Bill Fetch Response? If yes, what are they? (This will become part of the additional\_Info object in response. 4. **\[Optional]** Do you want to always accept the payment - In this case even if your systems are down, the payment will be accepted by Cashfree and later retried to post to your system. It is recommended if you have no business logic for declining the payments. If you have business logic for decline then it is recommended to accept/reject each payment as per your logic. # Overview Source: https://www.cashfree.com/docs/api-reference/other-apis/bbps/overview This comprehensive document serves as a blueprint to empower billers in crafting their APIs, enabling seamless integration into the BBPS network. Its purpose is to provide clear and practical guidance, ensuring billers can efficiently navigate and create APIs that align perfectly with the BBPS standards, fostering a smoother and more effective network participation. This is a recommended approach from Cashfree which will result in ensuring the APIs are as per NPCI’s standard and the integration with Cashfree is seamless. By adopting this structure, businesses can significantly enhance workflow success rates and expedite the onboarding process, delivering swift and efficient results. # 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 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](/api-reference/payouts/v2/transfers-v2/standard-transfer-v2) | Use this API to initiate an amount transfer at Cashfree Payments. It is an async request by default. | | [Get Transfer Status V2](/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](/api-reference/payouts/v2/transfers-v2/batch-transfer-v2) | Use this API to initiate a batch transfer request at Cashfree Payments. You can transfer money to multiple beneficiaries. | | [Get Batch Transfer Status V2](/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 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. # API Best Practices Source: https://www.cashfree.com/docs/api-reference/payments/api-best-practices Follow these best practices when using Cashfree's API. ## Avoid polling You should subscribe to webhook events instead of polling the API for data. This will help your integration stay within the API rate limit. For more information, see [Webhooks documentation](/payments/webhooks) ## Handle rate limit errors appropriately If you receive a rate limit error, you should stop making requests temporarily according to these guidelines: * If the `x-ratelimit-retry` response header is present, you should not retry your request until after that many seconds has elapsed. * If the `x-ratelimit-remaining` header is `0`, you should not make another request until after the time specified by the `x-ratelimit-reset` header. * Otherwise, wait for at least one minute before retrying. If you need 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 [Rate limits](/api-reference/payments/rate-limits). ## Optimise your API requests with connection keep-alive To ensure optimal performance and reduce latency when interacting with our APIs, we recommend using HTTP connection keep-alive. Set the Connection: keep-alive header in your API requests. This allows a single connection to be reused for multiple requests, improving efficiency and reducing resource usage on both sides. ## Use SDKs To simplify integration, Cashfree offers SDKs in popular programming languages like. By using these SDKs, you can significantly reduce development time and effort. They provide pre-built libraries and functions to interact with the Cashfree API, handling authentication, request/response formatting, and error handling. You can find them [here](/api-reference/payments/sdk) ## Use API versioning Always use the latest version of the API to ensure that you have access to the latest features and improvements. If you are using an older version of the API, consider upgrading to the latest version to take advantage of new features and bug fixes. The payment apis follow a versioning scheme where the version is specified in `x-api-version` header. The version format is `YYYY-MM-DD`. ## Secure your API keys Keep your API keys secure and never expose them in public repositories or client-side code. Use environment variables or other secure methods to store and access your API keys. ## Avoid concurrent requests Avoid making multiple requests to the API at the same time from the same account. This can lead to rate limit errors and impact the performance of your integration. If you need to make multiple requests, consider using a queue or other method to manage the requests and ensure they are processed sequentially. ## Use request ID header Include a unique request ID in each API request header `x-request-id` to help track and troubleshoot issues. This can be useful for debugging and monitoring the performance of your integration. ## Test in sandbox environment Before deploying your integration to production, test your application in the Cashfree sandbox environment. This will help you identify and fix any issues before they impact your customers. Make sure you use the sandbox API keys. Log in to the **[Merchant Dashboard](https://merchant.cashfree.com/auth/login)** and go to **Payment Gateway > Developers > API Keys** for testing. # Enums Source: https://www.cashfree.com/docs/api-reference/payments/enums List of all enums used in Payment APIs. ## Order states | Order State | Description | | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ACTIVE | Orders are marked as **ACTIVE**, when an order is created by the merchant through an API request to Cashfree Payments. | | PAID | Orders are marked **PAID** when the payment is verified by Cashfree Payments 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](/api-reference/payments/latest/orders/terminate). Once terminated, customers can no longer pay for this order. | | TERMINATION\_REQUESTED | This status is returned after you call the [Order Termination API](/api-reference/payments/latest/orders/terminate) 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 State | Description | | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | SUCCESS | Transactions are marked as **SUCCESS** when we get a successful response from the bank, and we can capture the amount in our system. Once payment is marked as **SUCCESS**, we mark the order as **PAID**. | | FAILED | Transactions are marked as **FAILED** when we get a failed response from the bank. | | NOT\_ATTEMPTED | Transactions are marked as **NOT\_ATTEMPTED** initially when a transaction is created and an acknowledgement is awaited from the bank. | | PENDING | Transactions are marked as **PENDING** when we have successfully sent the request to the bank but waiting for a response from the bank. | | FLAGGED | Transactions are marked as **FLAGGED** if we have identified any risks associated with the transaction. | | CANCELLED | Transactions are marked as **CANCELLED** when there is success response post time to live. In this case, the amount will be reversed to the customer without any charge being levied to them or the merchant. | | VOID | Transactions are marked as **VOID** when we do not want to capture the transaction amount. This is only applicable for card-based pre-authorized transactions or to UPI one-time mandates. The amount is reversed immediately in these cases by Cashfree. | | USER\_DROPPED | Transactions are marked as **USER\_DROPPED** when customers drop out of the payment flow without completing the transaction. 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: Android UPI intent payments: When a user clicks on the back button in the UPI app without making any payment attempt. Card payments: When a user drops out of the payment flow by closing the OTP verification page. UPI collect transactions: When a user does not enter the UPI PIN and closes the transaction screen. | ## Net banking codes | 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 | N | | 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 | | Cosmos Bank | 3097 | Y | | CSB Bank Limited | 3010 | Y | | DBS Bank Ltd | 3017 | N | | DCB Bank - Personal | 3018 | N | | 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 | Y | | 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 | N | | IDFC FIRST Bank | 3024 | Y | | Indian Bank | 3026 | Y | | Indian Overseas Bank | 3027 | Y | | Indian Overseas Bank - Corporate | 3081 | N | | 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 | | 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 | N | | 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 | N | | 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 | 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 | | 7 | Test Wallet (Sandbox) | 4010 | ## EMI codes | Card Type | Type of EMI | Bank | card\_bank\_name | Minimum Amount | Maximum Amount | Annual Interest Rate | Tenure | | --------- | ----------- | ------------------ | ------------------ | -------------- | -------------- | -------------------- | ------ | | Credit | Standard | HDFC Bank | hdfc | 1000 | 500000 | 16 | 3 | | Credit | Standard | HDFC Bank | hdfc | 3000 | 500000 | 16 | 6 | | Credit | Standard | HDFC Bank | hdfc | 3000 | 500000 | 16 | 9 | | Credit | Standard | HDFC Bank | hdfc | 3000 | 500000 | 16 | 12 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 3 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 6 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 9 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 12 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 18 | | Credit | Standard | Axis Bank | axis | 2500 | 1000000 | 16 | 24 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 3 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 6 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 9 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 12 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 18 | | Credit | Standard | ICICI Bank | icici | 1500 | 500000 | 15.99 | 24 | | Credit | Standard | Kotak Bank | kotak | 1000 | 1000000 | 16 | 3 | | Credit | Standard | Kotak Bank | kotak | 2500 | 1000000 | 16 | 6 | | Credit | Standard | Kotak Bank | kotak | 2500 | 1000000 | 16 | 9 | | Credit | Standard | Kotak Bank | kotak | 2500 | 1000000 | 16 | 12 | | Credit | Standard | Kotak Bank | kotak | 2500 | 1000000 | 16 | 18 | | Credit | Standard | Kotak Bank | kotak | 2500 | 1000000 | 16 | 24 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 3 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 6 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 9 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 12 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 18 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 24 | | Credit | Standard | Bank of Baroda | bob | 2500 | 1000000 | 16 | 36 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 11.88 | 3 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 14 | 6 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 15 | 9 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 15 | 12 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 15 | 18 | | Credit | Standard | Standard Chartered | standard chartered | 2000 | 500000 | 15 | 24 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 13 | 3 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 14 | 6 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 15 | 9 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 15 | 12 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 15 | 18 | | Credit | Standard | RBL Bank | rbl | 1500 | 1000000 | 15 | 24 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 3 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 6 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 9 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 12 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 18 | | Credit | Standard | AU Small Bank | au | 2000 | 1000000 | 16 | 24 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 3 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 6 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 9 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 12 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 18 | | Credit | Standard | Yes Bank | yes | 1500 | 1000000 | 16 | 24 | | Credit | Standard | HSBC | hsbc | 2000 | 1000000 | 12.5 | 3 | | Credit | Standard | HSBC | hsbc | 2000 | 1000000 | 12.5 | 6 | | Credit | Standard | HSBC | hsbc | 2000 | 1000000 | 13.5 | 9 | | Credit | Standard | HSBC | hsbc | 2000 | 1000000 | 13.5 | 12 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 14 | 3 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 14 | 6 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 14 | 9 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 14 | 12 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 15 | 18 | | Credit | Standard | American Express | amex | 5000 | 1000000 | 15 | 24 | The following card issuer is supported for card-based EMIs. Please send the exact values in the `card_bank_name` parameter. | 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 | 500000 | 16 | 3 | | Debit | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 6 | | Debit | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 9 | | Debit | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 12 | | Debit | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 18 | | Debit | Standard | HDFC Bank | hdfc | 5000 | 500000 | 16 | 24 | | 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 | Kotak Bank | kotak | 3000 | 200000 | 19 | 3 | | Cardless | Standard | Kotak Bank | kotak | 5000 | 200000 | 19 | 6 | | Cardless | Standard | Kotak Bank | kotak | 5000 | 200000 | 19 | 9 | | Cardless | Standard | Kotak Bank | kotak | 5000 | 200000 | 19 | 12 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 17 | 3 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 17 | 6 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 17 | 9 | | Cardless | Standard | ICICI Bank | icici | 7000 | 500000 | 17 | 12 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 100000 | 24 | 3 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 100000 | 24 | 6 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 100000 | 24 | 9 | | Cardless | Standard | IDFC Bank | idfc | 5000 | 100000 | 24 | 12 | | Cardless | Standard | CASHe | cashe | 1000 | 100000 | 23.78 | 3 | | Cardless | Standard | CASHe | cashe | 6000 | 100000 | 25.28 | 6 | | Cardless | Standard | CASHe | cashe | 9000 | 100000 | 25.63 | 9 | | Cardless | Standard | CASHe | cashe | 12000 | 100000 | 25.8 | 12 | | Cardless | No Cost | ZestMoney | zestmoney | 5000 | 150000 | 0 | 3 | | Cardless | Standard | ZestMoney | zestmoney | 5000 | 150000 | 36 | 6 | | Cardless | Standard | ZestMoney | zestmoney | 5000 | 150000 | 36 | 9 | | Cardless | Standard | ZestMoney | zestmoney | 5000 | 150000 | 36 | 12 | | Provider Parameter | Name of the Provider | | :----------------- | :------------------- | | zestmoney | ZestMoney Paylater | | lazypay | Lazypay | | simpl | Simpl | | mobikwik | mobikwik | # Errors Source: https://www.cashfree.com/docs/api-reference/payments/errors Learn in detail about errors. ## 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](/api-reference/payments/latest/payments/get-payments-for-order) * [Get Payment by ID](/api-reference/payments/latest/payments/get) * [Payment Failed Webhook](/api-reference/payments/latest/payments/webhooks#payment-failed-webhook) # Authorisation 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 to authorise payment sessions using token-based authentication. # Create Customer at Cashfree Source: https://www.cashfree.com/docs/api-reference/payments/latest/customers/create openapi/payments/v2025-01-01.yaml post /customers Create Customer at Cashfree # Accept Dispute by Dispute ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/accept-dispute-by-dispute-id openapi/payments/v2025-01-01.yaml put /disputes/{dispute_id}/accept Use this API to get accept the Dispute by specifying the Dispute ID. # Dispute Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/disputes/dispute-webhooks Learn in detail about dispute webhooks. 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](/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. Click [here]() to know more about dispute reason codes. | 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\_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/v2025-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/v2025-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/v2025-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/v2025-01-01.yaml post /disputes/{dispute_id}/documents Use this API to Submit the Evidences to contest the Dispute by specifying the Dispute ID. # 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/v2025-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/v2025-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/v2025-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 Source: https://www.cashfree.com/docs/api-reference/payments/latest/eligibility/get-eligible-payment-methods openapi/payments/v2025-01-01.yaml post /eligibility/payment_methods Use this API to get eligible Payment Methods { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Capture Payments in Bulk Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/bulk-operations/capture-payments-in-bulk openapi/payments/flowwise.yaml post /payment/preauth/capture Use this API to process bulk capture operations for multiple pre-authorised payments within a specified date range. This API is useful for merchants who need to capture multiple authorised payments at once. # Get Number of Authorised Payments for Date Range Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/bulk-operations/get-the-number-of-authorised-payments-for-a-date-range openapi/payments/flowwise.yaml post /payment/preauth/count/start/{start_date_time}/end/{end_date_time} Use this API to retrieve the count of authorised payments within a specific date range. This API helps merchants understand the volume of authorised payments before processing bulk capture operations. # Create Customer Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/customers/create-a-customer openapi/payments/flowwise.yaml post /customer Use this API to create a new customer record in the Flowwise system. Customer records can be scoped to a specific project or globally, allowing for better customer management and tracking across transactions. # Delete Customer Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/customers/delete-a-customer openapi/payments/flowwise.yaml delete /customer/{customer_id} Use this API to remove a customer record from the system. Use this API to permanently delete customer information when it is no longer needed or upon customer request for data deletion. # Update Customer Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/customers/update-a-customer openapi/payments/flowwise.yaml put /customer/{customer_id} Use this API to update the details of an existing customer record. This API allows you to modify customer information such as name, contact details, and address. # Create Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/orders/create-an-order openapi/payments/flowwise.yaml post /orders Use this API to create a new order in the Flowwise system. An order represents a transaction request with a specified amount and customer details. Once created, the order returns a checkout URL and order hash that can be used to initiate payments. # Get Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/orders/get-an-order openapi/payments/flowwise.yaml get /orders/{order_id} Use this API to retrieve the details of a specific order using its unique identifier. This API returns comprehensive order information including status, amounts, customer details, and payment URLs. # Authorise Payment Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/payments/authorise-a-payment openapi/payments/flowwise.yaml post /orders/{order_id}/payments/{payment_id}/authorize Use this API to capture or void a pre-authorised payment transaction. This API allows merchants to either capture the authorised amount or void the authorisation entirely. # Create Payment Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/payments/create-a-payment openapi/payments/flowwise.yaml post /order/pay/{order_hash} Use this API to initiate a payment transaction for an existing order using the order hash. This API processes the payment using the specified payment method and returns transaction details including redirect URLs for payment completion. # Get Payment Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/payments/get-a-payment openapi/payments/flowwise.yaml get /payments/{payment_id} Use this API to retrieve detailed information about a specific payment transaction using its unique identifier. This API returns payment status, amounts, method details, and gateway information. # Get All Payments for Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/payments/get-all-payments-for-an-order openapi/payments/flowwise.yaml get /orders/{orderId}/payments Use this API to retrieve a list of all payment transactions associated with a specific order. This API returns comprehensive details for each payment attempt made for the order. # Create Refund by Order ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/refunds/create-a-refund-by-order-id openapi/payments/flowwise.yaml post /orders/{order_id}/refunds Use this API to create a refund for a specific order. This API allows merchants to process refunds for orders that may have multiple payment transactions. # Create Refund by Payment ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/refunds/create-a-refund-by-payment-id openapi/payments/flowwise.yaml post /payments/{payment_id} Use this API to create a refund for a specific payment transaction. This API allows merchants to process partial or full refunds for successful payment transactions. # Get Refund Source: https://www.cashfree.com/docs/api-reference/payments/latest/flowwise/refunds/get-a-refund openapi/payments/flowwise.yaml get /refunds/{refund_id} Use this API to retrieve detailed information about a specific refund transaction using its unique identifier. This API returns refund status, amounts, processing details, and gateway references. # Get Import Settlement Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/get-import-settlement-details 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 post /import/settlements/recon This API is used to fetch all events happened for provided Settlement IDs # null 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} # Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/collect-from-india/import-webhooks This product helps Merchants/Payment Aggregators/Market Places who are based outside India to collect payments from customers based out of India Webhooks are server callbacks to your server from Cashfree Payments. Webhooks are event-based and are sent when specific events related to the transaction happen. Click [here](/payments/online/webhooks/configure) to know how to configure webhooks. ## 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" } ```
## 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 This product helps Merchants/Payment Aggregators/Market Places who are based outside India to collect payments from customers based out of India **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](/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](/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](/api-reference/payments/latest/orders/create) | This API will create a order to collect payment | | [Order Pay](/api-reference/payments/latest/payments/pay#order-payr) | This API is used to pay the created payment | | [Get Payment by ID](/api-reference/payments/latest/payments/get#get-payment-by-id) | This API is used to view payment details of an order for a payment ID | | [Upload Payment Verification Details](/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](/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](/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](/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](/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](/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](/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 all the required payment details for the verification # End Points Source: https://www.cashfree.com/docs/api-reference/payments/latest/international-payments/global-collections/endpoints This document provides you with the Global Collection end points. ## 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 **Getting Started** To start using Global Collection APIs, You can generate your API credentials using the below steps, as applicable. *** 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](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/auth-get-token) | This API generates a new token. | | [Verify Token](/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. | | [Get Collection Accounts](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/get-collection-accounts) | This API fetches all the virtual accounts that are linked with this account. | | [Get Transactions](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/get-transactions) | Use this API to get all the transaction details within a time interval. | | [Add Transaction Details](/api-reference/payments/previous/v2023-08-01/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](/api-reference/payments/previous/v2023-08-01/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 Global Collection APIs * [Get Token](/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](/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 Global Collection APIs for partners * [Get All Transactions Details](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/get-transactions) - Use this to fetch all the transactions for a particular merchant. * [Emulate Funding](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/simulate-transaction#simulate-transaction) - Use this to emulate a transaction for a specific merchant. * [Get All Collection Accounts for Partner Merchants](/api-reference/payments/previous/v2023-08-01/international-payments/global-collections/partner/get-collection-accounts) - Use this to get all VAs for a specific merchant. * [Add Invoice Details for Partner Merchants](/api-reference/payments/previous/v2023-08-01/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](/api-reference/payments/previous/v2023-08-01/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 This chapter explains the Global Collections Webhooks. ### 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](/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](/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 Payments 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 [here](doc: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 Payments 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 This page contains the purpose codes for Global Collect | 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 Learn about Cashfree APIs suitable for International Payments 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 openapi/payments/v2025-01-01.yaml post /offers Use this API to create offers with Cashfree from your backend { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Get Offer by ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/offers/get openapi/payments/v2025-01-01.yaml get /offers/{offer_id} Use this API to get offer by offer_id { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Create Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/create openapi/payments/v2025-01-01.yaml post /orders ### Order 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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Get Order Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/get openapi/payments/v2025-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 { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. 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/v2025-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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. 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 openapi/payments/v2025-01-01.yaml patch /orders/{order_id} Use this API to terminate the order that was created at Cashfree's using the `order_id`. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Update Order Extended Source: https://www.cashfree.com/docs/api-reference/payments/latest/orders/update-order-extended openapi/payments/v2025-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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Overview Source: https://www.cashfree.com/docs/api-reference/payments/latest/overview Learn details about the 2025-01-01 version of our Payment APIs. ## Payment Gateway end points | Environment | Base URL | | :------------- | :-------------------------------------------------------------------------------------------------- | | Test | [https://sandbox.cashfree.com/pg](https://sandbox.cashfree.com/pg) | | Production | [https://api.cashfree.com/pg](https://api.cashfree.com/pg) | | Latest version | v5, 2025-01-01
The previous versions were 2023-08-01, 2021-05-21, 2022-01-01, and 2022-09-01 | ## Authentication All the APIs require authentication, except the /orders/sessions API, which does not require any authentication and can be safely done from the browser as well. Click [here](/api-reference/authentication) for detailed information on API Authentication for Merchants and Partners. ## Payment Gateway APIs ### Orders | API | Description | | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | | [Create Order](/api-reference/payments/latest/orders/create) | Use this API to create orders with Cashfree from your backend and get the payment link. | | [Order Pay](/api-reference/payments/latest/payments/pay) | Use this API when you have already created the orders and want Cashfree Payments to process the payment. | | [Preauthorization](/api-reference/payments/latest/payments/authorize) | Use this API to capture or void a preauthorized payment. | | [Get Order](/api-reference/payments/latest/orders/get) | Use this API to view all details of an order. | ### Authentication | API | Description | | :--------------------------------------------------------------------------- | :-------------------------------------------------------- | | [Submit or Resend OTP](/api-reference/payments/latest/payments/authenticate) | Use the submit or resend OTP API to send OTP to Cashfree. | ### Payments | API | Description | | :------------------------------------------------------------------------------------------ | :----------------------------------------------------------------- | | [Get Payments for an Order](/api-reference/payments/latest/payments/get-payments-for-order) | Use this API to view all payment details for an order. | | [Get Payment by ID](/api-reference/payments/latest/payments/get) | Use this API to view payment details of an order for a payment ID. | ### Settlements | API | Description | | :------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | | [Get Settlements by Order ID](/api-reference/payments/latest/operations/get-settlements-for-order) | Use this API to view all the settlements of a particular order. | | [Get All Settlements](/api-reference/payments/latest/operations/get-settlements) | Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. | ### Payment links | API | Description | | :------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | | [Create Payment Link](/api-reference/payments/latest/payment-links/create) | 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](/api-reference/payments/latest/payment-links/get) | Use this API to view all details and status of a payment link. | | [Get Orders for a Payment Link](/api-reference/payments/latest/payment-links/get-orders-for-link) | Use this API to view all order details for a payment link. | | [Cancel Payment Link](/api-reference/payments/latest/payment-links/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. | ### Token vault | API | Description | | :------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------ | | [Fetch All Saved Instruments](/api-reference/payments/latest/token-vault/get-all) | Use this API to get all saved instruments for a customer ID. | | [Fetch Single Saved Instrument](/api-reference/payments/latest/token-vault/get) | Use this API to get specific saved instrument for a customer id and instrument ID. | | [Delete Saved Instrument](/api-reference/payments/latest/token-vault/delete) | Use this API to delete a saved instrument for a customer id and instrument ID. | | [Fetch Cryptogram for Saved Instrument](/api-reference/payments/latest/token-vault/generate-cryptogram) | Use this API to get the card network token, token expiry and cryptogram for a saved instrument using instrument ID. | ### Reconciliation | API | Description | | :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | | [Settlement Reconciliation](/api-reference/payments/latest/operations/settlement-reconciliation) | Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. | | [PG Reconciliation](/api-reference/payments/latest/operations/reconcile) | 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 openapi/payments/v2025-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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Create Payment Link Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/create openapi/payments/v2025-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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Fetch Payment Link Details Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/get openapi/payments/v2025-01-01.yaml get /links/{link_id} Use this API to view all details and status of a payment link. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Get Orders for a Payment Link Source: https://www.cashfree.com/docs/api-reference/payments/latest/payment-links/get-orders-for-link openapi/payments/v2025-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 Learn about webhooks triggered when payments made through Payment Links. ## 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": "supal.dubey@cashfree.com", "customer_name": "Supal " }, "link_meta": { ... } } } ``` We send the webhook response in a form data format. # Submit or Resend OTP Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/authenticate openapi/payments/v2025-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" } ``` # Preauthorisation Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/authorize openapi/payments/v2025-01-01.yaml post /orders/{order_id}/authorization Use this API to capture or void a [pre-authorised](/docs/payments/features/pre-authorisation) payment. # Get Payment by ID Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/get openapi/payments/v2025-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. { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. 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-order openapi/payments/v2025-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) { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Order Pay Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/pay openapi/payments/v2025-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). { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.8)'; el.style.transform = 'translateY(-1px)'; }} onMouseLeave={(e) => { const el = e.currentTarget; el.style.backgroundColor = 'rgba(255, 248, 240, 0.4)'; el.style.transform = 'none'; }} > Run in Postman: You can also try this API in our Postman Collection. # Payment Webhooks Source: https://www.cashfree.com/docs/api-reference/payments/latest/payments/webhooks Read about all asynchronous events initiated by Cashfree for this entity Webhooks are server callbacks from Cashfree Payments to your server. We send webhooks for three different events for a `payment`. * Payment success webhook * Payment failed webhook * Payment user dropped 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. | 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 is triggered when a payment is successfully completed. You can use this for: Updating order status, triggering fulfilment, and sending confirmation to the customer. ```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 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" } }, "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":null }, "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, "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 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":null }, "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" } ``` ## 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 } }, "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
Configure webhooks
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](https://www.cashfree.com/docs/payments/online/webhooks/overview).