Accelerator Salesforce OMS System API - Implementation Template
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.
Module | Description |
---|---|
highscaleorderlibrary | |
create-shipment-request | Create a Shipment from CIM Fulfillment Order and update Fulfillment Order Status |
create-payment-request | Payments 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 field | CIM | Description |
---|---|---|
B2B_EDISenderCode__c | purchasingOrganizationCode | Field used to match the Account in Salesforce OMS and is mapped from Organization Code of the purchase order |
Name | purchasingOrganizationCode | Organization Code of the entity that raised the purchase order |
BillingStreet | orderDeliveryLocation.locationAddress.addressLine1 | Organization Street Address used for matching Account in OMS |
BillingCity | orderDeliveryLocation.locationAddress.cityName | Organization Street Address used for matching Account in OMS |
BillingStateCode | orderDeliveryLocation.locationAddress.stateProvinceCode | Organization State Code used for matching Account in OMS |
BillingPostalCode | orderDeliveryLocation.locationAddress.postalCodeText | Organization Postal Code used for matching Account in OMS |
BillingCountryCode | orderDeliveryLocation.locationAddress.countryCode | Organization 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 field | CIM | Description |
---|---|---|
Name | purchaseOrderProducts.name | Name of the Product |
Description | purchaseOrderProducts.description | Description of the Product |
ProductCode | purchaseOrderProducts.productCode | Code 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 field | CIM | Description |
---|---|---|
Description | productDeliveryLocation.name | Description of the Location |
DeliverToName | productDeliveryLocation.contactName | Buyer Name |
DeliverToStreet | productDeliveryLocation.locationAddress.addressLine1 | Delivery Street Address used for order line item |
DeliverToCity | productDeliveryLocation.locationAddress.cityName | Delivery Street Address used for matching Account in OMS |
DeliverToStateCode | productDeliveryLocation.locationAddress.stateProvinceName | Delivery State Code |
DeliverToPostalCode | productDeliveryLocation.locationAddress.postalCodeText | Delivery Postal Code |
DeliverToCountryCode | productDeliveryLocation.locationAddress.countryName | Delivery 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 field | CIM | Description |
---|---|---|
Description | orderDeliveryLocation.name | Description of the Location |
DeliverToName | orderDeliveryLocation.contactName | Buyer Name |
DeliverToStreet | orderDeliveryLocation.locationAddress.addressLine1 | Delivery Street Address used for order line item |
DeliverToCity | orderDeliveryLocation.locationAddress.cityName | Delivery Street Address used for matching Account in OMS |
DeliverToStateCode | orderDeliveryLocation.locationAddress.stateProvinceName | Delivery State Code |
DeliverToPostalCode | orderDeliveryLocation.locationAddress.postalCodeText | Delivery Postal Code |
DeliverToCountryCode | orderDeliveryLocation.locationAddress.countryName | Delivery 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 field | CIM | Description |
---|---|---|
Description | itemDescription | Description of the item |
Quantity | orderedQuantity | Quantity of items |
UnitPrice | unitPrice | UnitPrice of Item in the order |
ListPrice | unitPrice | ListPrice of Item in the order |
CurrencyIsoCode | USD | Defaulted to USD |
OrderSummaryId | referenced field | referenced to Id of Order Summary Object |
Product2Id | referenced field | reference to Id of Product2 Object |
OrderDeliveryGroupSummaryId | referenced field | reference 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 field | CIM | Description |
---|---|---|
OrderLifeCycleType | Managed | Defaulted to Managed |
BillingEmailAddress | buyerEmailAddress | Email Address of Buyer |
OrderedDate | purchaseOrderDate | Purchase Order date |
Description | purchaseOrderPurpose | Purpose of the order |
ExternalReferenceIdentifier | purchaseOrderNumber | A unique Order Number as referenced by Buyer |
OrderNumber | purchaseOrderNumber | A unique Order Number as referenced by Buyer |
GrandTotalAmount | orderedQuantity * unitPrice | Total of Quantity and Unit Price for all items in order |
CurrencyIsoCode | USD | Defaulted to USD |
SalesChannelId | referenced field | referenced to Id of SalesChannel Object |
SalesStoreId | referenced field | reference to Id of SalesStore Object |
AccountId | referenced field | reference 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 field | CIM | Description |
---|---|---|
SalesChannelName | Optional | Sales 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 field | CIM | Description |
---|---|---|
Name | None | Name of store based on the referenced Account in request |
Type | None | Type of store based on the referenced Account in request |
ExternalReference | None | External Reference of store based on the referenced Account in request |
DefaultTaxLocaleType | None | Defaulted 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 field | CIM | Description |
---|---|---|
Name | None | Name of deliveryMethod linked on the referenced Account in request |
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 Field | CIM | Description |
---|---|---|
Shipment.FulfillmentOrderId | fulfillmentOrderId | Fulfillment Order to update status |
Shipment.OrderSummaryId | orderSummaryId | Sales Order Id associated with fulfillment Order |
Shipment.TrackingNumber | carrierTrackingNumber | Tracking Number of Shipment |
Shipment.ExternalId__c | shipmentNumber | ShipmentNumber sent by ERP stored as External ID |
Shipment.Status | shipmentStatus | Shipment Status of the fulfilled Order |
Shipment.TrackingNumber | carrierTrackingNumber | Tracking Number of Shipment |
Shipment.ShipToName | carrierTrackingNumber | Name to send the Shipment |
FulfillmentOrder.Status | "fulfilled" | Status that can be configured to update fulfillment order |
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 Field | CIM | Description |
---|---|---|
Payment.Amount | paymentAmount | Payment Amount to be updated for the Invoice |
Payment.ProcessingMode | "External" | Default set from configurations |
Payment.AccountId | customerId | Account 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.PaymentMethodId | customerId | Digital Wallet or CardPaymentMethods method associated with the Account |
Payment.Type | "Capture | Payment type defaulted based on configuration |
Payment.PaymentGatewayId | "" | Gateway setup for OMS and Obtained from configurations |
OrderPaymentSummary.orderSummaryId | purchaseOrderNumber | Salesforce Id of the Purchase Order |
OrderPaymentSummary.paymentIds | Payment IDs obtained from creation of Payment | |
invoiceId | paymentApplications[0].invoiceId | Invoiced Id used to invoke ensure-funds-async action on the Order Summary for the Invoice. This is referenced as DocumentNumber on Invoice. |