POST

Calculate Service Fees


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Calculates service fees for an order.

The specified order information is evaluated against all rules created for the site. If the rule conditions are met, the service fee set in the rule is applied. Otherwise, no service fee is added.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/service-fees/v1/calculate

Body Params
orderOrderRequired

Order information needed to evaluate the rules and calculate the relevant fees.


labelstringdeprecated - use appId insteadmaxLength 100minLength 1

DEPRECATED. Defines the app that the rule is connected to.


appIdstringformat GUID

Defines the app that the rule is connected to.

Response Object
calculatedFeesArray <CalculatedFee>

A list of calculated fees based on rules evaluation.

Calculate service fees
Request
cURL
curl -X POST https://www.wixapis.com/service-fees-rules/v1/calculate \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "order": { "shippingInfo": { "logistics": { "type": "PICKUP" } }, "platform": { "value": "SITE" }, "priceSummary": { "subtotal": "10" }, "currency": "USD" } }'
Response
JSON
{ "calculatedFees": [ { "ruleId": "a71ec83c-a705-4da4-8e70-237b7d7b838d", "name": "Rule 1", "fee": { "value": "10.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null }, { "ruleId": "bedea267-4b42-4727-b74a-9a8db48fd6db", "name": "2", "fee": { "value": "23.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null }, { "ruleId": "d84423ac-f73d-44a9-9ffb-f36fb163dc6b", "name": "service fee 1", "fee": { "value": "11.00", "currency": "EUR", "formattedValue": null }, "tax": null, "taxGroupId": null } ] }
Errors

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

Did this help?