Accelerator Salesforce OMS System API - Implementation Template

(0 reviews)

Data mappings

This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables.

ModuleDescription
highscaleorderlibrary
create-shipment-requestCreate a Shipment from CIM Fulfillment Order and update Fulfillment Order Status
create-payment-requestPayments endpoint handles the Capture Payments request in 3 steps by invoking the Commerce REST APIs

highscaleorderlibrary

Source: ./src/main/resources/dwl/purchaseorder/highscaleorderlibrary.dwl

Functions

fun getAccount (payload, accountDetails)

Maps CIM Purchase Order fields to referenced Account Object fields in High Scale Orders API request to create a Purchase Order based on Account Matching Rules in OMS.

High Scale Orders API request fieldCIMDescription
B2B_EDISenderCode__cpurchasingOrganizationCodeField used to match the Account in Salesforce OMS and is mapped from Organization Code of the purchase order
NamepurchasingOrganizationCodeOrganization Code of the entity that raised the purchase order
BillingStreetorderDeliveryLocation.locationAddress.addressLine1Organization Street Address used for matching Account in OMS
BillingCityorderDeliveryLocation.locationAddress.cityNameOrganization Street Address used for matching Account in OMS
BillingStateCodeorderDeliveryLocation.locationAddress.stateProvinceCodeOrganization State Code used for matching Account in OMS
BillingPostalCodeorderDeliveryLocation.locationAddress.postalCodeTextOrganization Postal Code used for matching Account in OMS
BillingCountryCodeorderDeliveryLocation.locationAddress.countryCodeOrganization Country Code

fun getProducts (payload)

Maps CIM Purchase Order fields to referenced Product2 Object fields in High Scale Orders API request to create a Purchase Order based with the products in OMS.

High Scale Orders API request fieldCIMDescription
NamepurchaseOrderProducts.nameName of the Product
DescriptionpurchaseOrderProducts.descriptionDescription of the Product
ProductCodepurchaseOrderProducts.productCodeCode of the Product

fun getProductDeliveryLocation (payload)

This function produces OrderDeliveryGroupSummary based on address in purchaseOrderProducts.productDeliveryLocation object. If the productDeliveryLocation is null the reference Id is generated with a refOrderDeliveryLocationOrderDeliveryGroup.

High Scale Orders API request fieldCIMDescription
DescriptionproductDeliveryLocation.nameDescription of the Location
DeliverToNameproductDeliveryLocation.contactNameBuyer Name
DeliverToStreetproductDeliveryLocation.locationAddress.addressLine1Delivery Street Address used for order line item
DeliverToCityproductDeliveryLocation.locationAddress.cityNameDelivery Street Address used for matching Account in OMS
DeliverToStateCodeproductDeliveryLocation.locationAddress.stateProvinceNameDelivery State Code
DeliverToPostalCodeproductDeliveryLocation.locationAddress.postalCodeTextDelivery Postal Code
DeliverToCountryCodeproductDeliveryLocation.locationAddress.countryNameDelivery Country Code

fun getOrderDeliveryLocation (payload)

Maps CIM Purchase Order fields to referenced OrderDeliveryGroupSummary Object fields in High Scale Orders API request. The orderDeliveryLocation in Order will map to a OrderDeliverSummaryGroup that holds address and Delivery Method for the Order. This will be used as the default DeliveryLocation in case the purchaseOrderProducts in Order does not hold the deliveryLocation. This function produces OrderDeliveryGroupSummary based on address in orderDeliveryLocation.productDeliveryLocation object.

High Scale Orders API request fieldCIMDescription
DescriptionorderDeliveryLocation.nameDescription of the Location
DeliverToNameorderDeliveryLocation.contactNameBuyer Name
DeliverToStreetorderDeliveryLocation.locationAddress.addressLine1Delivery Street Address used for order line item
DeliverToCityorderDeliveryLocation.locationAddress.cityNameDelivery Street Address used for matching Account in OMS
DeliverToStateCodeorderDeliveryLocation.locationAddress.stateProvinceNameDelivery State Code
DeliverToPostalCodeorderDeliveryLocation.locationAddress.postalCodeTextDelivery Postal Code
DeliverToCountryCodeorderDeliveryLocation.locationAddress.countryNameDelivery Country Code

fun getOrderDeliveryGroupSummary (payload)

Maps CIM Purchase Order fields to referenced OrderDeliveryGroupSummary Object fields in High Scale Orders API request Each of the purchaseOrderProducts in Order will map to a OrderDeliverSummaryGroup that holds address and Delivery Method for the Order. If the DeliveryLocation in case the purchaseOrderProducts in Order does not hold the deliveryLocation OrderDeliveryLocation will be used.

fun getOrderItemSummary (payload)

Maps CIM Purchase Order fields to referenced OrderItemSummary Object fields in High Scale Orders API request Each of the Order Line Item in Order will map to a OrderItemSummary that holds details of order line item like Quantity Price and references Order Summary Product and Order Delivery Groups for the Order.

High Scale Orders API request fieldCIMDescription
DescriptionitemDescriptionDescription of the item
QuantityorderedQuantityQuantity of items
UnitPriceunitPriceUnitPrice of Item in the order
ListPriceunitPriceListPrice of Item in the order
CurrencyIsoCodeUSDDefaulted to USD
OrderSummaryIdreferenced fieldreferenced to Id of Order Summary Object
Product2Idreferenced fieldreference to Id of Product2 Object
OrderDeliveryGroupSummaryIdreferenced fieldreference to Id of OrderDeliveryGroupSummary

fun getOrderSummary (payload, accountDetails)

Maps CIM Purchase Order fields to referenced OrderSummary Object fields in High Scale Orders API request Order will map to a OrderSummary that holds relation to Account SalesChannel Store and details of order.

High Scale Orders API request fieldCIMDescription
OrderLifeCycleTypeManagedDefaulted to Managed
BillingEmailAddressbuyerEmailAddressEmail Address of Buyer
OrderedDatepurchaseOrderDatePurchase Order date
DescriptionpurchaseOrderPurposePurpose of the order
ExternalReferenceIdentifierpurchaseOrderNumberA unique Order Number as referenced by Buyer
OrderNumberpurchaseOrderNumberA unique Order Number as referenced by Buyer
GrandTotalAmountorderedQuantity * unitPriceTotal of Quantity and Unit Price for all items in order
CurrencyIsoCodeUSDDefaulted to USD
SalesChannelIdreferenced fieldreferenced to Id of SalesChannel Object
SalesStoreIdreferenced fieldreference to Id of SalesStore Object
AccountIdreferenced fieldreference to Id of Account of object

fun getSalesChannel (channelName)

Associates the Sales Channel fields based on the referenced account in the purchase order

High Scale Orders API request fieldCIMDescription
SalesChannelNameOptionalSales Channel based on the referenced Account in request

fun getStore (accountDetails)

Associates the Store for Purchase Order based on referenced account in the purchase order

High Scale Orders API request fieldCIMDescription
NameNoneName of store based on the referenced Account in request
TypeNoneType of store based on the referenced Account in request
ExternalReferenceNoneExternal Reference of store based on the referenced Account in request
DefaultTaxLocaleTypeNoneDefaulted to Net

fun getOrderDeliveryMethod (deliveryMethod)

Associates the Delivery Method of Order items in Purchase Order. This is based on referenced account in the purchase order

High Scale Orders API request fieldCIMDescription
NameNoneName of deliveryMethod linked on the referenced Account in request

(back to top)

create-shipment-request

Create a Shipment from CIM Fulfillment Order and update Fulfillment Order Status

Source: ./src/main/resources/dwl/shipments/create-shipment-request.dwl

Mapping Tables

Maps CIM Fulfillment Order to create a Shipment and update Fulfillment Order Status

Salesforce Object and FieldCIMDescription
Shipment.FulfillmentOrderIdfulfillmentOrderIdFulfillment Order to update status
Shipment.OrderSummaryIdorderSummaryIdSales Order Id associated with fulfillment Order
Shipment.TrackingNumbercarrierTrackingNumberTracking Number of Shipment
Shipment.ExternalId__cshipmentNumberShipmentNumber sent by ERP stored as External ID
Shipment.StatusshipmentStatusShipment Status of the fulfilled Order
Shipment.TrackingNumbercarrierTrackingNumberTracking Number of Shipment
Shipment.ShipToNamecarrierTrackingNumberName to send the Shipment
FulfillmentOrder.Status"fulfilled"Status that can be configured to update fulfillment order

(back to top)

create-payment-request

Payments endpoint handles the Capture Payments request in 3 steps by invoking the Commerce REST APIs

Source: ./src/main/resources/dwl/payments/create-payment-request.dwl

Mapping Tables

Steps: 1. Create a Payment. 2. Create an Order Payment Summary using the Payment IDs. 3. Invoke the ensure-funds-async action on the Order Summary for the Invoice. The Capture Payment Object will hold details of the payment for a specific Invoice. The details of the Invoice is obtained from the first Payment Application object in the list. Maps CIM Capture Payment to create a Payment

Salesforce Object and FieldCIMDescription
Payment.AmountpaymentAmountPayment Amount to be updated for the Invoice
Payment.ProcessingMode"External"Default set from configurations
Payment.AccountIdcustomerIdAccount associated with the Purchase Order obtained by matching customerId with B2B_EDISenderCode__c
Payment.Status"Processed"Default status to update the payment as Processed from configurations
Payment.PaymentMethodIdcustomerIdDigital Wallet or CardPaymentMethods method associated with the Account
Payment.Type"CapturePayment type defaulted based on configuration
Payment.PaymentGatewayId""Gateway setup for OMS and Obtained from configurations
OrderPaymentSummary.orderSummaryIdpurchaseOrderNumberSalesforce Id of the Purchase Order
OrderPaymentSummary.paymentIdsPayment IDs obtained from creation of Payment
invoiceIdpaymentApplications[0].invoiceIdInvoiced Id used to invoke ensure-funds-async action on the Order Summary for the Invoice. This is referenced as DocumentNumber on Invoice.

(back to top)


Reviews

TypeTemplate
OrganizationMulesoft Inc.
Published by
MuleSoft Solutions
Published onMay 25, 2024
Asset overview

Asset versions for 1.1.x

Asset versions
VersionActions
1.1.1