Integration
To integrate 1-Click Onboarding:- Log in to the Merchant Dashboard and create a 1-Click Onboarding template.
-
Follow the workflow below:
- Verify user data using the Data Availability API to check user data availability using a mobile number. This step is mandatory.
-
Initiate OAuth by calling the Initiate OAuth API with the mobile number to obtain a
session_idfor opening the SDK. -
Collect user consent by opening the SDK using the
session_id. Once the user provides consent, a callback returns anauth_code. - Generate an access token using the auth_code with the OAuth Access Token Generation API to get a token valid for one hour.
- Retrieve user details using the access token with the Fetch User Details API to access user details.

Initializing SDKs
The SDK communicates with Cashfree and provides updates via the callbacks. Initialize the applicable SDK from the options below:Web
To initiate the web SDK, pass thesessionId and callback functions. Refer to the JavaScript example below:
Importing hosted JS SDK
Include the following SDK in your HTML document for the production environment:Note: To use the test environment, set
mode="sandbox" in the CF1ClickOnboarding SDK. This is the default mode. To use the production environment, set mode="production".Android native
To set up the Android native SDK:- Add the Maven repository to
settings.gradle.kts: - Add SDK dependency in
build.gradle.kts: - Click Sync Now in Android Studio to sync the project.
- Create an instance of the verification service:
- Configure the callback to handle verification responses, errors, and user drop scenarios:
- Initiate the 1-Click Onboarding SDK:
- sessionId: Unique session identifier.
- Environment: SDK environment. Possible values are:
Environment.TESTEnvironment.PROD
iOS native
To set up the iOS native SDK:- Add the SDK to your project by updating your
Podfile: - Run
pod installto install the SDK.
- Create an instance of the
CFVerificationServiceclass: - Set up callback handlers to manage events after verification processing. Implement the
CF1ClickOnboardingResponseDelegateprotocol to handle responses and errors: - Initiate the 1-Click Onboarding SDK using the following code:
- sessionId: A unique identifier for the session.
- environment: Specifies the environment in which the SDK operates. Possible values are:
Environment.TESTEnvironment.PROD
Callback structure
Refer to the sample response below:| Status | Description |
|---|---|
| SESSION_EXPIRED | The session ID is invalid. |
| SESSION_ID_MISSING | No session ID is provided during initialization. |
| DIV_MISSING | The <div> with ID cf-sdk is missing. |
| SUCCESS | The operation is completed successfully. |
| CLOSED | The SDK closes. |
Notes:
-
Ensure the
<div>with IDcf-sdkexists in your HTML. - The SDK applies default styling for consistent behaviour; custom styling is not supported.
- The iframe uses sandboxing for secure interactions.