1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "propertyScope": "demo-property-opaque",
12 "exportScope": "daily-purchase-and-paid-order-exports",
13 "purchaseValueBasis": "merchandise net of discounts; excludes tax and shipping",
14 "orderValueBasis": "merchandise net of discounts; excludes tax and shipping",
15 "tolerance": "0.01",
16 "window": {
17 "start": "2026-09-30T00:00:00Z",
18 "end": "2026-10-01T00:00:00Z",
19 "timezone": "Z"
20 },
21 "purchaseCoverage": "complete",
22 "orderCoverage": "complete",
23 "purchases": {
24 "rows": [
25 {
26 "rowId": "00001",
27 "transactionId": "00001",
28 "timestamp": "2026-09-30T12:00:00Z",
29 "currency": "USD",
30 "value": "10.000000"
31 },
32 {
33 "rowId": "00002",
34 "transactionId": "00002",
35 "timestamp": "2026-09-30T12:00:00Z",
36 "currency": "USD",
37 "value": "15.20"
38 },
39 {
40 "rowId": "event-only",
41 "transactionId": "event-only",
42 "timestamp": "2026-09-30T12:00:00Z",
43 "currency": "USD",
44 "value": "4.00"
45 },
46 {
47 "rowId": "duplicate",
48 "transactionId": "duplicate",
49 "timestamp": "2026-09-30T12:00:00Z",
50 "currency": "USD",
51 "value": "12.00"
52 },
53 {
54 "rowId": "duplicate",
55 "transactionId": "duplicate",
56 "timestamp": "2026-09-30T12:00:00Z",
57 "currency": "USD",
58 "value": "12.00"
59 },
60 {
61 "rowId": "currency",
62 "transactionId": "currency",
63 "timestamp": "2026-09-30T12:00:00Z",
64 "currency": "EUR",
65 "value": "9.00"
66 },
67 {
68 "rowId": "missing-id-row",
69 "transactionId": null,
70 "timestamp": "2026-09-30T12:00:00Z",
71 "currency": "USD",
72 "value": "8.00"
73 },
74 {
75 "rowId": "old",
76 "transactionId": "old",
77 "timestamp": "2026-09-29T12:00:00Z",
78 "currency": "USD",
79 "value": "6.00"
80 }
81 ]
82 },
83 "orders": {
84 "rows": [
85 {
86 "rowId": "00001",
87 "transactionId": "00001",
88 "timestamp": "2026-09-30T12:00:00Z",
89 "currency": "USD",
90 "value": "10.01"
91 },
92 {
93 "rowId": "00002",
94 "transactionId": "00002",
95 "timestamp": "2026-09-30T12:00:00Z",
96 "currency": "USD",
97 "value": "15.00"
98 },
99 {
100 "rowId": "order-only",
101 "transactionId": "order-only",
102 "timestamp": "2026-09-30T12:00:00Z",
103 "currency": "USD",
104 "value": "2.00"
105 },
106 {
107 "rowId": "duplicate",
108 "transactionId": "duplicate",
109 "timestamp": "2026-09-30T12:00:00Z",
110 "currency": "USD",
111 "value": "12.00"
112 },
113 {
114 "rowId": "currency",
115 "transactionId": "currency",
116 "timestamp": "2026-09-30T12:00:00Z",
117 "currency": "USD",
118 "value": "9.00"
119 }
120 ]
121 }
122};
123
124
125const run = await client.actor("h_murdock/ga4-order-reconciliation").call(input);
126
127
128console.log('Results from dataset');
129console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
130const { items } = await client.dataset(run.defaultDatasetId).listItems();
131items.forEach((item) => {
132 console.dir(item);
133});
134
135