> 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: onAccountPointsUpdated(event: AccountPointsUpdated) # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> onAccountPointsUpdated # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/loyalty/events/on-account-points-updated.md # Method Description: Triggered when the points of a loyalty account 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 triggered when a the points of 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_onAccountPointsUpdated(event) { const eventId = event.metadata.id; const accountBalance = event.data.account.points.balance; console.log('Current account balance: ', accountBalance); console.log(event); } /* Full event object: * { * "metadata": { * "id":"447912e4-b460-4eba-9bd2-3c19b64ddce0", * "entityId":"1ab8f49c-a329-4ddc-a31d-814afbb3b565", * "eventTime":"2023-01-18T13:16:53.000613Z", * "triggeredByAnonymizeRequest":false * }, * "data": { * "account": { * "_id":"1ab8f49c-a329-4ddc-a31d-814afbb3b565", * "contactId":"3128dc64-74fc-442f-aa32-e8e871dad141", * "memberId":"3128dc64-74fc-442f-aa32-e8e871dad141", * "points": { * "balance":95, * "earned":45, * "adjusted":50, * "redeemed":0 * }, * "rewardAvailable":true, * "_createdDate":"2022-11-28T11:57:30.722Z", * "_updatedDate":"2023-01-18T13:16:52.982Z", * "lastActivityDate":"2023-01-18T13:16:52.980Z", * "revision":"13", * "tier": { * "_id":"a8a2bc2b-6957-40a6-9f20-a1bfe52d14de", * "_updatedDate":"2023-01-18T13:16:52.980Z", * "points":95 * } * } * } * } */ ``` ---