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