The CalMate add-on automatically calculates the value of the Optional Parameter 2 (OP2) field for the consignment based on the cash-on-delivery amount. The calculation is performed after the consignment has been created. A default formula can be specified for the add-on, as well as a separate formula for each customer.
Prerequisites
- a subscribed Deliveo API connection;
- a subscribed Deliveo webhook service;
- permissions to install, configure and use the add-on.
Installation and access
The add-on can be installed via the DispatcherThe Dispatcher member of the Courier Service team. Manages customers and dispatches couriers. He/she uses the Deliveo dispatcherThe Dispatcher member of the Courier Service team. Manages customers and dispatches couriers. He/she uses the Deliveo dispatcher (admin) portal. (admin) portal. Portal, under the ‘Add-ons’ menu item. Once installed, it can be accessed via the ‘Add-ons / CalMate’ menu item. Only users with the appropriate authorisation may install and use the add-on.
How it works
In the formula, x represents the cash-on-delivery amount.
Example:
(x * 0.1) + 100
If the cash-on-delivery amount is 1000, then:
x = 1000- the calculated value of OP2 is 200
Mathematical operations that can be used in the formula:
+-*/()
Important rules
- The calculation runs after the consignment has been created.
- If there is already a value in the OP2 field, the supplement will overwrite it.
- The calculated result cannot be negative.
- The length of the result must not exceed the maximum length of the OP2 field.
- If the formula is incorrect, the calculation will not take place.
Configuring the webhook
A webhook must be created for the add-on to work.
- Open the Settings / Webhook menu item.
- Create a simple webhook.
- Select the ‘Create shipment’ event.
- Copy the webhook URL displayed on the CalMate page.
- Save the webhook.
The webhook URL is unique to each installation, so always use the address displayed on the CalMate interface.
Default OP2 formula
The Default OP2 formula applies to all shipments for customers for whom no specific customer-specific formula has been specified. To set this up:
- Enter the formula in the Default OP2 formula field.
- Check the formula using the ‘Test formula’ button.
- Click the Save button.
Example:
10+(x*2)/10
ClientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface.-specific formulas
In the ‘ClientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface. Formulas’ section, you can specify different calculations for each clientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface.. This requires two pieces of data:
- ClientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface. ID
- Formula
The Customer ID is the internal numeric identifier shown in the ID column of the Master Data / Customers list in the DispatcherThe Dispatcher member of the Courier Service team. Manages customers and dispatches couriers. He/she uses the Deliveo dispatcherThe Dispatcher member of the Courier Service team. Manages customers and dispatches couriers. He/she uses the Deliveo dispatcher (admin) portal. (admin) portal. Portal. To add a customer-specific formula:
- Find the customer’s ID in the Master Data / Customers menu.
- Enter the ID in the Customer ID field.
- Enter the formula for that clientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface..
- Test the formula if necessary.
- Click the Add button.
Existing customer formulas can be removed using the delete button at the end of the row.
Order of formula application
When creating a consignment, the system:
- checks whether a specific formula is associated with the customer;
- if so, it uses the clientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface.-specific formula;
- if there is no specific formula, it applies the default formula.
Testing a formula
The formula can be tested before saving.
- In the test field, enter the
xvalue, i.e. the cash-on-delivery amount you wish to test. - Click the ‘Test formula’ button.
- The system will run the formula.
- If the test is successful, it will display the calculated result.
The test does not modify any consignment; it merely checks that the formula works.
Invalid formula
If the formula you have entered is invalid:
- the calculation will not run;
- the formula field will be briefly highlighted with a red border.
In this case, check:
- that the brackets are correct;
- that the correct operators are used;
- that you are only
xvariable; - that there are no typos or missing operators.
Examples
Adding a fixed amount
x+100
100 is added to the cash-on-delivery amount.
Calculating a percentage
x*0.1
The value of OP2 is 10% of the cash-on-delivery amount.
Percentage and fixed amount combined
(x*0.1)+100
The value of OP2 is 10 per cent of the cash-on-delivery amount, plus 100.
Deduction of a fixed amount
x-100
The system deducts 100 from the cash-on-delivery amount. The result cannot be negative.
Common errors
The value of OP2 is not updated
Check:
- that the webhook has been created;
- that the webhook event is ‘Create Shipment’;
- that the correct URL is specified in the webhook;
- whether a cash-on-delivery amount has been set for the consignment;
- that the formula has been saved.
The expected formula is not running
Check:
- whether there is a separate formula for the customer;
- whether the correct Customer ID has been entered;
- that the desired default formula has been saved.
The clientThe Customer (bill payer) pays the Courier Service for the delivery of parcels. You can also be the sender / recipient of the shipment. He/she uses the Deliveo customer interface.-specific formula takes precedence over the default formula.
The result is negative
The add-on must not use a negative OP2 value. Amend the formula so that the result is at least zero for all expected cash-on-delivery amounts.
Formula test failed
Check:
- the syntax of the formula;
- the brackets;
- the operators;
- the
xuse of variables.
The previous value of OP2 has disappeared
The add-on overwrites the previous value of the OP2 field when the message is created. This is part of how it works.