Constructing a Rule

A rule has two main parts: conditions and a fee. When Calculate Service Fees is called, it assesses each rule in relation to the specified order. When a rule is assessed, if the conditions are met, the fee is included in the API's response.

Conditions

Conditions can be either a single condition or a condition tree.

A single condition evaluates a specific field in the order. For example, it could check if the value of the field is greater than a certain number.

A condition tree contains two conditions and an operator. The conditions can each be either a single condition or a condition tree. There are two operator values:

  • "AND": Both conditions must be met for the condition tree to be considered met.
  • "OR": At least one of the conditions must be met for the condition tree to be considered met.

Condition tree example

Conditions

For the service fee to be applied, we would need to satisfy these conditions:

  • The price subtotal is greater than 50
    AND
  • Either:
    • Delivery type is "DELIVERY"
      OR
    • Order is made in the mobile app

Example: Conditions are met

We have the following values:

  • Subtotal is 70
  • Delivery type is "DELIVERY"
  • Order is "WEBSITE"

In this case, the conditions are met, because the subtotal is greater than 50 and the delivery type is "DELIVERY". It doesn't matter that the platform isn't "MOBILE_APP" because we only need that OR delivery type to be "DELIVERY".

Example: Conditions are not met

We have the following values:

  • Subtotal is 30
  • Delivery type is "DELIVERY"
  • Order is "MOBILE_APP"

In this case, the conditions are not met, because even though the delivery type is "DELIVERY" and the platform is "MOBILE_APP", the subtotal is not greater than 50.

Fee

A fee is either a fixed amount or a percentage of the order's subtotal. It can also include tax.

If the conditions are met, the fee is calculated and applied when Calculate Service Fees is called.

Did this help?

Service Fees: Supported Filters and Sorting

The following table shows field support for filters and sorting for the rules object:

FieldSupported FiltersSortable
id$eq, $ne, $lt, $lte, $gt, $gte, $in, $hasSome, $hasAll, $startsWith, $containsSortable

Related content: API Query Language, Query Rules

Did this help?

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

JSON
{ "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" } }
Did this help?

POST

Calculate Service Fees


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Calculates service fees for an order.

The specified order information is evaluated against all rules created for the site. If the rule conditions are met, the service fee set in the rule is applied. Otherwise, no service fee is added.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/service-fees/v1/calculate

Body Params
orderOrderRequired

Order information needed to evaluate the rules and calculate the relevant fees.


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.

Response Object
calculatedFeesArray <CalculatedFee>

A list of calculated fees based on rules evaluation.

Calculate service fees
Request
cURL
curl -X POST https://www.wixapis.com/service-fees-rules/v1/calculate \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "order": { "shippingInfo": { "logistics": { "type": "PICKUP" } }, "platform": { "value": "SITE" }, "priceSummary": { "subtotal": "10" }, "currency": "USD" } }'
Response
JSON
{ "calculatedFees": [ { "ruleId": "a71ec83c-a705-4da4-8e70-237b7d7b838d", "name": "Rule 1", "fee": { "value": "10.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null }, { "ruleId": "bedea267-4b42-4727-b74a-9a8db48fd6db", "name": "2", "fee": { "value": "23.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null }, { "ruleId": "d84423ac-f73d-44a9-9ffb-f36fb163dc6b", "name": "service fee 1", "fee": { "value": "11.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null } ] }
Did this help?

GET

List Rules


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves an array of all rules.

You can filter by location or app that the rules are associated with.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/service-fees/v1/rules

Query Params
locationIdstring

Retrieve only rule that apply at the location with this ID. If this field is null, the rules will not be filtered by location.


labelstringdeprecated - use appId instead

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


appIdstring

Defines the app that the rule is connected to.

Response Object
rulesArray <Rule>

Array containing the retrieved rules.

List rules associated with a specific location and specific app
Request
cURL
curl -X GET https://www.wixapis.com/service-fees-rules/v1/rules \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "locationId": "d84423ab-f73d-44a9-9ffb-f36fb163dc6b", "appId": "d84429ab-f73d-44a9-9ffb-f36fb163dc6b" }'
Response
JSON
{ "rules": [ { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" }, "locationId": "d84423ab-f73d-44a9-9ffb-f36fb163dc6b" }, { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9", "locationId": "d84423ab-f73d-44a9-9ffb-f36fb163dc6b" } ] }
Did this help?

POST

Create Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a rule.

To create multiple rules at once, use Bulk Create Rules.

Read more about constructing a rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/service-fees/v1/rules

Body Params
ruleRuleRequired

Rule to create.

Response Object
ruleRule

Created rule

Request
cURL
curl -X POST https://www.wixapis.com/service-fees-rules/v1/rules \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "rule": { "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" } } }'
Response
JSON
{ "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" } } }
Event TriggersThis method triggers the following events:
Did this help?

GET

Get Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a rule.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/service-fees/v1/rules/{ruleId}

Path Params
ruleIdstringRequired

ID of the rule to retrieve.

Response Object
ruleRule

The retrieved rule.

Get a rule
Request
cURL
curl -X GET https://www.wixapis.com/service-fees-rules/v1/rules/4aea505e-ac49-4f72-b4f1-b07c064a20cd \ -H 'Authorization: <AUTH>'
Response
JSON
{ "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" } } }
Did this help?

DELETE

Delete Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a rule.

To delete mutiple rules at once, use Bulk Delete Rules.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
DELETE
https://www.wixapis.com/service-fees/v1/rules/{ruleId}

Path Params
ruleIdstringRequired

ID of the rule to delete.

Response Object
Returns an empty object.
Delete a rule
Request
cURL
curl -X DELETE https://www.wixapis.com/service-fees-rules/v1/rules/4aea505e-ac49-4f72-b4f1-b07c064a20cd \ -H 'Authorization: <AUTH>'
Response
JSON
{
Event TriggersThis method triggers the following events:
Did this help?

PATCH

Update Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a rule.

Each time the task is updated, revision increments by 1. The existing revision must be included when updating the task. This ensures you're working with the latest task and prevents unintended overwrites.

To update multiple rules at once, use Bulk Update Rules.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/service-fees/v1/rules/{rule.id}

Path Params
rule.idstringRequired

Rule ID.

Body Params
ruleRuleRequired

Rule to update.

Response Object
ruleRule

Updated rule.

Update a rule
Request
cURL
curl -X PATCH https://www.wixapis.com/service-fees-rules/v1/rules/update \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "rule": { "revision": "5", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" }, "mask": { "paths": [ "name", "taxRate", "conditionType", "enabled", "roundingStrategy", "customTaxRate", "conditionOptions", "percentageFee" ] } }'
Response
JSON
{ "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "6", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Query Rules


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of rules, given the provided paging, filtering, and sorting.

For field support for filters and sorting, see Service Fees: Supported Filters and Sorting.

Query Rules runs with these defaults, which you can override:

  • cursorPaging.limit is 50

To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/service-fees/v1/rules/query

Body Params
queryQueryRequired

Query options.

Response Object
rulesArray <Rule>

The retrieved rules.


pagingMetadataPagingMetadata

Paging metadata.

Query rules with filter and sort
Request
cURL
curl -X GET https://www.wixapis.com/service-fees-rules/v1/rules \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "query": { "sort": [ { "fieldName": "enabled", "order": "ASC" } ], "filter": { "name": "rule_name" } } }'
Response
JSON
{ "rules": [ { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" }, "locationId": "d84423ab-f73d-44a9-9ffb-f36fb163dc6b" }, { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9", "locationId": "d84423ab-f73d-44a9-9ffb-f36fb163dc6b" } ] }
Did this help?

POST

Bulk Create Rules


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Bulk creates rules.

To create only one rule, use Create Rule.

Read more about constructing a rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/service-fees/v1/bulk/rules/create

Body Params
rulesArray <Rule>Required

Rules to create.


returnFullEntityboolean

Whether the full rule entity is returned.
Default: false.

Response Object
resultsArray <BulkRuleResult>

The created rules. Omitted if returnFullEntity is set to false.


bulkActionMetadataBulkActionMetadata

Bulk Create Rule metadata.

Bulk create two rules
Request
cURL
curl -X POST https://www.wixapis.com/service-fees-rules/v1/rules/create \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --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 }'
Response
JSON
{ "results": [ { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "21.9", "conditionType": "CONDITION", "enabled": true, "roundingStrategy": "HALF_UP", "customTaxRate": "20", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "5.9", "operation": "GT" } }, "fixedFee": { "value": "21.3", "currency": "USD" } }, { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "1", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" } ], "bulkActionMetadata": { "totalSuccesses": 2, "totalFailures": 0, "undetailedFailures": 0 } }
Event TriggersThis method triggers the following events:
Did this help?

PATCH

Bulk Update Rules


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Bulk updates rules.

Each time the task is updated, revision increments by 1. The existing revision must be included when updating the task. This ensures you're working with the latest task and prevents unintended overwrites.

To update a single rule, use Update Rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/service-fees/v1/bulk/rules/update

Body Params
rulesArray <MaskedRule>Required

Masked rules to update.


returnFullEntityboolean

Whether the full rule entity is returned.
Default: false.

Response Object
resultsArray <BulkRuleResult>

The updated rules. Omitted if returnFullEntity is set to false.


bulkActionMetadataBulkActionMetadata

Bulk Update Rule metadata.

Bulk update rules
Request
cURL
curl -X PATCH https://www.wixapis.com/service-fees-rules/v1/rules/4aea505e-ac49-4f72-b4f1-b07c064a20cd \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "return_full_entity": true, "rules":[ { "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "5", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" }, "mask": { "paths": [ "name", "taxRate", "conditionType", "enabled", "roundingStrategy", "customTaxRate", "conditionOptions", "percentageFee" ] } } ] }'
Response
JSON
{ "results": [ { "itemMetadata": { "itemId": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "itemType": "RULE" }, "rule": { "id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd", "revision": "6", "createdDate": "2023-12-10T07:06:39.306Z", "updatedDate": "2023-12-10T07:06:39.306Z", "name": "rule_name", "taxRate": "12.9", "conditionType": "CONDITION", "enabled": false, "roundingStrategy": "HALF_EVEN", "customTaxRate": "11", "conditionOptions": { "orderFieldPath": "priceSummary.subtotal", "expectedFieldType": "NUMBER", "number": { "value": "10", "operation": "EQ" } }, "percentageFee": "11.9" } } ], "bulkActionMetadata": { "totalSuccesses": 1, "totalFailures": 0, "undetailedFailures": 0 } }
Event TriggersThis method triggers the following events:
Did this help?

DELETE

Bulk Delete Rules


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Bulk deletes rules.

To delete a single rule, use Delete Rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
DELETE
https://www.wixapis.com/service-fees/v1/bulk/rules/delete

Query Params
ruleIdsArray <string>Required

IDs of the rules to delete.

Response Object
resultsArray <BulkRuleResult>

Information about the deleted rules.


bulkActionMetadataBulkActionMetadata

Bulk Delete Rule metadata.

Bulk delete a rule
Request
cURL
curl -X DELETE https://www.wixapis.com/service-fees-rules/v1/rules/delete \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "rule_ids": [ "8f6dc28a-a915-446b-ae75-d201f9f462a9" ]' }'
Response
JSON
{ "results": [ { "itemMetadata": { "id": "8f6dc28a-a915-446b-ae75-d201f9f462a9", "originalIndex": 0, "success": true, "error": null }, "rule": null } ], "bulkActionMetadata": { "totalSuccesses": 1, "totalFailures": 0, "undetailedFailures": 0 } }
Event TriggersThis method triggers the following events:
Did this help?

Rule Created


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.service.fees.v1.rule.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.service.fees.v1.rule_created", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

RuleCreated
JSON
{ "id": "123a9562-0ef1-433e-864d-9e62454d4971", "entityFqdn": "wix.service.fees.v1.rule", "slug": "created", "entityId": "3799059d-260f-4f7f-b515-4fe3988a5540", "createdEvent": { "entity": "{\"id\":\"3799059d-260f-4f7f-b515-4fe3988a5540\",\"name\":\"Rule Name\",\"createdDate\":\"2024-01-28T14:16:28.525Z\",\"updatedDate\":\"2024-01-28T14:16:28.525Z\",\"amount\":{\"value\":\"10\",\"currency\":\"EUR\"},\"fixedFee\":{\"value\":\"10\",\"currency\":\"EUR\"},\"condition\":{\"path\":\"shippingInfo.logistics.type\",\"orderFieldPath\":\"shippingInfo.logistics.type\",\"expectedType\":{\"value\":\"STRING\"},\"expectedFieldType\":\"STRING\",\"list\":{\"values\":[\"DELIVERY\"]}},\"conditionsType\":\"CONDITION\",\"conditionType\":\"CONDITION\",\"conditionOptions\":{\"path\":\"shippingInfo.logistics.type\",\"orderFieldPath\":\"shippingInfo.logistics.type\",\"expectedType\":{\"value\":\"STRING\"},\"expectedFieldType\":\"STRING\",\"list\":{\"values\":[\"DELIVERY\"]}},\"enabled\":true,\"revision\":\"1\",\"appId\":\"9a5d83fd-8570-482e-81ab-cfa88942ee60\",\"roundingStrategy\":\"UNKNOWN_ROUNDING_STRATEGY\"}" }, "eventTime": "2024-01-28T14:16:28.535118309Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?

Rule Deleted


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.service.fees.v1.rule.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.service.fees.v1.rule_deleted", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

RuleDeleted
JSON
{ "id": "784867e9-9168-4781-b804-db19450837e8", "entityFqdn": "wix.service.fees.v1.rule", "slug": "deleted", "entityId": "3799059d-260f-4f7f-b515-4fe3988a5540", "deletedEvent": { "movedToTrash": true }, "eventTime": "2024-01-28T14:27:42.514939826Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "3" }
Did this help?

Rule Updated


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.service.fees.v1.rule.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.service.fees.v1.rule_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

RuleUpdated
JSON
{ "id": "88ff68de-2ad5-47c8-8872-c2479408bc5d", "entityFqdn": "wix.service.fees.v1.rule", "slug": "updated", "entityId": "3799059d-260f-4f7f-b515-4fe3988a5540", "updatedEvent": { "currentEntity": "{\"id\":\"3799059d-260f-4f7f-b515-4fe3988a5540\",\"name\":\"Rule Name 2\",\"createdDate\":\"2024-01-28T14:16:28.525Z\",\"updatedDate\":\"2024-01-28T14:25:47.220Z\",\"amount\":{\"value\":\"10\",\"currency\":\"EUR\"},\"fixedFee\":{\"value\":\"10\",\"currency\":\"EUR\"},\"condition\":{\"path\":\"shippingInfo.logistics.type\",\"orderFieldPath\":\"shippingInfo.logistics.type\",\"expectedType\":{\"value\":\"STRING\"},\"expectedFieldType\":\"STRING\",\"list\":{\"values\":[\"DELIVERY\"]}},\"conditionsType\":\"CONDITION\",\"conditionType\":\"CONDITION\",\"conditionOptions\":{\"path\":\"shippingInfo.logistics.type\",\"orderFieldPath\":\"shippingInfo.logistics.type\",\"expectedType\":{\"value\":\"STRING\"},\"expectedFieldType\":\"STRING\",\"list\":{\"values\":[\"DELIVERY\"]}},\"enabled\":true,\"revision\":\"2\",\"appId\":\"9a5d83fd-8570-482e-81ab-cfa88942ee60\",\"roundingStrategy\":\"UNKNOWN_ROUNDING_STRATEGY\"}" }, "eventTime": "2024-01-28T14:25:47.328707384Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "2" }
Did this help?