Retail: Shipping Fees
Connect your E-Commerce / Marketplace to GoRules and modify shipping fees
Shipping fees are one of the most important components in the retail industry, directly impacting customer satisfaction and a company's bottom line. They are a crucial factor in the online shopping experience and proper calculation of shipping fees is essential for success in the retail industry.
Business Rule Management Systems (BRMS) have become an increasingly popular solution for automating and managing the complex process of calculating shipping fees. BRMS provide a flexible and scalable platform for retail companies to define, manage, and implement shipping fee rules based on their specific requirements. With BRMS, retail companies can set rules for different shipping methods, such as ground shipping, expedited shipping, or international shipping, and also apply specific fees based on the weight, volume, or destination of the package.
By the end of this tutorial, you will have a clear understanding of how GoRules can be used to manage shipping fees in retail businesses. You will learn about the key features and capabilities of GoRules, as well as how to implement shipping fee rules and make updates to them as needed.
Designing a decision
By using a rules engine, you can apply a set of predefined rules to the available information and automate the decision-making process. This can help ensure that the shipping fees are calculated accurately and efficiently.
For example, we can calculate shipping fees based on:
- cart data (totals, number of items, weight,...)
- customer data (geolocation, tier, overall spend,...)
- order history
And a shopping cart simple model can look like:
We aim to create a single decision table looking at different parameters and create a output that can either return a percentage fee or a flat fee.
To begin, set up a project and create a blank decision file.
Connecting the graph
In the decision editor:
- access the editing mode by clicking on Edit Graph.
- add input and output components by dragging and dropping them into the graph.
- add a decision table, and rename it to Shipping Fees
- Connect the input component to a shipping fees decision table, now connect decision table to an output. To do this, hover over the output connector on the right side of the node, click and hold your mouse, and drag the connection to the input connector on the left side of the target component.
- Once all nodes have been connected, as shown in the example image, confirm your changes by clicking on Confirm.
Next, open decision table and modify the content by clicking the Open button on the node.
As we will monitor 3 parameters (cart total, customer country, and customer tier) create three input columns:
Label: Cart Total
Label: Customer Country
Label: Customer Tier
Based on our goal to return either flat or percentage fee, we will need to create two output columns.
Label: Fees Flat ($)
Label: Fees Percentage
Fill the values as shown in the image below:
Description of the rows is as follows:
- if cart total is greater than 1000 and shipping country is United States and customer tier is gold, fee will be 2% of the total cart.
- if cart total is greater than 1000 and shipping country is United States, independent of the customer tier, fee will be 3% of the total cart.
- if cart total is less or equals 1000 and shipping country is United States, independent of the customer tier, fee will be flat $25.
- If cart total is greater than 1000 and shipping country is Canada or Mexico, fee will be 5% of the total cart.
Access the simulator by clicking the Simulator button. Within the panel, activate the simulation by clicking the Simulate button and observe the result.
To simulate different responses, we will add data to the request. Copy and paste the JSON model into the simulator and press Simulate.
The result should indicate that fee is $25 flat.
You can now modify the data and test with different request:
In this case the result is 15% fee.
Congratulations, you can now start integrating your Retail order system directly with GoRules engine. To learn how to do it, please visit Evaluation API.