Docs
STEP 1

How Checkout+ SDK works

Checkout+ SDK is an SDK for adding Checkout+ to your Shopify store's pages. It shows the Checkout+ banner on the cart page and, if the shopper checks the box, adds the Checkout+ product to the cart right before they proceed to checkout. This guide is for the developers who handle the integration, and explains the integration steps and the SDK specification.

Start by reviewing how it works on this page, then go to the page for the integration that matches how your Shopify store is built. For headless Shopify stores, see STEP 2 and STEP 3 (integration steps and reference). Terms are collected in the Glossary on this page.

The shared core and the integration-specific part

Checkout+ consists of a "shared core" that is the same for every Shopify store and an "integration-specific part" that changes with how the Shopify store is built.

Diagram with Japanese labels. At the bottom is the shared core (fetching the benefit set and calculating the price, showing the banner, the choice of whether to add the Checkout+ product, and the check before proceeding to checkout). Above it are the integration-specific parts (for Shopify themes, for headless Shopify, and for other cart systems)

PartWhat it doesVaries by Shopify store
Shared coreFetches the benefit set (the commitment charge and benefits for each range) and calculates the price. Shows the banner. Receives the shopper's selection (whether to add the Checkout+ product). Before the shopper proceeds to checkout, adds the Checkout+ product as selected and verifies itNo
Integration-specific partReads and writes your Shopify store's cart. Inserts the banner into your Shopify store's pages. Connects the checkout button to the shared coreYes, it changes with how the Shopify store is built

The integration-specific part connects the shared core to your Shopify store's cart and pages in a way that matches how your Shopify store is built. In a headless Shopify store, the SDK user's code handles this connection. Reading and writing the cart goes through a CartConnector implemented by the SDK user. Available settings may differ by integration. For settings, see the page for each integration.

Choosing an integration

The integration depends on how your Shopify store is built.

If neither applies, talk to your Recustomer contact.

Flow and responsibilities

In every integration, Checkout+ works in the following order. The only difference is who handles reading and writing the cart and connecting to the pages.

StageWhat happensRuns it in Shopify theme storesRuns it in headless Shopify storesWhat the SDK user's code does in headless stores
1. Load the benefit setLoad the benefit set configured by RecustomerApp embedSDKPasses the Checkout+ metafield through CartConnector
2. Calculate the priceDetermine the range from the cart amount (or the quantity, depending on the benefit set) and calculate the priceApp embedSDKLets the SDK read the cart through CartConnector
3. Show it in the bannerShow the banner in the cartApp embedSDKPasses where to place the banner
4. The shopper choosesThe shopper chooses whether to add the Checkout+ product (checks or unchecks the box in the banner)App embedSDK—
5. Check before proceeding to checkoutAdd the Checkout+ product to the cart according to the shopper's selection and verify itApp embedSDKCalls the SDK from the checkout button. Lets the SDK write to the cart through CartConnector
6. Recorded in the orderThe order includes the Checkout+ productShopify checkoutShopify checkout—

What the SDK does in each situation is in 1-1. SDK states and transitions.

Even in a headless Shopify store, the SDK does not receive a Storefront API token. All it receives about the cart is what your CartConnector returns (the cart's currency, its lines, and so on), which excludes the cart's secret part (everything from ?key= in the cart ID). How to check that each step worked, and the notifications you receive on failure, are covered in Shopify (headless): Integration steps.

Checkout+ at checkout

Neither the SDK user's code nor the app embed or SDK can be inserted into Shopify checkout. That's why Checkout+ adds the Checkout+ product to the cart before the shopper proceeds to checkout (stage 5 in the table above). At checkout, it appears as a line like any other product and stays in the order as is. What happens when the shopper comes back from checkout with Back is in 1-1. SDK states and transitions.

Shopify Plus stores can also place the Checkout+ block (Checkout UI Extensions) in checkout. Its settings are in Adding Checkout+ to the checkout page, and how it works inside checkout is in How it works on the checkout page.

The SDK cannot offer Checkout+ to shoppers who go to checkout without the cart, such as with "Buy it now" on a product page. In Shopify Plus stores, the Checkout+ block can offer it to these shoppers as well. To find out whether the Checkout+ block can be used in a headless Shopify store, contact Recustomer.

Glossary

Terms shared by every integration

TermMeaning
Checkout+ productA product that Recustomer creates in your Shopify store. The SDK adds it to the cart when the shopper checks the box. It has a variant for each range, and its handle starts with rcmr-checkout-plus-. Don't show it in the cart line list. In the Shopify admin and at checkout, it appears under the Checkout+ display name
Checkout+ display nameThe name of the Checkout+ product shown in the Shopify admin and at checkout: 「あんしんプラス」 (Anshin Plus). The banner title (displaySettings.title) is set separately
StoreThe unit in which Checkout+ is used in Recustomer. Each store has its own store ID and Checkout+ settings (such as the benefit set). The shop on Shopify itself is called a "Shopify store"
SDK userThe merchant, or its development company, that integrates the SDK. It builds the screens of a headless Shopify store and calls the SDK from code that runs on the screens (the SDK user's code). If it has a server, that server is called the SDK user's server. In chapters 2 to 4 (the integration steps, the reference, and the sample code), the SDK user's code is called your code. People who shop in the Shopify store are called shoppers
Store ID (storeId)An ID (UUID) that Recustomer issues for each store; one value identifies one store. You pass it to init
Benefit setYour store's settings that bundle the Checkout+ commitment charge and benefits (such as free return shipping and coupon cashback) for each range. It reaches the SDK in the Checkout+ metafield, and the SDK calculates the price (How the benefit set reaches the SDK). A benefit set has one currency, currently Japanese yen only
Checkout+ metafieldThe metafield on the Shopify store's shop that holds the benefit set and the exclusion tags. Recustomer writes its value
RangeA segment of the benefit set for each range of order amounts (cart amounts) or product quantities. Which one is used depends on the benefit set. Both the amount and the quantity are counted without excluded products. Each range sets the commitment charge and the Checkout+ product variant
Commitment charge, price, and merchant-borne amountThe commitment charge is the amount of the Checkout+ product before any discount, set for each range. The merchant-borne amount is the part of the commitment charge that the merchant bears as a discount. The rest, which the shopper pays, is the price of the Checkout+ product (hereafter, the price). The banner shows the price. Whether the commitment charge and the price include tax follows the tax settings of the Shopify store
Initial state (initialSelection)The state of the banner checkbox when the page loads. The default is unchecked (false). Stores Recustomer has allowed can make it checked (true) (initialSelection: Initial state of the checkbox)
Excluded products (exclusion tags)Products that Checkout+ does not cover. Products with any of the tags specified in the Checkout+ policy (exclusion tags) are excluded. The exclusion tags reach the SDK in the same Checkout+ metafield as the benefit set. If the cart contains excluded products, the banner shows a notice. For carts with only excluded products, the banner is not shown
Coupon cashback (estimated amount)A benefit for orders with Checkout+: shoppers who don't return or exchange get a coupon some time after the order. The amount is either based on the purchase or a fixed amount. Which one is set in the Checkout+ policy. The banner shows an estimate, and Recustomer calculates the final amount after the order. The SDK's 「クーポンバック」 badge also refers to this benefit. It corresponds to "cashback credit" in the Checkout+ guide
  • Recustomer sets the commitment charges in the benefit set according to your contract. The benefits and exclusion tags are set in the Checkout+ policy in the Recustomer admin dashboard.

Terms for headless Shopify stores

TermMeaning
BannerThe Checkout+ checkbox and price area shown on the cart page or in the cart drawer. It corresponds to the theme app embed's "card" in the Checkout+ guide
Details dialogThe screen that opens when the shopper presses 「詳しく見る」 (See details) on the banner. It corresponds to the theme app embed's "modal" in the Checkout+ guide
Checkout buttonThe button that takes the shopper from the cart page or cart drawer to checkout. Does not include buttons that go to checkout without the cart, such as "Buy it now" on a product page
Sample codeThe code in this guide. It includes examples that connect to the SDK, examples that connect to your checkout, and the TypeScript type definitions (see the table on the Sample code page)
CheckoutPlusSessionThe object that init() returns. Keep exactly one running CheckoutPlusSession per page at all times
CartConnectorA pair of two functions (getCart and updateCheckoutPlusLines) that the SDK uses to fetch and update the cart. Implement them with the SDK user's cart logic and pass them to cart in init (Step 2: Implement CartConnector)
When the previous screen is shown as isWhen the shopper comes back from checkout with Back and the browser shows the previous screen from its cache without reloading the page. How this differs from a page reload is in ⑩ and ⑫ of What the SDK does for each trigger
© Recustomer, Inc.