This minor version has been deprecated
MuleSoft Accelerator for Salesforce B2C Commerce Cloud icon

MuleSoft Accelerator for Salesforce B2C Commerce Cloud

(1 review)

Use case 3 - Order creation

Overview

The following use case is covered:

  • Order creation (B2C Commerce Cloud → OMS)

This use case replicates orders placed in Commerce Cloud to an external Order Management System (OMS).

  • Scheduled export of orders from Commerce Cloud to an SFTP location; the Mule application
    • Polls for files in the SFTP location
    • Extracts orders and creates matching orders in the OMS.

For demonstration purposes this use case uses Apache OFBiz as the backend OMS.

High-level architecture

sfc-b2c-com-order-creation-api-led-architecture.png

Workflow:

  1. Commerce Cloud order export job is triggered on a schedule, or manually. Any orders since the last export execution are exported to a file, and sent by SFTP to the configured location.
  2. Mule SFTP Poller detects the order file, parses the order XML data, and publishes it into an Anypoint MQ queue.
  3. An Anypoint MQ listener in the OMS Process API dequeues the orders and transforms them into JSON. A REST call is made to the OMS System API to store the new order. The OMS Process API is vendor agnostic (not tied to any specific OMS product).
  4. OMS System API uses OFBiz APIs to create the following in OFBiz (Note: this release supports Apache OFBiz. Other OMS will need their own system API logic.):

    • The customer and their address (if customer doesn’t exist)
    • Credit card information (if it doesn’t exist yet)
    • Order, shipping, and payment information
  5. Customer, address, payment/credit-card information (existing records, or newly created by this process) are used to create the order in the OMS. Note: Customer email address is used as customer ID in OFBiz.

  6. Once the order is created, the OMS system API returns the ID of the newly created order to Commerce Cloud.

Sequence diagram

sfc-b2c-com-order-creation-seq-diagram.png

Systems involved:

  • Apache OFBiz OMS: Contains information about orders, customers, shipments etc. Apache OFBiz is accessed through OFBiz’ SOAP RPC Style web services API.
  • Commerce Cloud: Where the order is placed. Mule interfaces with Commerce Cloud via SFTP.
  • SFTP Server: SFTP Server hosted in AWS EC2 instance is used as the SFTP host.

Setup instructions

B2C Commerce Configuration

  • Import product catalog from OMS to B2C Commerce (optional, if needed depending on the OMS being used). This page outlines the details
  • Setup B2C Commerce Cloud to export orders to an SFTP location. This page details the requirements and steps to set up the scheduled export of orders from B2C Commerce to an XML file for batch processing by the OMS process API.

Mule Projects

B2C Commerce Cloud Components & Configurations

Setup sftp export on B2C Commerce Cloud to export orders to an sftp site as per these instructions.

OMS Components & configurations:

Data Elements (OFBiz)

Element NameData TypeDescription
order_numberStringThe original order number.
customer_idStringCustomer ID, uniquely identifies customers.
order_dateDateReturns the value of attribute ‘order date’.
order_statusStringThe order status
product_idStringThe product as part of the order line item.
product_nameStringThe name of the product.

Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onOct 30, 2020
Asset overview

Asset versions for 1.3.x

Asset versions
StatusVersionActions
1.3.0