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.
You can only call this method when authenticated as a Wix app or Wix user identity.
Rule to create.
Created rule
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"
}
}
}'
{
"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"
}
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.