1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "asOf": "2026-10-01T11:00:00Z",
10 "maxProcessingDelayMinutes": 5,
11 "coverage": [
12 {
13 "scope": {
14 "provider": "stripe",
15 "account": "acct_example_001",
16 "subscription": "orders-subscription",
17 "consumer": "order-worker",
18 },
19 "delivery": {
20 "from": "2026-10-01T09:00:00Z",
21 "to": "2026-10-01T11:00:00Z",
22 "complete": True,
23 },
24 "processing": {
25 "from": "2026-10-01T09:00:00Z",
26 "to": "2026-10-01T11:00:00Z",
27 "complete": True,
28 },
29 },
30 {
31 "scope": {
32 "provider": "github",
33 "account": "example-repo",
34 "subscription": "deployment-subscription",
35 "consumer": "deploy-worker",
36 },
37 "delivery": {
38 "from": "2026-10-01T09:00:00Z",
39 "to": "2026-10-01T11:00:00Z",
40 "complete": True,
41 },
42 "processing": {
43 "from": "2026-10-01T09:00:00Z",
44 "to": "2026-10-01T11:00:00Z",
45 "complete": False,
46 },
47 },
48 ],
49 "deliveries": [
50 {
51 "attemptId": "del_retry_01",
52 "scope": {
53 "provider": "stripe",
54 "account": "acct_example_001",
55 "subscription": "orders-subscription",
56 "consumer": "order-worker",
57 },
58 "eventKey": "evt_recovered",
59 "timestamp": "2026-10-01T09:10:00Z",
60 "outcome": "failed",
61 "httpStatus": 503,
62 },
63 {
64 "attemptId": "del_retry_02",
65 "scope": {
66 "provider": "stripe",
67 "account": "acct_example_001",
68 "subscription": "orders-subscription",
69 "consumer": "order-worker",
70 },
71 "eventKey": "evt_recovered",
72 "timestamp": "2026-10-01T09:11:00Z",
73 "outcome": "acknowledged",
74 "httpStatus": 200,
75 },
76 {
77 "attemptId": "del_gap",
78 "scope": {
79 "provider": "stripe",
80 "account": "acct_example_001",
81 "subscription": "orders-subscription",
82 "consumer": "order-worker",
83 },
84 "eventKey": "evt_ack_gap",
85 "timestamp": "2026-10-01T09:30:00Z",
86 "outcome": "acknowledged",
87 "httpStatus": 200,
88 },
89 {
90 "attemptId": "del_repeat",
91 "scope": {
92 "provider": "stripe",
93 "account": "acct_example_001",
94 "subscription": "orders-subscription",
95 "consumer": "order-worker",
96 },
97 "eventKey": "evt_two_successes",
98 "timestamp": "2026-10-01T09:40:00Z",
99 "outcome": "acknowledged",
100 "httpStatus": 200,
101 },
102 {
103 "attemptId": "del_pending",
104 "scope": {
105 "provider": "stripe",
106 "account": "acct_example_001",
107 "subscription": "orders-subscription",
108 "consumer": "order-worker",
109 },
110 "eventKey": "evt_pending",
111 "timestamp": "2026-10-01T10:59:00Z",
112 "outcome": "acknowledged",
113 "httpStatus": 200,
114 },
115 {
116 "attemptId": "del_partial",
117 "scope": {
118 "provider": "github",
119 "account": "example-repo",
120 "subscription": "deployment-subscription",
121 "consumer": "deploy-worker",
122 },
123 "eventKey": "evt_partial",
124 "timestamp": "2026-10-01T09:50:00Z",
125 "outcome": "acknowledged",
126 "httpStatus": 200,
127 },
128 {
129 "attemptId": "del_future",
130 "scope": {
131 "provider": "stripe",
132 "account": "acct_example_001",
133 "subscription": "orders-subscription",
134 "consumer": "order-worker",
135 },
136 "eventKey": "evt_future",
137 "timestamp": "2026-10-01T10:00:00Z",
138 "outcome": "acknowledged",
139 "httpStatus": 200,
140 },
141 {
142 "attemptId": "del_retry_02",
143 "scope": {
144 "provider": "stripe",
145 "account": "acct_example_001",
146 "subscription": "orders-subscription",
147 "consumer": "order-worker",
148 },
149 "eventKey": "evt_recovered",
150 "timestamp": "2026-10-01T09:11:00Z",
151 "outcome": "acknowledged",
152 "httpStatus": 200,
153 },
154 ],
155 "processing": [
156 {
157 "recordId": "proc_failed",
158 "scope": {
159 "provider": "stripe",
160 "account": "acct_example_001",
161 "subscription": "orders-subscription",
162 "consumer": "order-worker",
163 },
164 "eventKey": "evt_recovered",
165 "timestamp": "2026-10-01T09:11:30Z",
166 "state": "failed",
167 "receivedAt": "2026-10-01T09:11:00Z",
168 },
169 {
170 "recordId": "proc_recovered",
171 "scope": {
172 "provider": "stripe",
173 "account": "acct_example_001",
174 "subscription": "orders-subscription",
175 "consumer": "order-worker",
176 },
177 "eventKey": "evt_recovered",
178 "timestamp": "2026-10-01T09:12:00Z",
179 "state": "succeeded",
180 "receivedAt": "2026-10-01T09:11:00Z",
181 },
182 {
183 "recordId": "proc_repeat_01",
184 "scope": {
185 "provider": "stripe",
186 "account": "acct_example_001",
187 "subscription": "orders-subscription",
188 "consumer": "order-worker",
189 },
190 "eventKey": "evt_two_successes",
191 "timestamp": "2026-10-01T09:41:00Z",
192 "state": "succeeded",
193 "receivedAt": "2026-10-01T09:40:00Z",
194 },
195 {
196 "recordId": "proc_repeat_02",
197 "scope": {
198 "provider": "stripe",
199 "account": "acct_example_001",
200 "subscription": "orders-subscription",
201 "consumer": "order-worker",
202 },
203 "eventKey": "evt_two_successes",
204 "timestamp": "2026-10-01T09:42:00Z",
205 "state": "succeeded",
206 "receivedAt": "2026-10-01T09:40:00Z",
207 },
208 {
209 "recordId": "proc_pending",
210 "scope": {
211 "provider": "stripe",
212 "account": "acct_example_001",
213 "subscription": "orders-subscription",
214 "consumer": "order-worker",
215 },
216 "eventKey": "evt_pending",
217 "timestamp": "2026-10-01T11:00:00Z",
218 "state": "pending",
219 "receivedAt": "2026-10-01T10:59:00Z",
220 },
221 {
222 "recordId": "proc_orphan",
223 "scope": {
224 "provider": "stripe",
225 "account": "acct_example_001",
226 "subscription": "orders-subscription",
227 "consumer": "order-worker",
228 },
229 "eventKey": "evt_orphan",
230 "timestamp": "2026-10-01T10:11:00Z",
231 "state": "succeeded",
232 "receivedAt": "2026-10-01T10:10:00Z",
233 },
234 {
235 "recordId": "proc_future",
236 "scope": {
237 "provider": "stripe",
238 "account": "acct_example_001",
239 "subscription": "orders-subscription",
240 "consumer": "order-worker",
241 },
242 "eventKey": "evt_future",
243 "timestamp": "2026-10-01T11:05:00Z",
244 "state": "succeeded",
245 "receivedAt": "2026-10-01T10:00:00Z",
246 },
247 ],
248}
249
250
251run = client.actor("h_murdock/webhook-processing-reconciliation").call(run_input=run_input)
252
253
254print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
255for item in client.dataset(run.default_dataset_id).iterate_items():
256 print(item)
257
258