1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "template": "https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/invoice-template-example.docx?signature=190drBPUUHMJlHQInNGAv",
10 "data": {
11 "company": {
12 "name": "Northwind Studio",
13 "address": "12 Harbor Lane, Portland, ME 04101",
14 "email": "billing@northwind.example",
15 "payment": "bank transfer to account 0012 3456 78",
16 },
17 "number": "INV-2026-0142",
18 "issued": "2026-10-25",
19 "due": "2026-11-24",
20 "client": {
21 "name": "Blue Fern Cafe",
22 "address": "88 Market Street, Springfield, IL 62701",
23 "email": "accounts@bluefern.example",
24 },
25 "items": [
26 {
27 "description": "Website redesign",
28 "qty": 1,
29 "price": 2400,
30 },
31 {
32 "description": "Product photography (half day)",
33 "qty": 2,
34 "price": 350,
35 },
36 {
37 "description": "Hosting, 12 months",
38 "qty": 12,
39 "price": 15,
40 },
41 ],
42 "subtotal": 3280,
43 "tax_rate": 0.08,
44 "tax": 262.4,
45 "total": 3542.4,
46 "notes": "Thank you! Please put the invoice number on your payment.",
47 },
48}
49
50
51run = client.actor("jumblemog/docx-template-filler").call(run_input=run_input)
52
53
54print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
55for item in client.dataset(run.default_dataset_id).iterate_items():
56 print(item)
57
58