1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "task": "export_products",
12 "shopifyStore": "my-store.myshopify.com",
13 "format": "json",
14 "dateRange": {
15 "from": "2024-01-01",
16 "to": "2024-12-31"
17 },
18 "orderStatus": "all",
19 "limit": 0,
20 "bulkUpdateData": {
21 "action": "update_prices",
22 "filter": {
23 "tags": [
24 "sale"
25 ]
26 },
27 "updates": {
28 "price_adjustment": "-10%"
29 }
30 },
31 "inventorySyncConfig": {
32 "source": "external_csv",
33 "updateMethod": "set",
34 "notifyOnLowStock": true,
35 "lowStockThreshold": 5
36 },
37 "outputDestination": "dataset"
38};
39
40
41const run = await client.actor("waxlike_polecat/shopify-automation-toolkit").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51