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 } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?