MuleSoft Accelerator for Retail icon

MuleSoft Accelerator for Retail

(2 reviews)

Use case 4 - Real-time inventory management

The Real-time inventory management use case enables customers to make an informed decision of their online purchase based on real-time inventory of a product in nearby stores.

Contents

See also

Description

The real-time inventory sync use case enables retail developers to retrieve the most up-to-date inventory information for a given product or list of products across relevant applications. Developers can configure in-stock inventory per location to provide faster shipping times and better service for customers.

The real-time inventory sync achieves the following goals:

  • Builds an informative user experience for both customers and employees to access more accurate inventory information
  • Reinforces headless "omnichannel" interaction by seamlessly providing inventory information across channels
  • Reduces the risk of overselling and lost revenue

Glossary

TermDefinition
CIMThe Cloud Information Model defines a set of standard data structures that can be used as canonical representations of common entities for integrating systems.
Global DataA Global Data service provides an accurate, consistent, and complete copy of business data for use by enterprise applications and business partners while also providing a means to link that copy to occurrences in other systems.
PIMThe system responsible for managing product information for sales orders.

Goals

  • Display the product’s availability on Salesforce B2C’s product description page and checkout page in real-time.
  • Display the product’s availability on Salesforce Service Cloud/Sales Cloud at the associated stores in real-time.
  • Support the creation of orders across relevant applications, inclusive of Salesforce core, SAP S/4HANA, OFBiz (OMS), and B2C Commerce Cloud.
    • Support the creation of Universal ID and ID attribution.

Use case considerations

  • Must support the change in inventory in SAP S/4HANA for the product that was ordered from B2C at a given store.
  • Safety Stock is configured in SAP S/4HANA, which is used for replenishment and represents the minimum possible quantity capable of supporting a replacement time that is longer than the programmed one or a disproportionate consumption. It is set at the product and plant level. When the stock decreases to that quantity, a purchase order or a production order is automatically triggered for replenishment.

Technical considerations

  • Stores in B2C Commerce Cloud are manually set up and each store has an inventory list associated with it. For the purpose of this use case, three stores will be set up using the B2C Account Manager. The inventory associated with these stores can be retrieved in real-time from the B2C Storefront on the product description page and the checkout page. Additionally, a batch process can be set up to feed inventory to these stores.
  • Stores in Salesforce Sales Cloud/Service Cloud are manually set up and inventory for these stores can be retrieved in real-time.
  • The Orders Sync use case is leveraged to orchestrate the order creation in SAP S/4HANA.
    • The shipping charge in the order will be $0 since the products will be selected to be picked up in-store. This should reflect in the Order details in Salesforce Service Cloud/Sales Cloud.
  • The Product Sync Use case is leveraged to sync products between B2C Commerce Cloud and SAP S/4HANA.
    • The Products in B2C are configured to be available for pick up in-store.
    • The Products in SAP S/4 HANA are configured to be created for multiple plants.
  • The MDM system is used to lookup products to correlate the products in B2C commerce cloud and Salesforce Service Cloud/Sales Cloud with products in SAP S/4HANA.
  • Use CIM as the canonical model.
  • Build using top applications, inclusive of Salesforce products, but should be built to work with other endpoints as well. For this solution, leverage the following applications:
    • Salesforce B2C Commerce (CC)
    • Salesforce Core (Sales, Service, and B2B CC)
    • SAP S/4HANA.

End-to-end scenarios

  • Stores in B2C Commerce Cloud show the real-time inventory for the product from SAP S/4HANA.
  • Stores in Salesforce Service Cloud/Sales Cloud show the real-time inventory for the product from SAP S/4HANA.
  • Order placed in B2C Commerce Cloud is created in SAP S/4HANA.

Systems involved

  • Salesforce B2C Commerce (CC)
  • SAP S/4HANA
  • PIM Database (generic)
  • MDM (generic)

Solution definition

This version enables the B2C Commerce Cloud and Service Cloud/Sales Cloud platforms to retrieve the most up-to-date inventory information for a given product or a list of products.

Before you begin

bulb.png The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications.

Goal

The goal is to display real-time inventory of the product in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud.

Steps

  1. Select a product on B2C Commerce Cloud’s storefront.
  2. On the product description page, select Pickup in-store and enter the zip code.
  3. Retrieve the inventory in real-time and display it in the 'Available Quantity' field along with the Store Details.
  4. At the checkout page, the radio button for 'Pick Up In-Store' will be selected by default, and the shipping fee is set to zero dollars.
  5. To retrieve the inventory in real-time, the B2C Commerce Cloud Experience API will be invoked to check for inventory again.
  6. Publish the order created in B2C Commerce Cloud to SAP S/4HANA.

Use case extension

If no match is found, create a new entry in MDM.

Assumptions and constraints

The following will be used to guide or constrain the solution design at a high level:

  • The Cloud Information Model (CIM) will be used as the canonical model for all business types; see the CIM usage guidelines in that asset.
  • Three stores are manually configured in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud.
  • The stores in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud are mapped to Plant in SAP S/4HANA. The process layer will have this mapping as a configuration.
  • The Safety Stock is in SAP S/4HANA. This can be configured manually or programmatically using the SAP S/4HANA Products System API in the Product Sync use case.

High-level architecture

retail-real-time-inventory-mgmt-architecture.png

Sequence diagram

The following diagram illustrates the sequence of processing the real-time inventory check of a product from B2C Storefront:

retail-real-time-inventory-mgmt-sequence.png

Processing logic

The primary handling and orchestration of real-time inventory checks will be implemented in the Inventory Process API. This process can be described as follows:

  1. The product and the selected stores will be sent to the Inventory Process API.
  2. Find a matching product entry in MDM. The lookup will be done by attempting to match the following criteria, in sequential order, returning once a match has been found:
    • Universal Identifier (if provided)
    • External Identifier (of source system)
  3. If a single match is found:
    • Retrieve the existing product
    • Retrieve the corresponding product ID for SAP S/4HANA.
  4. Invoke the SAP S/4HANA Product Availability System API.
  5. Return the response to the B2C Commerce Cloud Experience API.
  6. Update the inventory in the B2C Commerce System API.

Success conditions

After successfully completing the update processing for all target systems, the following conditions will be met:

  1. B2C Commerce Cloud displays the real-time inventory information on the product description page and the checkout page.
  2. Salesforce Service Cloud/Sales Cloud displays the real time inventory information of a product at the associated stores.
  3. The Order is successfully created with a zero-dollar shipping fee.
  4. The Order ID Graph in Salesforce Service Cloud/Sales Cloud shows the order created in various downstream systems where SAP S/4HANA is the relevant system for this use case.

Mappings

Source type mappings

The following table summarizes how representations of a product from each system will be mapped to CIM types:

Source System Source Type CIM Types Mapping Notes
B2C Commerce Product Product
ProductCategory
ProductCatalog
PriceBook
Relevant fields only
OFBiz Product Product
ProductCategory
ProductCatalog
PriceBook
Relevant fields only
SAP S/4HANA Product Product
ProductCategory
ProductCatalog
PriceBook
Relevant fields only
Salesforce Product
Pricebook
Product
ProductCategory
ProductCatalog
PriceBook
Relevant fields only
PIM Product
ProductCategory
ProductCatalog
PriceBook
Product
ProductCategory
ProductCatalog
PriceBook
1:1 mappings; use join tables for relationships

Target type mappings

The following table summarizes how representations of a product from each system will be mapped from CIM types:

Target System CIM Type Target Types Mapping Notes
B2C Commerce Product
ProductCategory
ProductCatalog
PriceBook
Product Relevant fields only and 'availableForPickupInstore'
is a custom attribute
OFBiz Product
ProductCategory
ProductCatalog
PriceBook
Product
ProductCategory
ProductCatalog
PriceBook
Relevant fields only
SAP S/4HANA Product
PriceBook
Product
PricingCondition
Relevant fields only; Products are mapped to more than
one plant to correspond to the stores in B2C
Salesforce Product
ProductCategory
ProductCatalog
PriceBook
Product
PriceBook
Relevant fields only
PIM Product
ProductCategory
ProductCatalog
PriceBook
Product Relevant fields only

Downloadable assets

Accelerator System APIs

Accelerator Process APIs

Accelerator Experience APIs

Custom components

  • B2C Commerce Instore Pickup Cartridge | Source
  • B2C Commerce Sync Cartridge | Source
  • Product Availability Lightning Web Component | Source



back to top


Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onDec 8, 2023
Contact nameMuleSoft Solutions
Contact emailsolutions-questions@mulesoft.com
Asset overview

Asset versions for 3.0.x

Asset versions
VersionActions
3.0.0

Categories

Accelerator
RetailNo values left to add
Industry Vertical
RetailNo values left to add

Tags