1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "invoices": [
12 {
13 "invoiceNumber": "INV-001",
14 "invoiceDate": "2024-01-15",
15 "dueDate": "2024-02-15",
16 "currency": "USD",
17 "seller": {
18 "name": "Acme Corporation",
19 "address": "123 Business Street",
20 "city": "New York",
21 "state": "NY",
22 "zipCode": "10001",
23 "country": "USA",
24 "email": "billing@acme.com",
25 "phone": "+1-555-0100"
26 },
27 "client": {
28 "name": "Client Company Inc",
29 "address": "456 Client Avenue",
30 "city": "Boston",
31 "state": "MA",
32 "zipCode": "02101",
33 "country": "USA",
34 "email": "ap@client.com"
35 },
36 "lineItems": [
37 {
38 "description": "Web Development Services",
39 "quantity": 40,
40 "unitPrice": 150,
41 "taxRate": 10,
42 "discount": 0
43 },
44 {
45 "description": "Hosting Services",
46 "quantity": 1,
47 "unitPrice": 500,
48 "taxRate": 10,
49 "discount": 50
50 }
51 ],
52 "paymentTerms": "Net 30",
53 "notes": "Thank you for your business!",
54 "template": "modern",
55 "primaryColor": "#007bff"
56 }
57 ]
58};
59
60
61const run = await client.actor("haimantika/invoice-apify-actor").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71