> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # BulkCreateRules # Package: serviceFees # Namespace: ServiceFeesRules # Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/service-fees/rules/bulk-create-rules.md ## Permission Scopes: Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES ## Introduction Bulk creates rules. To create only one rule, use [Create Rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/create-rule.md). Read more about [constructing a rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/constructing-a-rule.md). --- ## REST API ### Schema ``` Method: bulkCreateRules Description: Bulk creates rules. To create only one rule, use [Create Rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/create-rule.md). Read more about [constructing a rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/constructing-a-rule.md). URL: https://www.wixapis.com/service-fees/v1/bulk/rules/create Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: rules Method parameters: param name: returnFullEntity | type: returnFullEntity | description: Whether the full rule entity is returned.
Default: `false`. param name: rules | type: array | description: Rules to create. | required: true - ONE-OF: - ONE-OF: - name: fixedFee | type: Money | description: Fixed fee. Must hold a positive value. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentageFee | type: string | description: Percentage fee. For example, `5` represents a 5% fee applied to the order's total. - ONE-OF: - ONE-OF: - name: conditionOptions | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - ONE-OF: - name: number | type: Number | description: Contains a numeric value and an operation. Required if `expectedFieldType` is `NUMBER`. - name: value | type: number | description: Numeric value to compare with the value of the specified field. - name: operation | type: Operation | description: Operation to use. - enum: - EQ: Equal to. - LT: Strictly less than. - LE: Less than or equal to. - GT: Strictly greater than. - GE: Greater than or equal to. - name: list | type: List | description: Contains an array of strings to compare with the value of the specified field. If the value of the field matches a string in the array, the condition is considered met. Required if `expectedFieldType` is `LIST`. - name: values | type: array | description: Array of string values to compare with the value of the field. If the value of the fields matches a string in the array, the condition is considered met. - name: orderFieldPath | type: string | description: Path of the field in the order entity that this condition will evaluate. For example, `priceSummary.subtotal`. - name: expectedFieldType | type: ExpectedFieldType | description: Type of the field specified in `orderFieldPath`. For example, the type of `priceSummary.subtotal` is `"NUMBER"`). - enum: - UNKNOWN_EXPECTED_FIELD_TYPE: Unknown expected field type - NUMBER: Represents a number value. - STRING: Represents a string value. - name: conditionTreeOptions | type: ConditionTree | description: 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: - name: leftCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: leftConditionsTree | type: ConditionTree | description: 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: - name: rightCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: rightConditionsTree | type: ConditionTree | description: 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. - name: operator | type: Operator | description: Specifies the logical operator to use when combining the evaluation of the left and right conditions. - enum: - AND: The condition is true if both the left and right sides are true. - OR: The condition is true if either the left or right side is true. - ONE-OF: - name: customTaxRate | type: string | description: Percentage value to apply as a custom tax rate. Range: [0-100]. - name: taxGroupId | type: string | description: Tax group GUID. Internal only. - name: locationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the rule. - name: name | type: string | description: Rule name. - name: conditionType | type: ConditionType | description: Specifies the type of condition. - enum: - UNDEFINED_CONDITION_TYPE: Indicates that the Rule has no conditions specified. - CONDITION: Indicates that the Rule has a single Condition. - CONDITION_TREE: Indicates that the Rule has a complex condition specified as a ConditionTree. - name: enabled | type: boolean | description: 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. - name: appId | type: string | description: Defines the app that the rule is connected to. - name: roundingStrategy | type: RoundingStrategy | description: Rounding strategy to apply to fee and tax calculation. - enum: - 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`. - name: extendedFields | type: ExtendedFields | description: Data Extensions - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of rules. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. Return type: BulkCreateRulesResponse - name: results | type: array | description: The created rules. Omitted if `returnFullEntity` is set to false. - name: itemMetadata | type: ItemMetadata | description: Metadata of the rule. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: rule | type: Rule | description: The created rule. - ONE-OF: - ONE-OF: - name: fixedFee | type: Money | description: Fixed fee. Must hold a positive value. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentageFee | type: string | description: Percentage fee. For example, `5` represents a 5% fee applied to the order's total. - ONE-OF: - ONE-OF: - name: conditionOptions | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - ONE-OF: - name: number | type: Number | description: Contains a numeric value and an operation. Required if `expectedFieldType` is `NUMBER`. - name: value | type: number | description: Numeric value to compare with the value of the specified field. - name: operation | type: Operation | description: Operation to use. - enum: - EQ: Equal to. - LT: Strictly less than. - LE: Less than or equal to. - GT: Strictly greater than. - GE: Greater than or equal to. - name: list | type: List | description: Contains an array of strings to compare with the value of the specified field. If the value of the field matches a string in the array, the condition is considered met. Required if `expectedFieldType` is `LIST`. - name: values | type: array | description: Array of string values to compare with the value of the field. If the value of the fields matches a string in the array, the condition is considered met. - name: orderFieldPath | type: string | description: Path of the field in the order entity that this condition will evaluate. For example, `priceSummary.subtotal`. - name: expectedFieldType | type: ExpectedFieldType | description: Type of the field specified in `orderFieldPath`. For example, the type of `priceSummary.subtotal` is `"NUMBER"`). - enum: - UNKNOWN_EXPECTED_FIELD_TYPE: Unknown expected field type - NUMBER: Represents a number value. - STRING: Represents a string value. - name: conditionTreeOptions | type: ConditionTree | description: 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: - name: leftCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: leftConditionsTree | type: ConditionTree | description: 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: - name: rightCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: rightConditionsTree | type: ConditionTree | description: 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. - name: operator | type: Operator | description: Specifies the logical operator to use when combining the evaluation of the left and right conditions. - enum: - AND: The condition is true if both the left and right sides are true. - OR: The condition is true if either the left or right side is true. - ONE-OF: - name: customTaxRate | type: string | description: Percentage value to apply as a custom tax rate. Range: [0-100]. - name: taxGroupId | type: string | description: Tax group GUID. Internal only. - name: id | type: string | description: Rule GUID. - name: locationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the rule. - name: name | type: string | description: Rule name. - name: createdDate | type: string | description: Date and time the rule was created. - name: updatedDate | type: string | description: Date and time the rule was updated. - name: conditionType | type: ConditionType | description: Specifies the type of condition. - enum: - UNDEFINED_CONDITION_TYPE: Indicates that the Rule has no conditions specified. - CONDITION: Indicates that the Rule has a single Condition. - CONDITION_TREE: Indicates that the Rule has a complex condition specified as a ConditionTree. - name: enabled | type: boolean | description: 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. - name: revision | type: string | description: 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. - name: appId | type: string | description: Defines the app that the rule is connected to. - name: roundingStrategy | type: RoundingStrategy | description: Rounding strategy to apply to fee and tax calculation. - enum: - 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`. - name: extendedFields | type: ExtendedFields | description: Data Extensions - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of rules. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk Create Rule metadata. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` ### Examples ### Bulk create two rules ```curl curl -X POST https://www.wixapis.com/service-fees-rules/v1/rules/create \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ --data-raw '{ "rules": [ { "name": "rule_name", "tax_rate": "21.9", "condition_type": "CONDITION", "enabled": true, "rounding_strategy": "HALF_UP", "custom_tax_rate": "20", "condition_options": { "order_field_path": "priceSummary.subtotal", "expected_field_type": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixed_fee": { "value": "21.3", "currency": "USD" } }, { "name": "rule_name", "tax_rate": "12.9", "condition_type": "CONDITION", "enabled": false, "rounding_strategy": "HALF_EVEN", "custom_tax_rate": "11", "condition_options": { "order_field_path": "priceSummary.subtotal", "expected_field_type": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentage_fee": "11.9" } ], "return_full_entity": true }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.serviceFees.ServiceFeesRules.bulkCreateRules(rules, options) Description: Bulk creates rules. To create only one rule, use [Create Rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/create-rule.md). Read more about [constructing a rule](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/service-fees/rules/constructing-a-rule.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: rules Method parameters: param name: options | type: BulkCreateRulesOptions none - name: returnFullEntity | type: boolean | description: Whether the full rule entity is returned.
Default: `false`. param name: rules | type: array | description: Rules to create. | required: true - ONE-OF: - ONE-OF: - name: fixedFee | type: Money | description: Fixed fee. Must hold a positive value. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentageFee | type: string | description: Percentage fee. For example, `5` represents a 5% fee applied to the order's total. - ONE-OF: - ONE-OF: - name: conditionOptions | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - ONE-OF: - name: number | type: Number | description: Contains a numeric value and an operation. Required if `expectedFieldType` is `NUMBER`. - name: value | type: number | description: Numeric value to compare with the value of the specified field. - name: operation | type: Operation | description: Operation to use. - enum: - EQ: Equal to. - LT: Strictly less than. - LE: Less than or equal to. - GT: Strictly greater than. - GE: Greater than or equal to. - name: list | type: List | description: Contains an array of strings to compare with the value of the specified field. If the value of the field matches a string in the array, the condition is considered met. Required if `expectedFieldType` is `LIST`. - name: values | type: array | description: Array of string values to compare with the value of the field. If the value of the fields matches a string in the array, the condition is considered met. - name: orderFieldPath | type: string | description: Path of the field in the order entity that this condition will evaluate. For example, `priceSummary.subtotal`. - name: expectedFieldType | type: ExpectedFieldType | description: Type of the field specified in `orderFieldPath`. For example, the type of `priceSummary.subtotal` is `"NUMBER"`). - enum: - UNKNOWN_EXPECTED_FIELD_TYPE: Unknown expected field type - NUMBER: Represents a number value. - STRING: Represents a string value. - name: conditionTreeOptions | type: ConditionTree | description: 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: - name: leftCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: leftConditionsTree | type: ConditionTree | description: 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: - name: rightCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: rightConditionsTree | type: ConditionTree | description: 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. - name: operator | type: Operator | description: Specifies the logical operator to use when combining the evaluation of the left and right conditions. - enum: - AND: The condition is true if both the left and right sides are true. - OR: The condition is true if either the left or right side is true. - ONE-OF: - name: customTaxRate | type: string | description: Percentage value to apply as a custom tax rate. Range: [0-100]. - name: taxGroupId | type: string | description: Tax group GUID. Internal only. - name: locationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the rule. - name: name | type: string | description: Rule name. - name: conditionType | type: ConditionType | description: Specifies the type of condition. - enum: - UNDEFINED_CONDITION_TYPE: Indicates that the Rule has no conditions specified. - CONDITION: Indicates that the Rule has a single Condition. - CONDITION_TREE: Indicates that the Rule has a complex condition specified as a ConditionTree. - name: enabled | type: boolean | description: 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. - name: appId | type: string | description: Defines the app that the rule is connected to. - name: roundingStrategy | type: RoundingStrategy | description: Rounding strategy to apply to fee and tax calculation. - enum: - 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`. - name: extendedFields | type: ExtendedFields | description: Data Extensions - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of rules. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. Return type: PROMISE - name: results | type: array | description: The created rules. Omitted if `returnFullEntity` is set to false. - name: itemMetadata | type: ItemMetadata | description: Metadata of the rule. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: rule | type: Rule | description: The created rule. - ONE-OF: - ONE-OF: - name: fixedFee | type: Money | description: Fixed fee. Must hold a positive value. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentageFee | type: string | description: Percentage fee. For example, `5` represents a 5% fee applied to the order's total. - ONE-OF: - ONE-OF: - name: conditionOptions | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - ONE-OF: - name: number | type: Number | description: Contains a numeric value and an operation. Required if `expectedFieldType` is `NUMBER`. - name: value | type: number | description: Numeric value to compare with the value of the specified field. - name: operation | type: Operation | description: Operation to use. - enum: - EQ: Equal to. - LT: Strictly less than. - LE: Less than or equal to. - GT: Strictly greater than. - GE: Greater than or equal to. - name: list | type: List | description: Contains an array of strings to compare with the value of the specified field. If the value of the field matches a string in the array, the condition is considered met. Required if `expectedFieldType` is `LIST`. - name: values | type: array | description: Array of string values to compare with the value of the field. If the value of the fields matches a string in the array, the condition is considered met. - name: orderFieldPath | type: string | description: Path of the field in the order entity that this condition will evaluate. For example, `priceSummary.subtotal`. - name: expectedFieldType | type: ExpectedFieldType | description: Type of the field specified in `orderFieldPath`. For example, the type of `priceSummary.subtotal` is `"NUMBER"`). - enum: - UNKNOWN_EXPECTED_FIELD_TYPE: Unknown expected field type - NUMBER: Represents a number value. - STRING: Represents a string value. - name: conditionTreeOptions | type: ConditionTree | description: 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: - name: leftCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: leftConditionsTree | type: ConditionTree | description: 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: - name: rightCondition | type: Condition | description: Single condition that must be met for the rule to be applied to an order. - name: rightConditionsTree | type: ConditionTree | description: 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. - name: operator | type: Operator | description: Specifies the logical operator to use when combining the evaluation of the left and right conditions. - enum: - AND: The condition is true if both the left and right sides are true. - OR: The condition is true if either the left or right side is true. - ONE-OF: - name: customTaxRate | type: string | description: Percentage value to apply as a custom tax rate. Range: [0-100]. - name: taxGroupId | type: string | description: Tax group GUID. Internal only. - name: _id | type: string | description: Rule GUID. - name: locationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the rule. - name: name | type: string | description: Rule name. - name: _createdDate | type: Date | description: Date and time the rule was created. - name: _updatedDate | type: Date | description: Date and time the rule was updated. - name: conditionType | type: ConditionType | description: Specifies the type of condition. - enum: - UNDEFINED_CONDITION_TYPE: Indicates that the Rule has no conditions specified. - CONDITION: Indicates that the Rule has a single Condition. - CONDITION_TREE: Indicates that the Rule has a complex condition specified as a ConditionTree. - name: enabled | type: boolean | description: 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. - name: revision | type: string | description: 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. - name: appId | type: string | description: Defines the app that the rule is connected to. - name: roundingStrategy | type: RoundingStrategy | description: Rounding strategy to apply to fee and tax calculation. - enum: - 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`. - name: extendedFields | type: ExtendedFields | description: Data Extensions - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of rules. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk Create Rule metadata. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` ### Examples ### bulkCreateRules ```javascript import { serviceFees } from '@wix/restaurants'; async function bulkCreateRules(rules,options) { const response = await serviceFees.bulkCreateRules(rules,options); }; ``` ### bulkCreateRules (with elevated permissions) ```javascript import { serviceFees } from '@wix/restaurants'; import { auth } from '@wix/essentials'; async function myBulkCreateRulesMethod(rules,options) { const elevatedBulkCreateRules = auth.elevate(serviceFees.bulkCreateRules); const response = await elevatedBulkCreateRules(rules,options); } ``` ### bulkCreateRules (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { serviceFees } from '@wix/restaurants'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { serviceFees }, // Include the auth strategy and host as relevant }); async function bulkCreateRules(rules,options) { const response = await myWixClient.serviceFees.bulkCreateRules(rules,options); }; ``` ---