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