Swagger API Личный кабинет Центр поддержки

Creating and editing a rule #

img

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.
img

Available actions in the rules #

img

ActionAvailable operatorsPossible value/ DescriptionTemplate variables
Tariff
Tariff nameAny textcan be used
Tariff descriptionAny textcan 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 #

img

List of variables

  1. [providerName] - Provider name. That is, in the part of the text this variable will be replaced with the provider name (delivery service).
  2. [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.
  3. [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 #

img

ConditionsAvailable OperatorsPossible Values / Description
General
Estimated value>, >=, <, <=21 - is an integer. 21.80 - fractional number, through a dot
contains21 - is an integer. 21.80 - fractional number, through a dot 21, 21.80 several numbers, separated by commas
Delivery ServiceSelect from a listSelected delivery services from the list connected to the account
Order Price>, >=, <, <=21 - is an intege 21.80 - fractional number, through a dot
contains21 - is an intege 21.80 - fractional number, through a dot, 21, 21.80 several numbers, separated by commas
Delivery TypeSelect from a listDelivery 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
contains2 - is an imteger 1, 4 - several numbers, separated by commas
Cost of delivery>, >=, <, <=21 - is an imteger 21.80 - fractional number, through a dot
contains21 - 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
Tariffcontains everything exceptTariffs selected from the list img
Reciever
Citycontains everything exceptOne 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
Indexcontains everything exceptOne or more indices separated by commas
Country Codecontains everything exceptOne or more country codes, separated by commas, according to ISO 3166-1 alpha-2
Regioncontains everything exceptOne 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.

img

Examples #

Disabling and filtering tariffs #

Rule 1: Leave only favorable CDEK rates

img

Rule 2: Disable warehouse shipments by CDEK Delivery Service

img

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.

img

It is necessary to increase the priority of rules that disable tariffs.

img

Markup and rounding #

Rule 1: Round up shipping costs to whole

img

Rule 2: 7% extra charge on the delivery cost of the order amount when ordering by the Russian Post

img

If the markup calculates after rounding, the calculator may give the user an un-rounded delivery amount.

img

It is necessary to increase the priority of the rules that manipulate the price.

img