Detect enables you to identify a user’s online merchant accounts and retrieve them from the Knot platform, allowing you to then personalize your user experience.
If you’ve already integrated another of Knot’s products, rather than implementing any of the below, simply provide a user’s email & phone # when calling Session Create to take advantage of Detect.
Email
SSO
1
Access your dashboard
Ensure you have access to the Knot Dashboard and retrieve your client_id and secret to create an API key. Learn more about creating an API key and authentication to the API here.
2
Call the API
Call Detect Accounts with the user’s email and phone_number to detect their online merchant accounts.
3
Handle webhook events
Subscribe to webhooks in the Knot Dashboard so your backend can be notified about server-side events. Listen for the NEW_DETECTED_ACCOUNTS_AVAILABLE webhook event to be notified when new detected accounts have been found for a given user.
4
Sync detected accounts
When you receive the NEW_DETECTED_ACCOUNTS_AVAILABLE webhook, call Sync Detected Accounts to retrieve the detected accounts.In the development environment, this endpoint returns 6 mock detected accounts generated for a given user.
Ensure you have access to the Knot Dashboard and retrieve your client_id and secret to create an API key. Learn more about creating an API key and authentication to the API here.
Retrieve available merchants
Call List Merchants to retrieve a list of merchants that are available for merchant account detection by passing type = detect in the request. These are merchants you can allow users to link in your app and subsequently detect merchant accounts.You will be notified via the MERCHANT_STATUS_UPDATE webhook when/if the available merchant list changes, even if temporarily.
Create a session
With your API key for the development environment, call Create Session with type: link to create a session used when invoking the SDK. More here on how to create an API key.
Install the SDK
Install an SDK of your choosing, for example on iOS here and android here.
Initialize the SDK
Initialize the SDK with the session_id retrieved from Create Session and a merchant Id retrieved from List Merchants in KnotConfiguration or you can use merchant_id: 60for Apple to get started quickly. The SDK is where users will interact with the Knot UI to authenticate to various merchants. All login flows, including step-up authentication, are handled within the SDK. Users will see real-time feedback as they progress through authenticating with a merchant.
In the development environment, login to a merchant account using user_good / pass_good credentials to link your user’s merchant account.
Handle webhook events
Subscribe to webhooks in the Knot Dashboard so your backend can be notified about user-generated, server-side events. Listen for the following events:
AUTHENTICATED: fired when the authentication to a merchant is successful and the merchant account is therefore successfully linked to Knot. Similarly and as applicable, listen to the client-side onEvent callback in the SDK to receive the authenticated event.
When you receive the NEW_DETECTED_ACCOUNTS_AVAILABLE webhook, call Search Detected Accounts with a list of merchant or company names that are relevant to your use case. The endpoint will return whether a detected merchant account was found for the user at each one. This is useful when you have a specific set of merchants or companies you care about and want to know if a user has an account at any of them.In the development environment, this endpoint accepts any list of names you provide and returns detected: true for 6 of them at random.
When you receive the NEW_DETECTED_ACCOUNTS_AVAILABLE webhook, call Sync Detected Accounts to retrieve and save the merchants where a user has an account to your own system. This returns only merchants that Knot supports on its platform (i.e. those with a merchant_id), making it useful for engaging or re-engaging users to provision a payment method to the merchant wallet.In the development environment, this endpoint returns 6 mock detected accounts generated for a given user.