> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/salesforce-lightning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-api-1.0.1/introduction/how-it-works.md).

# How it works

Use the Salesforce Lightning app to enable Digital River to be the merchant of record for storefronts hosted on the Salesforce platform.

* Salesforce Lightning B2B Commerce maintains all pricing and product data.
* 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.
* Digital River automatically syncs with the Product (Product2) in Salesforce Lightning with minimal information needed to calculate taxes and enable the merchant of record functions.
* Digital River maintains a copy of the cart (WebCart), the customer, and the order.
* The fulfiller must update the status of the order from `accepted` to `fulfilled` or `canceled` in Salesforce. The Digital River app sends the updated order status to Digital River, who will settle the funds.

### Digital River checkout flow

{% file src="/files/T9PMEHqHlM4hL2phtOPr" %}
Checkout flow diagram
{% endfile %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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-api-1.0.1/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.
