1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "invoiceNumber": "INV-001",
12 "issueDate": "",
13 "dueDate": "",
14 "fromName": "Your Company Name",
15 "fromAddress": "Your Address",
16 "fromEmail": "you@example.com",
17 "toName": "Client Name",
18 "toAddress": "Client Address",
19 "toEmail": "client@example.com",
20 "items": [
21 {
22 "description": "Web Development Service",
23 "quantity": 1,
24 "unitPrice": 500
25 },
26 {
27 "description": "Hosting (1 year)",
28 "quantity": 2,
29 "unitPrice": 50
30 }
31 ],
32 "taxRate": 0,
33 "discountPercent": 0,
34 "currency": "$",
35 "notes": "Payment due within 30 days.",
36 "generateHTML": true
37};
38
39
40const run = await client.actor("moving_beacon-owner1/invoice-generator-input").call(input);
41
42
43console.log('Results from dataset');
44console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50