Skip to main content
Avalara Help Center

Establish a connection between Salesforce B2B Commerce Lightning and AvaTax

After you install the integration software, connect Salesforce B2B Commerce Lightning to AvaTax. 

Before you begin

Steps

  1. Create the connection between AvaTax and your store.
    1. In Salesforce B2B Commerce Lightning, select Setup and then select Setup for Current App.
      The Setup page opens.
    2. Under Home, search for and select Installed Packages.
      The Installed Packages page opens.
    3.  Select Configure next to the AvaTax for Salesforce B2B Commerce Lightning package.
      The AvaTax for Salesforce B2B Commerce Lightning configuration console opens.
    4. On the Administrator Settings tab:
      1. Enter your account number and license key.
      2. Choose whether to connect to an AvaTax production or sandbox environment.
      3. Enable address validation.
      4. Select Test Connection to confirm all information entered is correct.
    5. On the Corporate Address tab, enter the default origin address for AvaTax to use for transactions, select Save, and then select Validate Address.
    6. On the Store Settings tab, select the store you want to set up to use AvaTax and then:
      1. Make sure Tax Calculation is enabled.
      2. From Customer Code, select which value on customer records in Salesforce B2B Commerce Lightning is sent to AvaTax as the customer code.
      3. From Company Code, select which company you created in Avalara corresponds to the store you're setting up.
      4. If this store has a different origin address than the corporate address, enter a store address. 
        AvaTax uses this address as the origin address for this store instead of using the corporate address you entered.
      5. Select Save Store settings, and then select Save.
      6. If you're setting up multiple stores, repeat the steps on the Store Settings tab for each.
  2. Give permissions to users to make configuration changes.
    1. In Salesforce B2B Commerce Lightning, select Setup and then select Setup for Current App.
      The Setup page opens.
    2. Under Home, search for Users and select Permission Sets under Users.
      The Permission Sets page opens.
    3. Select Avalara AvaTax Users and then select Manage Assignments.
    4. Select Add Assignments and then select users who should have permissions to create flows using AvaTax.
    5. Select Assign and then select Done.
  3. Create the subflow Salesforce B2B Commerce Lightning uses to call AvaTax.
    1. In Salesforce B2B Commerce Lightning, select Setup and then select Setup for Current App.
      The Setup page opens.
    2. Under Home, search for Flows and select Flows under Process Automation.
      The Flows page opens.
    3. Select Subflow – Checkout Summary.
      The flow opens in a new tab.
    4. Double-click Cart to Order Summary.
      The Edit Screen page opens for the Cart to Order Summary screen.
    5. From the Screen Components list, under Custom, drag both Tax Breakup and VAT/Invoice Message onto the page.
    6. For each of the components you just added, select and:
      1. Enter an API name. We recommend something like AvaTaxTaxBreakup and AvaTaxVATInvoice.
      2. Enter a header that will be clear to you. We recommend something like Tax Breakup and Invoice Messaging.
      3. Select cartID as the record ID for both.
    7. Select Finish and then select Done.
    8. On the page for the flow page, select Save As to create a new flow instead of overwriting the original flow.
    9. Enter a unique flow label. We recommend something like Ava Clone Subflow Checkout Summary.
    10. Select Flow API Name.
      The flow API name automatically populates with a name based on the flow label you entered.
    11. Select Show Advanced and then, for How to Run the Flow, select System Context with Sharing—Enforces Record-Level Access.
    12. Select Save and then select Activate. This flow is now available to use.
      Refresh the Flows page to see it on the list of flows.
  4. Create the checkout flow that uses the subflow you created.
    1. In Salesforce B2B Commerce Lightning, select Setup and then select Setup for Current App.
      The Setup page opens.
    2. Under Home, search for Flows and select Flows under Process Automation.
      The Flows page opens.
    3. Select Checkout Flow Template.
      The flow opens in a new tab.
    4. Double-click Subflow Checkout Summary and copy the values that display in cartId, currentState, and nextState.
    5. Select Cancel and then delete Subflow Checkout Summary.
    6. On the Elements tab, under Interaction, drag Subflow onto the page.
      The New Subflow window opens.
    7. In Reference Flow, begin typing the name of the subflow you created and then select it from the results that display.
    8. Enter a label and then select API Name.
      The API name automatically populates with a name based on the label you entered.
    9. Set the three fields under Set Input Values to Include, enter the value in each that you copied from the subflow you deleted, and then select Done.
    10. Drag the subflow to where the deleted subflow was.
    11. Drag a connector from Decision Main Decision Hub to the subflow.
    12. From the Outcome list that displays, select Checkout Summary and then select Done.
    13. Drag a connector from the subflow to Assignment Loop.
    14. Select Save As to create a new flow instead of overwriting the original flow.
    15. Enter a unique flow label. We recommend something like Ava Clone Checkout Flow.
    16. Select Flow API Name.
      The flow API name automatically populates with a name based on the label you entered.
    17. Select Save.
  5. Set up a store to use the checkout flow you created.
    1. In Salesforce B2B Commerce Lightning, go to the Stores page.
    2. Select the store to which you’re adding AvaTax capabilities. The store opens.
    3. Select Experience Builder. It opens in a new tab.
    4. Select the down arrow next to Home and then select Checkout.
    5. Select the checkout flow, which displays as a paragraph above Proceed to Checkout.
      The Checkout Flow window opens.
    6. From Checkout Flow Name, select the checkout flow you created, close the Checkout Flow window, and then select Publish.
    7. Close the Experience Builder tab.
  6. Make sure the store is using AvaTax for tax calculation.
    1. On the Store tab for the store, select Administration.
      The Administration page opens.
    2. On the Store Integrations tab, make sure that AvaTaxCalculator is selected for Tax Calculation. If not:
      1. If something else has been selected, select the down arrow next to Tax Calculation and then select Unlink. The selection is cleared.
      2. Select Link Integration and then select the plus sign next to AvaTaxCalculator.
      3. Select Next and then select Confirm.
  • Was this article helpful?