1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "payload": {
9 "title": "Example custom gift box",
10 "base_price_cents": 2500,
11 "currency": "USD",
12 "options": [
13 {
14 "id": "size",
15 "label": "Box size",
16 "values": [
17 {
18 "id": "small",
19 "label": "Small",
20 "price_cents": 0,
21 },
22 {
23 "id": "large",
24 "label": "Large",
25 "price_cents": 1200,
26 },
27 ],
28 },
29 {
30 "id": "finish",
31 "label": "Ribbon finish",
32 "values": [
33 {
34 "id": "cotton",
35 "label": "Cotton",
36 "price_cents": 0,
37 },
38 {
39 "id": "satin",
40 "label": "Satin",
41 "price_cents": 400,
42 },
43 ],
44 },
45 {
46 "id": "card",
47 "label": "Gift card",
48 "values": [
49 {
50 "id": "none",
51 "label": "No card",
52 "price_cents": 0,
53 },
54 {
55 "id": "foil",
56 "label": "Foil card",
57 "price_cents": 300,
58 },
59 ],
60 },
61 ],
62 "rules": [{
63 "if": { "size": "small" },
64 "exclude": { "card": ["foil"] },
65 }],
66 } }
67
68
69run = client.actor("usta/optionforge-product-option-configurator").call(run_input=run_input)
70
71
72print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
73for item in client.dataset(run.default_dataset_id).iterate_items():
74 print(item)
75
76