> 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: getLoyaltyTransaction(loyaltyTransactionId: string) # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> transactions --> getLoyaltyTransaction # Method Link: https://dev.wix.com/docs/velo/apis/wix-loyalty-v2/transactions/get-loyalty-transaction.md # Method Description: Retrieves a transaction. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get loyalty transaction (Export from backend code) ```javascript import { transactions } from "wix-loyalty.v2"; import { webMethod, Permissions } from "wix-web-module"; import { elevate } from "wix-auth"; /* Sample loyaltyTransactionId value: * * { * "loyaltyTransactionId": "32ec5722-8727-475b-b499-3fe78af3ee99" * } */ const elevatedGetLoyaltyTransaction = elevate( transactions.getLoyaltyTransaction, ); export const getLoyaltyTransaction = webMethod( Permissions.Anyone, async (loyaltyTransactionId) => { try { const result = await elevatedGetLoyaltyTransaction(loyaltyTransactionId); return result; } catch (error) { console.error(error); // Handle the error } }, ); /* Promise resolves to: * * { * "_createdDate": "2024-06-06T13:18:13.233Z", * "_id": "32ec5722-8727-475b-b499-3fe78af3ee99", * "accountId": "d0dc5ba3-4a10-4cfc-b304-c976d8ac7303", * "amount": 20, * "description": "Refund", * "idempotencyKey": "32ec5722-8727-475b-b499-3fe78af3ee99", * "transactionType": "REFUND", * "refundInfo": { * "appId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df" * } * } */ ``` ## Get loyalty transaction (dashboard page code) ```javascript import { transactions } from "wix-loyalty.v2"; /* Sample loyaltyTransactionId value: * * { * "loyaltyTransactionId": "32ec5722-8727-475b-b499-3fe78af3ee99" * } */ async function getLoyaltyTransaction(loyaltyTransactionId) { try { const result = await transactions.getLoyaltyTransaction(loyaltyTransactionId); return result; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * * { * "_createdDate": "2024-06-06T13:18:13.233Z", * "_id": "32ec5722-8727-475b-b499-3fe78af3ee99", * "accountId": "d0dc5ba3-4a10-4cfc-b304-c976d8ac7303", * "amount": 20, * "description": "Refund", * "idempotencyKey": "32ec5722-8727-475b-b499-3fe78af3ee99", * "transactionType": "REFUND", * "refundInfo": { * "appId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df" * } * } */ ``` ---