# Configure the main checkout flow

To configure the main checkout flow:

1. Click **Setup** ![](/files/gdWiI90IBsNQrB7jE9u2).
2. Type `Flows` in the **Quick Find** field and click **Flows**.\
   ![](/files/Tz5hQH4WDZg2sDEw1y1P)
3. Click **Checkout Flow Template**. The Flow Builder opens in a separate tab.\
   ![](/files/QKU8CH5wN7WdTVEYsYX4)
4. Create the subflow element for all the custom subflows (for example, the [DR Shipping Address](/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-shipping-address-subflow.md), [DR Payment and Billing Address](/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-payment-and-billing-address-subflow.md), [DR Checkout Summary](/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-checkout-summary-subflow.md), and [DR Delivery Method](/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-delivery-method-subflow.md)) created in the previous steps.
   1. Drag the **Subflow** element from the left panel to the right panel.
   2. Type the custom subflow name (for example, `DR Shipping Address`) in the **Reference Flow** field and click the item (for example, **DR Payment and Billing Address**) in the search results.
   3. Type the name of the subflow in the **Label** field (for example, **DR Payment and Billing Address**).\
      ![](/files/wu0OHTx37NO6fpNeWIwI)
   4. Type the appropriate value listed in the [subflow settings table](#subflow-settings) for the custom subflow in each field. The following example shows the settings for the DR Payment and Billing Address subflow.\
      ![](/files/Te9hX6qgTLf7E1Jk2fhx)
   5. Under **Set Input Values**, toggle **cartId**, **currentState**, **nextState**, **orderId** (if applicable) to **Inlude**. Toggle **Saved\_Tax\_Identifier** (if applicable) to **Don't include**.\
      ![](/files/ry52PYx1YHsZ6fUmVkdQ)
5. Replace the OOTB flows with custom flows.
   * **Shipping Address**: DR Shipping Address
   * **Delivery Method**: DR Delivery Method
   * **Checkout Summary**: DR Checkout Summary
   * **Payment and Billing Address**: DR Payment and Billing Address\
     ![](/files/pduMz7OnueDX4KHv4aQf)
6. Click **Save As** and enter a name for the main checkout flow.\
   ![](/files/Z5LZ9yzWK7jHsz0JdyRB)
7. Click **Save**, then click **Activate**.

## Subflow settings

| Subflow                        | Settings                                                                                                                                                                                                                                                                       |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DR Shipping Address            | <p><strong>Cart Id</strong>: <code>{!cartId}</code><br><strong>Current state</strong>: {<code>!mainCheckoutSession.State}</code><br><strong>Next state</strong>: Inventory</p>                                                                                                 |
| DR Delivery Method             | <p><strong>Cart Id</strong>: <code>{!cartId}</code><br><strong><code>Current</code> state</strong>: {!<code>mainCheckoutSession.State}</code><br><strong>Next state</strong>: Taxes</p>                                                                                        |
| DR Checkout Summary            | <p><strong>Cart Id</strong>: <code>{!cartId}</code><br><strong>Current state</strong>: {!<code>mainCheckoutSession.State}</code><br><strong>Next state</strong>: Cart To Order<br><strong>Saved\_Tax\_Identifier</strong>: {!Saved\_Tax\_Identifier}</p>                       |
| DR Payment and Billing Address | <p><strong>Cart Id</strong>: <code>{!cartId}</code><br><strong>Current state</strong>: {!<code>mainCheckoutSession.State}</code><br><strong>Next state</strong>: Activate Order<br><strong>Order Id</strong>: <code>{!mainCheckout</code><br><code>Session.OrderId}</code></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/configure-the-main-checkout-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
