Intro
This guide explains how to create simple rules that automatically control how orders and deliveries are handled.
You can use these rules to:
- Apply shipping options
- Add or remove products
- Set delivery conditions
- Automate order processing decisions
🧩 How a Rule Works
Every rule follows this structure:
ON <event>
IF <conditions>
THEN <actions>
[ELSE <alternative actions>]
ENDIF
In plain language:
- ON → When does the rule trigger?
- IF → What must be true?
- THEN → What should happen?
ELSE(optional) → What happens otherwise?
🚀 Step 1: Choose When the Rule Runs (Event)
You can trigger rules at specific moments:
- ORDERLOAD → When an order is loaded into the system
- WS_CREATEDELIVERY → When a shipping label is being created via webservice
👉 Example:
ON ORDERLOAD
🔍 Step 2: Define Your Conditions
Conditions decide whether your rule applies.
Simple condition
PARCELWEIGHT > 10
👉 Meaning: apply the rule if the parcel weighs more than 10
RECIPCOUNTRYCODE = ‘FR’
👉 Meaning: apply the rule if the parcel is sent to France
Combine multiple conditions
Use:
- AND → both must be true
- OR → at least one must be true
(PARCELWEIGHT > 10 AND RECIPCOUNTRYCODE = ‘FR’)
👉 Meaning: heavy parcel and destination is France
⚙️ Step 3: Use Smart Checks (Functions)
You can use built-in checks to simplify logic:
- CONTAINS → text includes something
- IN → value is in a list
- HASVALUE → field is filled
- ISEMPTY → field is empty
👉 Examples:
SKU IN (‘A’, ‘B’, ‘C’)
NAME CONTAINS (‘Book’)
RECIPRELAYNUMBER HASVALUE
📦 Step 4: Define What Happens (Actions)
1. Set a value
SIGNATURE = ‘YES’
👉 Example: require signature on delivery
2. Add a product
ADDPRODUCT(SKU=’ABC’, QUANTITY=1)
👉 Example: automatically add a bonus item
3. Remove a product
DELETEPRODUCT(SKU=’ABC’)
👉 Example: remove an item from the order
Multiple actions
You can combine several actions:
SIGNATURE=’YES’ ADDPRODUCT(SKU=’A’, QUANTITY=1)
🧾 Full Example
Here’s a complete business rule:
ON ORDERLOAD
IF (PARCELWEIGHT > 10 AND RECIPCOUNTRYCODE = ‘FR’)
THEN SIGNATURE = ‘YES’
ELSE SIGNATURE = ‘NO’
ENDIF
What it means:
- When an order is loaded
- If the parcel is heavy and going to France
- Then require a signature
- Otherwise, no signature required
🏷️ Key Data You Can Use
You can build rules using these types of information:
Parcel details
- Weight
- Value
- Insurance value
Recipient details
- Country
- Relay point
Product details
- SKU (product code)
- Name
- Quantity
Shipping details
- Shipping service
- Keywords
- Weight unit
- Signature requirement
✅ Best Practices
- Keep rules simple and readable
- Use parentheses when combining conditions
- Double-check spelling of values (e.g. ‘FR’)
- Start with small rules, then expand
- Test rules before using them in production
⚠️ Common Mistakes to Avoid
- Missing quotes around text (‘FR’ ✔, FR ✖)
- Forgetting ENDIF
- Using too many conditions without grouping
Typing variable names incorrectly
🎯 Summary
With these rules, you can:
- Automate shipping decisions
- Control order content
- Enforce business policies
- Reduce manual work
If you want, I can also:
- Create a cheat sheet (1-page quick reference)
- Add real business scenarios (e.g., free shipping rules)
- Turn this into a training deck or PDF
Add real business scenarios (e.g., free shipping rules)
Here are practical, real-world business scenarios you can directly use or adapt. Each example includes both the rule and a plain-language explanation so non-technical users can understand the intent.
🎯 Common Business Scenarios
🚚 1. Free Shipping for High-Value Orders
ON ORDERLOAD
IF PARCELVALUE >= 100
THEN SHIPPINGSERVICEKEY = ‘FREE’
ENDIF
What it means:
If the total order value is €100 or more, the customer gets free shipping.
🇫🇷 2. Require Signature for Deliveries to France
ON WS_CREATEDELIVERY
IF RECIPCOUNTRYCODE = ‘FR’
THEN SIGNATURE = ‘YES’
ENDIF
What it means:
All deliveries to France must be signed for upon receipt.
📦 3. Add a Free Gift for Promotional Products
ON ORDERLOAD
IF SKU IN (‘PROMO1’, ‘PROMO2’)
THEN ADDPRODUCT(SKU=’GIFT01′, QUANTITY=1)
ENDIF
What it means:
If the order contains a promotional product, automatically add a free gift.
⚖️ 4. Apply Special Shipping for Heavy Parcels
ON WS_CREATEDELIVERY
IF PARCELWEIGHT > 20
THEN SHIPPINGSERVICEKEY = ‘HEAVY’
ENDIF
What it means:
Heavy parcels (over 20 units of weight) use a special shipping service.
❌ 5. Remove Restricted Products for Certain Countries
ON ORDERLOAD
IF RECIPCOUNTRYCODE = ‘US’
THEN DELETEPRODUCT(SKU=’ALCOHOL01′)
ENDIF
What it means:
Remove restricted items (e.g., alcohol) from orders going to the U.S.
🎁 6. Add Packaging for Fragile Items
ON ORDERLOAD
IF NAME CONTAINS (‘Glass’)
THEN ADDPRODUCT(SKU=’PROTECT_BOX’, QUANTITY=1)
ENDIF
What it means:
If a product contains “Glass” in its name, add protective packaging.
🚛 7. Use Relay Delivery When Available
ON WS_CREATEDELIVERY
IF RECIPRELAYNUMBER HASVALUE
THEN SHIPPINGSERVICEKEY = ‘RELAY’
ENDIF
What it means:
If the customer selected a relay point, use relay delivery service.
💰 8. Apply Insurance for High-Value Parcels
ON WS_CREATEDELIVERY
IF PARCELVALUE > 200
THEN PARCELINSURRANCEVALUE = PARCELVALUE
ENDIF
What it means:
Automatically insure expensive parcels based on their value.
🌍 9. Different Shipping for International Orders
ON WS_CREATEDELIVERY
IF RECIPCOUNTRYCODE <> ‘FR’
THEN SHIPPINGSERVICEKEY = ‘INTERNATIONAL’
ENDIF
What it means:
Orders outside France use an international shipping service.
🧮 10. Tiered Shipping Rules (Combined Logic)
ON ORDERLOAD
IF (PARCELVALUE >= 100 AND PARCELWEIGHT < 10)
THEN SHIPPINGSERVICEKEY = ‘FREE’
ELSE SHIPPINGSERVICEKEY = ‘STANDARD’
ENDIF
What it means:
- Free shipping for high-value, lightweight orders
- Standard shipping otherwise
🎯 11. Ensure Required Data Before Processing
ON ORDERLOAD
IF RECIPRELAYNUMBER ISEMPTY
THEN SHIPPINGSERVICEKEY = ‘HOME’
ENDIF
What it means:
If no relay point is selected, default to home delivery.
🛍️ 12. Bulk Order Bonus
ON ORDERLOAD
IF QUANTITY >= 10
THEN ADDPRODUCT(SKU=’BULK_DISCOUNT’, QUANTITY=1)
ENDIF
What it means:
Large orders receive a bonus or discount item.
💡 Tips for Using These Scenarios
- Start by copying a scenario close to your need
- Adjust values (price, country, SKU, etc.)
- Combine multiple ideas for more advanced rules
- Test rules with sample orders before going live
