# How it works

Use the Salesforce B2B Commerce App to enable Digital River to be the merchant of record for storefronts hosted in Salesforce B2B Commerce.

1. Salesforce B2B Commerce maintains all pricing and product data.
2. Digital River maintains minimal product data used to fulfill its requirements as the merchant of record. This data is used for tax calculations, tax collection, tax payments, and payment processing
3. Digital River automatically syncs with the CC Product in Salesforce B2B Commerce with minimal information needed to calculate taxes and enable the merchant of record functions.
4. Digital River maintains a copy of the cart, customer, and order.

## Checkout flow <a href="#checkout-flow" id="checkout-flow"></a>

The following sequence diagram shows the interaction between the Shopper, Salesforce B2B Commerce, the Salesforce B2B Commerce App, and Digital River.

{% hint style="info" %}
The app currently does not support Guest checkout.
{% endhint %}

{% file src="<https://2309602074-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MNZuPvN3iGOwRD0PjQh%2F-MXldfL9NWLC0ulWx5fq%2F-MXlesSn_gZzUFc4VMeU%2Fsfb2b_checkout_flow-2.1.1.png?alt=media&token=e27f8cf0-4b33-40cb-ba4a-f1608dbd2a50>" %}

## Tax estimations

1. The app extends the global extension point `ccrz.cc_hk_TaxCalculation`.
2. The app creates a Digital River checkout object based on the Salesforce B2B Commerce cart with product information, prices, and quantity. This checkout request is serialized as JSON and posted to a Digital River web service.
3. The response contains the cart tax amount.


---

# 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-b2b/2.1.1-2/introduction/how-it-works.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.
