This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
You can only call this method when authenticated as a Wix app or Wix user identity.
Rules to create.
Whether the full rule entity is returned.
Default: false
.
The created rules. Omitted if returnFullEntity
is set to false.
Bulk Create Rule metadata.
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
}'
{
"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
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.