> 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: onAccountUpdated(event: AccountUpdated) # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> onAccountUpdated # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/loyalty/events/on-account-updated.md # Method Description: Triggered when a loyalty account is updated, including when points are adjusted, earned, or redeemed. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event that triggers when a loyalty account is updated ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixLoyalty_onAccountUpdated(event) { const eventId = event.metadata.id; const updatedDate = event.entity._updatedDate; console.log('Account was last updated on ', updatedDate); console.log(event); } /* Full event object: * { * "metadata": { * "id":"e6576ab6-1439-4f20-b698-3b2aa82087c8", * "entityId":"f0411f1a-ad5a-4b80-94c2-34350cbf1af7", * "eventTime":"2023-01-02T00:45:02.145871Z", * "triggeredByAnonymizeRequest":false * }, * "entity": { * "_id":"f0411f1a-ad5a-4b80-94c2-34350cbf1af7", * "contactId":"8a71f711-f77b-43fe-9e3d-5c243f94b2cd", * "points": { * "balance":50, * "earned":50, * "adjusted":0, * "redeemed":0 * }, * "rewardAvailable":false, * "_createdDate":"2022-11-09T06:44:48.159Z", * "_updatedDate":"2023-01-02T00:45:02.091Z", * "lastActivityDate":"2022-11-09T14:54:57.349Z", * "revision":"1226" * } * } */ ``` ---