Rule Object


A rule defines the fee that is applied when specific conditions (also defined by the rule) are met. You can use a rule to apply a service fee to a restaurant order.

Properties
idstringRead-only

Rule ID.


locationIdstringformat GUID

ID of the restaurant’s location.


namestringmaxLength 50minLength 1

Rule name.


createdDatestringRead-onlyformat date-time

Date and time the rule was created.


updatedDatestringRead-onlyformat date-time

Date and time the rule was updated.


taxRatestringdeprecated - use taxes insteaddecimalValue {"maxScale":2,"gte":"0","lte":"100"}

Percentage value to apply as a custom tax rate. For example, 5 respresents a 5% fee applied to the order's total.

Min: '0'.

Max: 100.


conditionsTypestringdeprecated - use conditionType instead

Specifies the type of condition.


conditionTypestring

Specifies the type of condition.


enabledboolean

Whether the rule is enabled. If true, the rule is evaluated when service fees are calculated. If false, the rule will not be evaluated when service fees are calculated.


revisionintegerRead-onlyformat uint64

Revision number. Increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule.


labelstringdeprecated - use appId insteadmaxLength 100minLength 1

DEPRECATED. Defines the app that the rule is connected to.


appIdstringformat GUID

Defines the app that the rule is connected to.


roundingStrategystring

Rounding strategy to apply to fee and tax calculation.

  • HALF_UP rounds up any number exactly halfway between two integers. For example, 2.5 rounds to 3, and 3.5 and rounds to 4.
  • HALF_EVEN rounds such numbers to the nearest even integer. For example, 2.5 rounds to 2, but 3.5 rounds to 4.

ONE OF:

amountAmountdeprecated - use fixedFee instead

Fixed fee. Must hold a positive value.


percentagestringdeprecated - use percentageFee insteaddecimalValue {"maxScale":2,"gte":"0","lte":"100"}

Percentage fee. For example, 5 respresents a 5% fee applied to the order's total.


ONE OF:

fixedFeeFixedFee

Fixed fee. Must hold a positive value.


percentageFeestringdecimalValue {"maxScale":2,"gte":"0","lte":"100"}

Percentage fee. For example, 5 respresents a 5% fee applied to the order's total.


ONE OF:

conditionConditiondeprecated - use conditionOptions instead

Single condition that must be met for the rule to be applied to an order.


conditionTreeConditionTreedeprecated - use conditionTreeOptions instead

Binary tree of conditions. Use the operator to indicate whether only one or both conditions must be met in order for a service fee rule to be applied to an order.


ONE OF:

conditionOptionsConditionOptions

Single condition that must be met for the rule to be applied to an order.


conditionTreeOptionsConditionTreeOptions

Binary tree of conditions. Use the operator to indicate whether only one or both conditions must be met in order for a service fee rule to be applied to an order.


ONE OF:

customTaxRatestring

Percentage value to apply as a custom tax rate. Range: [0-100].


taxGroupIdstringformat GUID

Tax group ID. Internal only.

Did this help?