> 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 # Resource: Earning Rules # Type: Loyalty Earning Rule Object # Link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/loyalty-program-management/earning-rules/loyalty-earning-rule-object.md ## Description: A loyalty earning rule defines how customers earn points in a loyalty program. You can create rules for different activities, such as making purchases. ## Schema: ```json Type: Loyalty Earning Rule Object | type: LoyaltyEarningRule Description: A loyalty earning rule defines how customers earn points in a loyalty program. You can create rules for different activities, such as making purchases. - name: id | type: string | description: Loyalty earning rule ID. - name: value | type: string | description: - name: sourceAppId | type: string | description: ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID. - name: triggerAppId | type: string | description: ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events. - name: triggerActivityType | type: string | description: Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`. - name: title | type: string | description: Name of the earning rule. - name: status | type: string | description: Current status of the earning rule. enum: UNKNOWN, ACTIVE, PAUSED - name: revision | type: string | description: Revision number, incremented by 1 each time the earning rule is updated. Pass the latest `revision` when updating to prevent conflicting changes. - name: value | type: number | description: - name: createdDate | type: string | description: Date and time the earning rule was created. - name: seconds | type: string | description: - name: nanos | type: number | description: - name: updatedDate | type: string | description: Date and time the earning rule was last updated. - name: metadata | type: Metadata | description: Additional metadata about the earning rule. - name: canBeDeleted | type: boolean | description: Whether the earning rule can be deleted. - name: triggerFilters | type: Array | description: Trigger filters parsed from automation configuration. Only present for automation-based rules with filters. - name: fieldKey | type: string | description: Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId"). - name: values | type: Array | description: Parsed entity IDs that the filter matches against. ```