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
3 enum supported values:
NO_CONDITIONSCONDITIONCONDITION_TREE

Specifies the type of condition.


conditionTypestring
3 enum supported values:
UNDEFINED_CONDITION_TYPECONDITIONCONDITION_TREE

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
3 enum supported values:
UNKNOWN_ROUNDING_STRATEGYHALF_UPHALF_EVEN

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:


amountobjectdeprecated - 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:


fixedFeeobject

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:


conditionobjectdeprecated - use conditionOptions instead

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


conditionTreeobjectdeprecated - 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:


conditionOptionsobject

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


conditionTreeOptionsobject

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.

Was this helpful?
Yes
No