MuleSoft Accelerator for Salesforce B2C Commerce Cloud icon

MuleSoft Accelerator for Salesforce B2C Commerce Cloud

(2 reviews)

Use case 2 - Inventory


The following use case is covered:

  • Inventory (B2C Commerce <- SAP)

On a scheduled basis (which is configurable), this use case shows you how to build the inventory list and push it into B2C Commerce.

High-level architecture



Here is how it works:

  1. A scheduled event (which is configurable) is triggered in the Inventory process API for more information.
  2. Through the SAP system API, the inventory process API queries the inventory list and checks if it was created or updated since the last run from SAP.
  3. For each of the returned inventory items, data is then sent into the production environment of B2C Commerce.

Sequence diagram


Systems involved:

  • ERP System: Contains information about inventory and specific plant locations. SAP is accessed via the ERP system API.
  • B2C Commerce: Mule publishes inventory information into B2C Commerce in the store inventory list.

Setup instructions

SAP configuration

Follow the Custom BAPI setup instructions.

Mule projects

Follow the readme instructions of the following Mule application projects to set up and deploy the projects into Anypoint Platform for this use case.

Configurable Properties in the YAML file

jobs.**properties for the "Jobs" object store. This OS stores the timestamp watermark for each unique job e.g. "inventory".
inventory.**properties for the inventory job/schedule.

Configurable Properties in the YAML file

sap.ivmaxrowsnumber of rows returned from the SAP BAPI function execution.
sap.bapiHow inventory records are fetched from the specific BAPI function in SAP

Configurable Properties in the YAML file

aggregator.sizenumber of inventory records that Mule should send to B2C Commerce in a single request. B2C Commerce constrains this to a maximum of 50.
Sap-plantmap the sap plant Id's from SAP to Inventory list configured in B2C Commerce.
inv-listconfigure the reverse mapping of inventory list to SAP plant Id.


  1. Perform goods movement in SAP.
  2. Create new Inventory Lists in B2C Commerce.
  3. Map the sap-plant to inv-list inside "Inventory Process API" properties.
  4. Run the "Inventory Process API".
  5. Schedules-> Inventory -> Run Now
  6. Check that the B2C Commerce Inventory lists created in step 2 are filled with the new material stock.

B2C Commerce components & configurations:

SAP components & configurations

BAPI exposing the inventory information

Data elements

Element NameData TypeDescription
allocationDecimalThe allocation quantity and reset date.
atsDecimalThe quantity of items available to sell (ATS). This is calculated as the allocation plus the preorderBackorderAllocation minus the turnover.
creation_dateDateReturns the value of attribute 'creationDate'.
inventory_list_idStringThe user supplied ID of the inventory list.
product_idStringThe user supplied ID of the product.
product_nameStringThe name of the product.
stock_levelDecimalThe current stock level. This is calculated as the allocation minus the turnover.


Published by
MuleSoft Solutions
Published onJun 29, 2021
Asset overview

Asset versions for 1.5.x

Asset versions


Industry Vertical
RetailNo values left to add
SalesforceSAPServiceNowNo values left to add
B2C Commerce CloudService CloudNo values left to add