1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "snapshotId": "parcel-batch-001",
10 "requiredBases": [
11 "declared",
12 "audited",
13 ],
14 "evidenceCoverage": "complete",
15 "csvDelimiter": ",",
16 "policies": [{
17 "scopeId": "example-policy",
18 "policyRef": "Caller example only: no carrier contract claim",
19 "dimensionUnit": "in",
20 "weightUnit": "lb",
21 "dimensionalDivisor": "139",
22 "dimensionRounding": "ceil",
23 "dimensionIncrement": "1",
24 "billableWeightIncrement": "1",
25 "tolerance": "0",
26 }],
27 "measurements": [
28 {
29 "recordId": "0001-declared",
30 "packageId": "0001",
31 "scopeId": "example-policy",
32 "basis": "declared",
33 "length": "4",
34 "width": "48",
35 "height": "4",
36 "dimensionUnit": "in",
37 "actualWeight": "9",
38 "weightUnit": "lb",
39 "recordedAt": "2026-10-01T12:00:00Z",
40 "sourceReference": "packing-review/0001/declared",
41 },
42 {
43 "recordId": "0001-audited",
44 "packageId": "0001",
45 "scopeId": "example-policy",
46 "basis": "audited",
47 "length": "5",
48 "width": "49",
49 "height": "5",
50 "dimensionUnit": "in",
51 "actualWeight": "9",
52 "weightUnit": "lb",
53 "recordedAt": "2026-10-01T12:00:00Z",
54 "sourceReference": "packing-review/0001/audited",
55 },
56 {
57 "recordId": "0002-declared",
58 "packageId": "0002",
59 "scopeId": "example-policy",
60 "basis": "declared",
61 "length": "1",
62 "width": "1",
63 "height": "1",
64 "dimensionUnit": "in",
65 "actualWeight": "100",
66 "weightUnit": "lb",
67 "recordedAt": "2026-10-01T12:00:00Z",
68 "sourceReference": "packing-review/0002/declared",
69 },
70 {
71 "recordId": "0002-audited",
72 "packageId": "0002",
73 "scopeId": "example-policy",
74 "basis": "audited",
75 "length": "1",
76 "width": "1",
77 "height": "1",
78 "dimensionUnit": "in",
79 "actualWeight": "100",
80 "weightUnit": "lb",
81 "recordedAt": "2026-10-01T12:00:00Z",
82 "sourceReference": "packing-review/0002/audited",
83 },
84 {
85 "recordId": "0003-declared",
86 "packageId": "0003",
87 "scopeId": "example-policy",
88 "basis": "declared",
89 "length": "20",
90 "width": "20",
91 "height": "20",
92 "dimensionUnit": "in",
93 "actualWeight": "2",
94 "weightUnit": "lb",
95 "recordedAt": "2026-10-01T12:00:00Z",
96 "sourceReference": "packing-review/0003/declared",
97 },
98 {
99 "recordId": "0003-audited",
100 "packageId": "0003",
101 "scopeId": "example-policy",
102 "basis": "audited",
103 "length": "20",
104 "width": "20",
105 "height": "20",
106 "dimensionUnit": "in",
107 "actualWeight": "2",
108 "weightUnit": "lb",
109 "recordedAt": "2026-10-01T12:00:00Z",
110 "sourceReference": "packing-review/0003/audited",
111 },
112 {
113 "recordId": "0004-declared",
114 "packageId": "0004",
115 "scopeId": "example-policy",
116 "basis": "declared",
117 "length": "10",
118 "width": "10",
119 "height": "10",
120 "dimensionUnit": "in",
121 "actualWeight": "4",
122 "weightUnit": "lb",
123 "recordedAt": "2026-10-01T12:00:00Z",
124 "sourceReference": "packing-review/0004/declared",
125 },
126 ],
127 "measurementsCsv": "",
128 "measurementsColumns": {
129 "recordId": "recordId",
130 "packageId": "packageId",
131 "scopeId": "scopeId",
132 "basis": "basis",
133 "length": "length",
134 "width": "width",
135 "height": "height",
136 "dimensionUnit": "dimensionUnit",
137 "actualWeight": "actualWeight",
138 "weightUnit": "weightUnit",
139 "recordedAt": "recordedAt",
140 "sourceReference": "sourceReference",
141 },
142 "invoices": [
143 {
144 "recordId": "invoice-0001",
145 "packageId": "0001",
146 "scopeId": "example-policy",
147 "billedWeight": "40",
148 "weightUnit": "lb",
149 "sourceReference": "invoice-batch/0001",
150 },
151 {
152 "recordId": "invoice-0002",
153 "packageId": "0002",
154 "scopeId": "example-policy",
155 "billedWeight": "100",
156 "weightUnit": "lb",
157 "sourceReference": "invoice-batch/0002",
158 },
159 {
160 "recordId": "invoice-0003",
161 "packageId": "0003",
162 "scopeId": "example-policy",
163 "billedWeight": "58",
164 "weightUnit": "lb",
165 "sourceReference": "invoice-batch/0003",
166 },
167 ],
168 "invoicesCsv": "",
169 "invoicesColumns": {
170 "recordId": "recordId",
171 "packageId": "packageId",
172 "scopeId": "scopeId",
173 "billedWeight": "billedWeight",
174 "weightUnit": "weightUnit",
175 "sourceReference": "sourceReference",
176 },
177}
178
179
180run = client.actor("h_murdock/parcel-billable-weight-evidence").call(run_input=run_input)
181
182
183print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
184for item in client.dataset(run.default_dataset_id).iterate_items():
185 print(item)
186
187