> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: createRule(rule: Rule) # Method package: wixRestaurantsV2 # Method menu location: wixRestaurantsV2 --> serviceFees --> createRule # Method Link: https://dev.wix.com/docs/velo/apis/wix-restaurants-v2/service-fees/create-rule.md # Method Description: The `createRule()` function returns a Promise that resolves to the created rule. To create multiple rules at once, use the `bulkCreateRules()` function. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## createRule example for dashboard page code ```javascript import { serviceFees } from 'wix-restaurants.v2'; async function createRule(rule) { try { const result = await serviceFees.createRule(rule); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## createRule example for exporting from backend code ```javascript import { serviceFees } from 'wix-restaurants.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedCreateRule = elevate(serviceFees.createRule); export const createRule = webMethod( Permissions.Anyone, async (rule) => { try { const result = await elevatedCreateRule(rule); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---