Introduction

Knot’s Shopping product enables you to embed native merchant cart creation and checkout capabilities into your app. With Shopping, users can seamlessly add products to their merchant carts and complete purchases without leaving your application.

Entry Points

Overview

How and where you place entry points to invoke the Knot flow in your app play a crucial role driving engagement and delivering value to end users. Nearly all apps that integrate Knot develop multiple entry points into the Knot flow (e.g. different tabs or screens). As a result and to provide better visibility into the conversion of the flow across different entry points, the Knot SDK supports an entryPoint parameter when invoking the SDK which allows you to specify the entry point from which the user came. This value is then returned in the down-funnel AUTHENTICATED webhook event, thereby allowing you to measure the conversion of the flow by entry point in your analytics tool of choice.

Usage

It is strongly recommended to take advantage of this functionality, so as to future-proof your visibility into your implementation and allow for future optimizations. To take advantage of this functionality, simply pass a different value to KnotConfiguration.entryPoint for each of your entry points when configuring the session to invoke the SDK. Common entry points include the following: onboarding, home, push-notif-X, in-app-lifecycle-card-X, etc.

Getting started

Start the flow

Access your customer dashboad

Subscribe to webhooks

Retrieve available merchants

Create a session

Install the SDK

Initialize the SDK

Login

Handle authenticated event

Add a product to a cart

Call Sync Cart to add a product to a cart using the product.external_id. To be notified when a product is successfully added to a cart and to receive cart information, listen to the SYNC_CART_SUCCEEDED webhook.

Update delivery address (optional)

If a user would like to update their delivery address after initially provided in Sync Cart, simply make the same request again with a new delivery_location, like you are patching the cart. You will receive fresh information regarding the cart, including the price.total.
A delivery address must be present in the user’s merchant account prior to checkout if the fulfillment is via any delivery option. Therefore, if a delivery_location is not provided in Sync Cart and/or a delivery_location is not provided back in SYNC_CART_SUCCEEDED, then you cannot proceed with Checkout.

Update fulfillment preference (optional)

If a user would like to update the fulfillment preference for a given product after the initial Sync Cart request, simply make the same request again with a value for products.fulfillment.id that you received in the SYNC_CART_SUCCEEDED webhook. You will receive fresh information regarding the cart, including the price.total.

Checkout

Call Checkout to checkout a cart. To be notified when a checkout process is successful, listen to the CHECKOUT_SUCCEEDED webhook, which will include an array of transactions by Id created by the checkout.

Get order confirmation details

When you receive the CHECKOUT_SUCCEEDED webhook, call Get Transaction By Id for each transaction you receive (using the transaction.id) to retrieve transaction information and subsequently enrich an order confirmation.

Handle disconnected merchant accounts

If for example a user changes their password to a merchant account, the connection.status in Get Merchant Accounts will be returned as disconnected and you will not be able to make any successful requests to Sync Cart or Checkout until the user’s merchant account is reconnected. If this occurs, you’ll be notified via the ACCOUNT_LOGIN_REQUIRED webhook event. You’ll want to display a UX in your app to allow users to reconnect their account. For example, you may choose to display a button that says “Reconnect” or similarly allow the user to invoke the SDK to reconnect their account.
To test this behavior in development, use the Disconnect Account endpoint.
To unlink a user’s specific merchant account if they request it, make a request to Unlink Merchant Account.