---
schema_version: "1"
id: b33d572f1b224044eaebc285db9438e0b076bbfb0686d77b91a8f31fcd4c4835
title: Configure Checkout to Support Subscriptions for B2B Stores
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/comm_subscriptions_checkout.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.comm_subscriptions_checkout.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 580864d4aea0561a433bbfa950b74982d49d7469d398a992494b1816b96a8659
description: To support subscriptions, your B2B store must use Custom Checkout with Salesforce Payments as your payment provider. You can customize the Salesforce native shipping service with an Apex extension to support subscriptions. Or, you can use a third-party shipping provider. After you configure checkout, you can sell subscription products in your store.
products:
  - Commerce
  - B2B Commerce
release: "264"
---
# Configure Checkout to Support Subscriptions for B2B Stores

To support subscriptions, your B2B store must use Custom Checkout with Salesforce Payments as your payment provider. You can customize the Salesforce native shipping service with an Apex extension to support subscriptions. Or, you can use a third-party shipping provider. After you configure checkout, you can sell subscription products in your store.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong> and <strong>Developer</strong> editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: B2B Commerce</td></tr></tbody></table>

[Which Salesforce Commerce Product Do I Have?](https://help.salesforce.com/s/articleView?id=commerce.comm_what_product.htm&language=en_US)

Before you begin,

- Confirm that your store is using Custom Checkout. If there's a label at the top of the page that ready Managed Checkout, scroll to the bottom of the page, click **Use Custom Checkout**, and follow the prompts.
- [Select Salesforce tax solution and set up a tax provider for custom checkout](https://help.salesforce.com/s/articleView?id=commerce.comm_set_up_salesforcetaxsoln.htm&language=en_US).
- Set up Salesforce Payments. See [Set Up Payments with the Commerce Setup Assistant](https://help.salesforce.com/s/articleView?id=commerce.payments_setup_intro.htm&language=en_US).
- Configure the supported ship-to-countries for your store. If you don't configure at least one supported ship-to-country, address validation fails. See [Configure Store Language, Currency, and Tax](https://help.salesforce.com/s/articleView?id=commerce.comm_create_international_store.htm&language=en_US).
- Make sure that your store is associated with a legal entity.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/images/icon_note.png)

Note

Starting in Spring ’24, the Cart Calculate API is enabled by default for LWR stores (`OptionsCartCalculateEnabled` is set to true). The Cart Calculate API must be enabled to sell subscription products. See [Cart Calculate API](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/cart-calculate-api.html).

Watch the video to help you sync pricing and configure checkout to support subscriptions for your store.

If you can’t watch the video in full screen, open the video on a new tab: [Sync Pricing and Configure Checkout](https://play.vidyard.com/q8HACNo7KxuYv6ho5YUbTv).

To configure checkout to support subscriptions,

1. In the navigation sidebar, select a store from the Store dropdown.
2. Click **Settings** | **Checkout**.
3. In the Payments tab, configure Salesforce Payments as your payment provider.
    1. On the Payments tab, click the dropdown menu on the Salesforce Payments tile and select **Open App**. If you don't see a Salesforce Payments tile, contact your Salesforce account executive.
    2. On the Payments Merchant Accounts page, click **Add Account**, and follow the prompts to set up a merchant account. See [Set Up a Merchant Account for Custom Checkout](https://help.salesforce.com/s/articleView?id=commerce.payments_add_merch_acct.htm&language=en_US).
    3. Save your changes and return to your store's checkout settings.
4. In the Taxes tab, update the values of the Tax Policy ID and the Merchant Account fields.
5. Set up Salesforce native shipping.
    
    Salesforce’s native shipping service supports subscriptions with a custom Apex extension. If you prefer to use a third-party shipping service, see [Add a Third-Party Shipping Service for Custom Checkout](https://help.salesforce.com/s/articleView?id=commerce.comm_set_up_shipping.htm&language=en_US).
    
    1. At the top of the page, click ![Settings icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/comm_setup_icon_no_border.png) and select **Setup**.
    2. From Debug, click **Open Execute Anonymous Window**. An Apex Code editor opens.
    3. Copy this code snippet into the Apex editor window.
        
        `ID webStoreId = '0ZE000000000000000'; // !!! please replace !!!  // 1. Set up the default shipping profile (ShippingConfigurationSet entity object) ShippingConfigurationSet[] shippingConfigs = new List<ShippingConfigurationSet>();  ShippingConfigurationSet shippingProfile = new ShippingConfigurationSet(Name='General', TargetRecordId=webStoreId, IsDefault=true); shippingConfigs.add(shippingProfile); insert shippingConfigs;   // 2. Set up rate group (ShippingRateGroup entity) ShippingRateGroup[] shippingRateGroups = new List<ShippingRateGroup>();  ShippingRateGroup shipRateGroup1 = new ShippingRateGroup(Name='Shipping rate group 1', ShippingProfileId=shippingProfile.Id); shippingRateGroups.add(shipRateGroup1); insert shippingRateGroups;   // 3. Set up a shipping zone (ShippingRateArea entity) ShippingRateArea[] shippingRateArea = new List<ShippingRateArea>();  ShippingRateArea shipRateArea1 = new ShippingRateArea(Name='Shipping rate area US', ShippingRateGroupId = shipRateGroup1.Id, Countries='US'); shippingRateArea.add(shipRateArea1); insert shippingRateArea;  // 4. Set up three simple shipping rates (StandardShippingRate entity)  StandardShippingRate[] standardShippingRates = new List<StandardShippingRate>();  StandardShippingRate shipRate1 = new StandardShippingRate(Name='Free Shipping 7-10 Days', ShippingZoneId = shipRateArea1.Id, Price=0.0);  StandardShippingRate shipRate2 = new StandardShippingRate(Name='Overnight Shipping', ShippingZoneId = shipRateArea1.Id, Price=12.0);  StandardShippingRate shipRate3 = new StandardShippingRate(Name='Express Shipping 2-3 Days', ShippingZoneId = shipRateArea1.Id, ConditionFactor='OrderPriceFactor', ConditionRangeMin=0.0, ConditionRangeMax=100.0, Price=5.0);   standardShippingRates.add(shipRate1); standardShippingRates.add(shipRate2); standardShippingRates.add(shipRate3);  insert standardShippingRates;`
    4. Replace the store ID with your 18-character ID.
        
        You can find your ID in your store’s home page URL. It begins with “webStoreId=”.
    5. Execute the code.
6. Extend the Salesforce native shipping service to support subscriptions.
    1. Copy the sample shipping calculator code from [ShippingCartCalculatorSample](https://github.com/forcedotcom/commerce-extensibility/blob/main/commerce/domain/shipping/cart/calculator/classes/ShippingCartCalculatorSample.cls).
    2. At the top of the page, click ![Settings icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/comm_setup_icon_no_border.png) and select **Setup**.
    3. In Quick Find, find and select **Apex Classes**.
    4. Click **New**.
    5. Paste the code sample into the Apex editor window.
    6. Save your changes and return to the Commerce app.
7. Select the customized shipping extension as your provider.
    1. In the navigation sidebar, click **Settings** | **Checkout**.
    2. On the Shipping tab, click **Select Provider** on the Shipping–Cart & Checkout Calculator tile.
    3. Select **SHIPPING\_EXTENSION**.
    4. Click **Next**, and confirm your changes.
8. Create shipping profiles and rates to calculate shipping charges on order.
    1. In the navigation sidebar, click **Settings** | **Checkout**.
    2. Go to **Shipping**.
    3. Under Providers, click **Add New Profile**.
    4. Add shipping zones and shipping rates to the profile, and click **Done**.

After you’ve configured your payment, tax, and shipping services, confirm that your store’s checkout page is set up to collect payment correctly using Salesforce Payments. See [Customize the Payment Section of Checkout in a Commerce Store](https://help.salesforce.com/s/articleView?id=commerce.comm_checkout_customize_payments.htm&language=en_US). Also, customize your store’s product and profile pages so that shoppers can browse and manage subscription products. See [Configure Subscription Shopping in a Commerce Store](https://help.salesforce.com/s/articleView?id=commerce.comm_subscriptions_configure_shopper_experience.htm&language=en_US).

Optionally, assign a tax policy to individual products in your store. See [Assign a Tax Policy to a Product](https://help.salesforce.com/s/articleView?id=commerce.comm_tax_assigntaxpolicytoproduct.htm&language=en_US).

#### See Also

- [Configure Checkout for a Commerce Store](https://help.salesforce.com/s/articleView?id=commerce.comm_checkout_container.htm&language=en_US)
- [Custom Checkout for a Commerce Store](https://help.salesforce.com/s/articleView?id=commerce.comm_custom_checkout.htm&language=en_US)