In order to create your own logic for calculating shipping costs for a specific set of products (shopping cart items) there is the ability to create a custom flow which. This custom flow has specific requirements from the OrderCentral side so that we can provide the flow with the product data and customer data for which the shipping costs should be generated.
Create a flow
Create the input variables you need, see below for available variables.
Create the output variable to return the result back to OrderCentral.
Add the necessary logic to the flow and assign the outcome to the Result output variable
Go to Setup -> Custom Metadata Types -> Delivery Methods
Add a new- or adjust the existing Delivery Method and set the type to Flow
Copy the flow name created in Step 1 and past it in the Flow Name field.
You can use the two input variables to base your calculation upon, they are not required if they will not be used. The Result output variable is required.
Type references
OrderProduct properties
Property Name
Type
Description
code
String
The Product2.ProductCode value
quantity
Decimal
The number of ordered products
Address properties
Property Name
Type
street
String
city
String
postalCode
String
state
String
country
String
ShippingCalculationResult properties
Property Name
Type
Description
deliveryTime
Integer
The expected delivery time in days. Zero or null will not be displayed in the UI
disabled
Boolean
Indicates if this shipping option should be disabled in the UI
label
String
If set it will override the configured label on the Delivery Method
totalAmount
Decimal
The total shipping cost amount before tax
totalAmountCustomLabel
String
Custom label for the total shipping amount, used to override the default label in the UI
tooltipCustomLabel
String
Custom tooltip text to display for this shipping option in the UI