1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "treasuryInput": {
12 "company": "Example Food Distribution Ltd.",
13 "reportDate": "2026-10-07",
14 "rates": {
15 "source": "CBRT FX buying",
16 "date": "2026-10-06",
17 "USD": 49.0918,
18 "EUR": 55.1853
19 },
20 "accounts": [
21 {
22 "bank": "Bank A",
23 "account": "TRY current",
24 "type": "current",
25 "currency": "TRY",
26 "balance": 3850000
27 },
28 {
29 "bank": "Bank A",
30 "account": "USD current",
31 "type": "current",
32 "currency": "USD",
33 "balance": 48000
34 },
35 {
36 "bank": "Bank B",
37 "account": "32-day TRY deposit",
38 "type": "deposit",
39 "currency": "TRY",
40 "balance": 9000000,
41 "startDate": "2026-09-10",
42 "maturity": "2026-10-12",
43 "interestRate": 39.5
44 },
45 {
46 "bank": "Bank C",
47 "account": "Money market fund",
48 "type": "fund",
49 "currency": "TRY",
50 "fundCode": "ABC",
51 "units": 2400000,
52 "unitPrice": 2.6815,
53 "priceDate": "2026-10-06",
54 "settlementDays": 1
55 },
56 {
57 "bank": "Bank D",
58 "account": "Guarantee collateral",
59 "type": "deposit",
60 "currency": "TRY",
61 "balance": 2000000,
62 "maturity": "2027-01-15",
63 "blocked": true
64 }
65 ],
66 "fxLiabilities": [
67 {
68 "item": "Import supplier invoice",
69 "type": "supplier",
70 "currency": "USD",
71 "amount": 85000,
72 "due": "2026-10-27"
73 }
74 ],
75 "fxReceivables": [
76 {
77 "item": "Export receivable",
78 "currency": "EUR",
79 "amount": 45000,
80 "due": "2026-11-10"
81 }
82 ],
83 "paymentsNext30Days": 11500000,
84 "fxScenarios": [
85 -10,
86 10,
87 20,
88 30
89 ]
90 }
91};
92
93
94const run = await client.actor("bloom-consulting/cash-fx-position").call(input);
95
96
97console.log('Results from dataset');
98console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
99const { items } = await client.dataset(run.defaultDatasetId).listItems();
100items.forEach((item) => {
101 console.dir(item);
102});
103
104