Creating and editing a rule #
Each rule consists of #
- Name-required.
- Description-we recommend specifying what the rule does.
- Condition-must be met to fulfill the rule.
- Actions - are performed when all conditions are met.
Available actions in the rules #
Action | Available operators | Possible value/ Description | Template variables |
---|---|---|---|
Tariff | |||
Tariff name | Any text | can be used | |
Tariff description | Any text | can be used | |
Disable tariff | |||
Delivery period | -, +, = | Whole number - number of days. | |
Delivery cost | -, +, = | whole number/ Fractional number | |
round up(~) | Rounds to whole | ||
markup from the cost of delivery (%) | Increases delivery cost by the specified number of percentages. | ||
markup from the cost of order (%) | Increases delivery cost for the specified number of percentages of the order amount. | ||
discount from the cost of delivery (%) | Reduces delivery cost by the specified number of percentages. | ||
discount from the cost of order (%) | Reduces delivery cost for the specified number of percentages of the order amount. |
Template variables #
List of variables #
- [providerName] - Provider name. That is, in the part of the text this variable will be replaced with the provider name (delivery service).
- [minDay] - Minimum delivery time. That is, in the part of the text, this variable will be replaced with the minimum number of days according to the tariff.
- [maxDay] - Мaximum delivery time. That is, in the part of the text, this variable will be replaced with the maximum number of days according to the tariff.
Available conditions in the rules #
Conditions | Available Operators | Possible Values / Description |
---|---|---|
General | ||
Estimated value | >, >=, <, <= | 21 - is an integer. 21.80 - fractional number, through a dot |
contains | 21 - is an integer. 21.80 - fractional number, through a dot 21, 21.80 several numbers, separated by commas | |
Delivery Service | Select from a list | Selected delivery services from the list connected to the account |
Order Price | >, >=, <, <= | 21 - is an intege 21.80 - fractional number, through a dot |
contains | 21 - is an intege 21.80 - fractional number, through a dot, 21, 21.80 several numbers, separated by commas | |
Delivery Type | Select from a list | Delivery to door Delivery to pickup point All methods |
Delivery parameters | ||
Weight (gram) | >, >=, <, <=, = | Weight. Value 1000 = 1 кг |
Time | ||
Calculation time | >, >=, <, <= | Time in Moscow. / The time when the calculation was made in our system is compared. Those. comparison by the current time. |
Calculation date | >, >=, <, <= | Day of the week. / It is compared by the day of the week of receipt of the cargo. |
Tariff | ||
Delivery period | >, >=, <, <= | 2 - is an integer |
contains | 2 - is an imteger 1, 4 - several numbers, separated by commas | |
Cost of delivery | >, >=, <, <= | 21 - is an imteger 21.80 - fractional number, through a dot |
contains | 21 - is an imteger 21.80 - fractional number, through a dot 21, 21.80 - several numbers, separated by commas | |
minimum (at all tariffs) | More details about the operation algorithm of this operator are written in a separate article. Choose the minimum tariffs | |
minimum (at all tariffs of each delivery sevrive) | More details about the operation algorithm of this operator are written in a separate article. Choose the minimum tariffs | |
not minimum (at all tariffs) | More details about the operation algorithm of this operator are written in a separate article. Choose the minimum tariffs | |
not minimum (at all tariffs of each delivery sevrive) | More details about the operation algorithm of this operator are written in a separate article. Choose the minimum tariffs | |
Tariff | contains everything except | Tariffs selected from the list |
Reciever | ||
City | contains everything except | One or more cities separated by commas. Note. Some cities may have the same name, but different regions. Therefore, we recommend that you specify the region separately. When you select a city, the region is displayed in parentheses. The area in brackets must match at least one region in the “Region” condition |
Index | contains everything except | One or more indices separated by commas |
Country Code | contains everything except | One or more country codes, separated by commas, according to ISO 3166-1 alpha-2 |
Region | contains everything except | One or more redions separated by commas. |
If you need a rule for Moscow and the Moscow region, you need to create two separate rules, just like for Saint Petersburg. This is necessary because Moscow and Saint Petersburg are separate subjects of the Russian Federation
Priority of rules #
Changing the priority of a rule allows you to change the order of its execution. To raise the priority of a rule, you need to drag it on the [page of the rules list] (https://a.apiship.ru/#/editors/tariff/rules/list) to the very top, so it will be executed very first. Accordingly, the rule omitted at the very end of the [page of the rules list] (https://a.apiship.ru/#/editors/tariff/rules/list) will be executed last.
For example, the “Name” rule will be executed first. The Rounding rule will be executed last.
Examples #
Disabling and filtering tariffs #
Rule 1: Leave only favorable CDEK rates
Rule 2: Disable warehouse shipments by CDEK Delivery Service
If the disconnection of tariffs with departure from the warehouse occurs after searching for favorable tariffs, the user may not see the tariffs on the site.
It is necessary to increase the priority of rules that disable tariffs.
Markup and rounding #
Rule 1: Round up shipping costs to whole
Rule 2: 7% extra charge on the delivery cost of the order amount when ordering by the Russian Post
If the markup calculates after rounding, the calculator may give the user an un-rounded delivery amount.
It is necessary to increase the priority of the rules that manipulate the price.