Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Transaction History
Retrieve member’s transaction history, while asynchronously requesting data from the
Transaction History API.
Resource
1getTransactions(for:pageNumber:journalTypeName:journalSubTypeName:periodStartDate:periodEndDate:version:devMode:)Signature
1public func getTransactions(
2 for membershipNumber: String,
3 pageNumber: Int? = nil,
4 journalTypeName: String? = nil,
5 journalSubTypeName: String? = nil,
6 periodStartDate: String? = nil,
7 periodEndDate: String? = nil,
8 version: String = LoyaltyAPIVersion.defaultVersion,
9 devMode: Bool = false) async throws -> [TransactionJournal]Input Parameters
| Parameter Name | Type | Description | Required or Optional |
|---|---|---|---|
| devMode | Boolean | Indicates whether the request is run in developer mode (true) or not (false). | Optional |
| journalSubTypeName | String | The subtype of the transaction journal record. | Optional |
| journalTypeName | String | The type of the transaction journal record. Possible values are:
|
Optional |
| membershipNumber | String | Unique identifier of the member whose transactions are being retrieved. | Required |
| pageNumber | Integer | The page number to be returned. If you don’t specify a value, the first page is returned. Each page contains 200 transactions, sorted by their date of creation. | Optional |
| periodStartDate | String | Retrieve transaction journals starting on this date. | Optional |
| periodEndDate | String | Retrieve transaction journals until this date. | Optional |
| version | String | Version of the API. The request body is available in version 55.0 and later. | Optional |
Sample Output
1{
2 "message": null,
3 "status": true,
4 "transactionJournalCount": 4,
5 "transactionJournals": [
6 {
7 "activityDate": "2023-04-08T04:59:40.000Z",
8 "additionalTransactionJournalAttributes": [],
9 "journalTypeName": "Manual Points Adjustment",
10 "pointsChange": [
11 {
12 "changeInPoints": 100.0,
13 "loyaltyMemberCurrency": "Reward Points"
14 }
15 ],
16 "transactionJournalId": "0lVRO00000002og2AA",
17 "transactionJournalNumber": "00000035"
18 },
19 {
20 "activityDate": "2023-04-08T04:58:07.000Z",
21 "additionalTransactionJournalAttributes": [],
22 "journalTypeName": "Manual Points Adjustment",
23 "pointsChange": [
24 {
25 "changeInPoints": 300.0,
26 "loyaltyMemberCurrency": "Reward Points"
27 }
28 ],
29 "transactionJournalId": "0lVRO00000002ob2AA",
30 "transactionJournalNumber": "00000034"
31 },
32 {
33 "activityDate": "2023-04-08T04:56:38.000Z",
34 "additionalTransactionJournalAttributes": [],
35 "journalTypeName": "Manual Points Adjustment",
36 "pointsChange": [
37 {
38 "changeInPoints": -100.0,
39 "loyaltyMemberCurrency": "Reward Points"
40 }
41 ],
42 "transactionJournalId": "0lVRO00000002oW2AQ",
43 "transactionJournalNumber": "00000033"
44 },
45 {
46 "activityDate": "2022-03-08T04:53:19.000Z",
47 "additionalTransactionJournalAttributes": [],
48 "journalTypeName": "Manual Points Adjustment",
49 "pointsChange": [
50 {
51 "changeInPoints": 100.0,
52 "loyaltyMemberCurrency": "Reward Points"
53 }
54 ],
55 "transactionJournalId": "0lVRO00000002oR2AQ",
56 "transactionJournalNumber": "00000032"
57 }
58 ]
59}Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| externalTransactionNumber | String | The transaction journal record ID from an external source system. |
| message | String | The message explaining why the request failed. |
| status | Boolean | Indicates whether the request succeeded (true) or failed (false). |
| transactionJournalCount | Integer | The total number of transaction journals that match the input criteria. |
| transactionJournals | Map<String, Object>[] | The details of the transaction journals. |