getRule( )


Developer Preview

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

The createRule() function returns a Promise that resolves to the retrieved rule.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function getRule(ruleId: string): Promise<Rule>;
Method Parameters
ruleIdstringRequired

ID of the rule to retrieve.

Returns
Return Type:Promise<Rule>
JavaScript
import { serviceFees } from "wix-restaurants.v2"; async function getRule(ruleId) { try { const result = await serviceFees.getRule(ruleId); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

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

Did this help?